Article View: comp.arch
Article #21276Re: Understanding variations in Dhrystone performance
From: Henry Spencer
Date: Tue, 16 May 1989 17:23
Date: Tue, 16 May 1989 17:23
15 lines
1173 bytes
1173 bytes
In article <1989May15.173631.3029@utzoo.uucp> I wrote: > (((x & ~0x80808080) - 0x01010101) & 0x80808080) > >The result is nonzero if, and only if, there was a NUL byte in x... Oops, my mistake, it does get a false alarm on an 0x80. So you do end up needing a false-alarm filter. There are ways around this, but they add their own overheads. Nevertheless, alignment permitting, using a fast filter like this is a considerable win if you're scanning big chunks of text. Now, how worthwhile *any* of this is for typical C strings is a different question -- it's hard to amortize any significant setup overhead over the short strings typically found in real code. -- Subversion, n: a superset | Henry Spencer at U of Toronto Zoology of a subset. --J.J. Horning | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
Technical Details
Message-ID:
<1989May16.172354.1417@utzoo.uucp>Path:
arc1-ca.pugleaf.net!utzoo!henryReferences:
<474@estevax.UUCP> <1989May15.173631.3029@utzoo.uucp>Show Full Headers
Complete Article Headers
Newsgroups: comp.arch Path: arc1-ca.pugleaf.net!utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Understanding variations in Dhrystone performance Message-ID: <1989May16.172354.1417@utzoo.uucp> Organization: U of Toronto Zoology References: <474@estevax.UUCP> <1989May15.173631.3029@utzoo.uucp> Date: Tue, 16 May 89 17:23:54 GMT