Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!amdcad!decwrl!vixie From: vixie@decwrl.dec.com (Paul A Vixie) Newsgroups: comp.arch Subject: Re: Endian wars - really 386 question Message-ID: Date: 29 Jan 89 08:52:05 GMT References: <6133@columbia.edu> <5124@aldebaran.UUCP> <7@microsoft.UUCP> Sender: vixie@decwrl.dec.com Organization: DEC Western Research Lab Lines: 16 In-reply-to: jangr@microsoft.UUCP's message of 28 Jan 89 00:04:24 GMT [Jan Gray] # This went around comp.arch a while ago. # has_NUL = (((i-0x01010101)&~i)&0x80808080) != 0, # e.g. "test if there were any borrows as a result of the bytewise subtracts" # # Using this trick on the '386, strlen on long strings can be made about 30% # faster than using the dedicated string instruction "rep scasb"! (Except this # will cause many instruction fetches that will keep your bus busy.) Wait a minute... This is probably a silly question, more so since it comes from the moderator of , but... doesn't the '386 have a cache for recently used instructions? -- Paul Vixie Work: vixie@decwrl.dec.com decwrl!vixie +1 415 853 6600 Play: paul@vixie.sf.ca.us vixie!paul +1 415 864 7013