Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: vax `%' Message-ID: <15049@mimsy.UUCP> Date: 17 Dec 88 18:22:13 GMT References: <1388@aucs.UUCP> <729@convex.UUCP> <1961@crete.cs.glasgow.ac.uk> <771@quintus.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 12 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