vax `%'

Chris Torek chris at mimsy.UUCP
Sun Dec 18 04:22:13 AEST 1988


In article <771 at quintus.UUCP> ok at quintus.uucp (Richard A. O'Keefe) writes:
>... the VAX has an EDIV instruction, but it is awkward to set up.  The 4.1BSD
>C compiler would generate the equivalent of x-(x/y)*y for x%y.  For those
>with SPARCs, a look at the code generated for x%y might be illuminating.

It still does.  EDIV is not just hard to use (actually, it is `just not
hard to use'---it needs register pairs, but double precision needs register
pairs too, so that code already exists).  EDIV is *slow*. t=x-(x/y)*y is
considerably faster than EDIV x,y,trash,t.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list