Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!oddjob!gargoyle!ihnp4!cuae2!killer!molly From: molly@killer.UUCP (Molly Fredericks) Newsgroups: comp.arch Subject: Re: Dhrystones & string ops [Was vectors] Message-ID: <1331@killer.UUCP> Date: Fri, 14-Aug-87 03:36:14 EDT Article-I.D.: killer.1331 Posted: Fri Aug 14 03:36:14 1987 Date-Received: Sun, 16-Aug-87 02:34:56 EDT References: <279@diab.UUCP> <17780@amdcad.AMD.COM> <280@diab.UUCP> <712@csun.UUCP> Organization: The Unix(tm) Connection, Dallas, Texas Lines: 52 Keywords: String op's, Dhrystone, benchmarks Summary: Old news for Vaxen ... In article <712@csun.UUCP>, aeusesef@csun.UUCP (Sean Eric Fagan) writes: > In article <280@diab.UUCP> pf@.UUCP (Per Fogelstrom) writes: > >In article <17780@amdcad.AMD.COM> tim@amdcad.UUCP (Tim Olson) writes: > >+------ > >|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 > > Hold on! The WE32100 chip *DOES* use C type strings. The instructions, > incidentally, are STREND and STRCPY. STREND uses %r0, and increments it > until it comes to a '\0', while STRCPY copies %r0 to %r1 until it comes to a > '\0'. Unnecessary and useless fact designed to eat up line space so that > the news poster won't complain: the 3B[5 at least] Unix that comes > with it (SysVr2.0) uses the STRCPY instruction for the strcpy() function, > but it does not use the STREND instruction for the strlen() routine. > And, the assembler requires that these instructions be in UPPER CASE. > Very strange machine. I'm sure this is no major revalation, but I seem to recall that Vaxen have a rather nice collection of string instructions. With the rumors (reality ???) that DEC is now selling the chips for uVaxen to OEMs, I think it is time to throw that number into the hat. I gave assembly up for C years ago (just after college ...) but I do recall instructions that could be used for strlen, strcpy, strncpy, strcmp, and strncmp. The instructions I'm thinking about are MOVC5, MOVC3, SPAN (SCAN?) - anyhow, I don't have my Levi and Eckhouse book (yick) close at hand, so I make no promises about what those guys, especially the baby Vax's, do or don't have. The way I remember them working was something like: MOVQ SRC_DESCRIPTOR, R0 MOVQ DST_DESCRIPTOR, R2 MOVB END_CHARACTER, R4 MOVC5 R0,R1,R2,R3,R4 and more or less poof! Instant strcpy (with error checking no less!) Of course, you have to finish with moving the lenght of the source string, or the length of the destination strings, whichever was smaller, into the length of the destination string in the descriptor. One bummer about those guys, I remember that MOVC5 was real bad about trashing R0 .. R5 or so. I think even MOVC3 ate plenty of your registers, which was a real bastard to deal with. Maybe I should go looking through the boxes for that book ...