Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!enea!diab!pf From: pf@diab.UUCP (Per Fogelstrom) Newsgroups: comp.arch Subject: Re: Dhrystones & string ops [Was vectors] Message-ID: <280@diab.UUCP> Date: Sat, 1-Aug-87 06:24:59 EDT Article-I.D.: diab.280 Posted: Sat Aug 1 06:24:59 1987 Date-Received: Tue, 4-Aug-87 04:28:21 EDT References: <279@diab.UUCP> <17780@amdcad.AMD.COM> Reply-To: pf@.UUCP (Per Fogelstrom) Distribution: world Organization: Diab Data AB, Taby, Sweden Lines: 42 Keywords: String op's, Dhrystone, benchmarks Summary: String instructions are useable. In article <17780@amdcad.AMD.COM> tim@amdcad.UUCP (Tim Olson) writes: +------ |In article <279@diab.UUCP> pf@.UUCP (Per Fogelstrom) writes: |+----- || What this benchmark really tests is the compilers ability to remove code that || does'nt really do anything. And of course the cpu's ability to handle strings. || Just check the Am29000. The designers put in an instruction just to speed up || this benchmark.... Now what, have we reaced a new point, where cpu's are || designed for the bencmarks instead of vice versa, as it was before ???? |+----- |No, we didn't put in the cpbyte instruction to "speed up Dhrystone" -- |it was added because many internal programs that we ran showed that such |an instruction could be used to speed up C string handling (size |unknown, string terminated by a \0) in general. +------ Sorry ! Didn't wanted to pick on you. Yes! The Am29000 is good at strings. But can one make use of such a instruction (cpbyte) in compiler code generation?? Of course it is possible to use it in assembly written librarys. But to often i have seen programs that do not make use of the 'C' library string routines, mayby because they are inefficient. +------- |Many processors have specialized instructions for strings -- Intel's 80x86 |family (movs, cmps), AT&T's 32100 (strlen, strcmp), National's 32x32 |family (movs, cmps), NEC's V70 (movc, cmpc), Fairchild's Clipper (movc, |cmpc macros). However, most of these don't address "C-type" strings; |they require a character count as a parameter. +------- Wrong! At least in the NS32x32 case. They do address "C-type" strings, and many other string constructs as well, not only \0 terminated strings. The character count parameter can be ignored if it is set to a 'huge' value (e.g 2**32-1). I myslf is using string instructions in C-librarys and it is possible to detect the "while( *p1++ = *p2++)" in a 'C' program. (We here at Diab can in our C-compiler). -- Per Fogelstrom, Diab Data AB SNAIL: Box 2029, S-183 02 Taby, Sweden ANALOG: +46 8-7680660 UUCP: seismo!mcvax!enea!diab!pf