[comp.lang.c] vax `%'

chris@mimsy.UUCP (Chris Torek) (12/18/88)

In article <771@quintus.UUCP> ok@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@mimsy.umd.edu	Path:	uunet!mimsy!chris