andy@CSVAX.CALTECH.EDU (Andy Fyfe) (02/05/89)
The following adds the names of the 3b1 library routines for multiplication, division, and remainder. It seems that gcc supresses unsigned multiplies and replaces them with the signed version. (line 1278 of expmed.c) In the case of the 3b1 library routines (and also the sun2 ones, from a quick glance) the code for the unsigned multiply is the more efficient. Perhaps this optimization is best reserved for the case when there's an instruction for one and not the other? *** save/tm-3b1.h Fri Feb 3 17:26:07 1989 --- tm-3b1.h Sat Feb 4 06:28:25 1989 *************** *** 454,456 **** --- 454,467 ---- #define SDB_GENERATE_FAKE(BUFFER, NUMBER) \ sprintf ((BUFFER), "~%dfake", (NUMBER)); + + /* Define subroutines to call to handle multiply, divide, and remainder. + Use the subroutines that the 3b1's library provides. + The `*' prevents an underscore from being prepended by the compiler. */ + + #define DIVSI3_LIBCALL "*ldiv" + #define UDIVSI3_LIBCALL "*uldiv" + #define MODSI3_LIBCALL "*lrem" + #define UMODSI3_LIBCALL "*ulrem" + #define MULSI3_LIBCALL "*lmul" + #define UMULSI3_LIBCALL "*ulmul"