4
/* have assembler macros */
6
#define add_carry(x,y,h) \
7
({ ulong __res,__x =(x),__y=(y); \
11
: "=r" (__res),"=r" (h) \
12
: "r" (__x) , "rn" (__y),"1" (h) ); \
16
/* SET_MACHINE_CARRY Set the machine carry flag
17
if overflow = 1 otherwise clear it.
20
#define SET_MACHINE_CARRY(overflow) \
21
asm volatile("subcc %%g0,%0,%%g0" \
24
/* SET_OVERFLOW Set the overflow = the current carry code
25
Note that machine loads and mov's should not affect
29
#define SET_OVERFLOW \
30
asm volatile("addx %%g0,%%g0,%0" \
34
({ulong res; asm("addxcc %1,%2,%0" \
36
"r" (u),"r" (v)); res;})
38
({ulong res; asm("subxcc %1,%2,%0" \
40
"r" (u),"r" (v)); res;})
42
/* get a copy of mulul3 included for when inlining not there */
45
#define mulul(a,b,__hi) \
46
({unsigned plong __x=(a),__y=(b); \
50
andncc %%o4,0xfff,%%g0
105
mulscc %%o4,%%g0,%%o4
112
: "=r" (__x),"=&r" (__hi): \
113
"0" (__x),"r" (__y): \
114
"%o4","%o5"); __x;}) /* "y" should be hear in that it is munged */
115
/* the above '=&r' indicates that the register for _hi may NOT be the
116
same reg as used by __y.*/
120
#else /* no __GNUC__ */