Lines 63-69
Link Here
|
63 |
/* killough 5/10/98: In djgpp, use inlined assembly for performance |
63 |
/* killough 5/10/98: In djgpp, use inlined assembly for performance |
64 |
* CPhipps - made __inline__ to inline, as specified in the gcc docs |
64 |
* CPhipps - made __inline__ to inline, as specified in the gcc docs |
65 |
* Also made const */ |
65 |
* Also made const */ |
66 |
inline static const fixed_t FixedMul(fixed_t a, fixed_t b) |
66 |
inline static CONSTFUNC fixed_t FixedMul(fixed_t a, fixed_t b) |
67 |
{ |
67 |
{ |
68 |
fixed_t result; |
68 |
fixed_t result; |
69 |
int dummy; |
69 |
int dummy; |
Lines 103-109
Link Here
|
103 |
* killough 9/5/98: optimized to reduce the number of branches |
103 |
* killough 9/5/98: optimized to reduce the number of branches |
104 |
* CPhipps - made __inline__ to inline, as specified in the gcc docs |
104 |
* CPhipps - made __inline__ to inline, as specified in the gcc docs |
105 |
* Also made const */ |
105 |
* Also made const */ |
106 |
inline static const fixed_t FixedDiv(fixed_t a, fixed_t b) |
106 |
inline static CONSTFUNC fixed_t FixedDiv(fixed_t a, fixed_t b) |
107 |
{ |
107 |
{ |
108 |
if (abs(a) >> 14 < abs(b)) |
108 |
if (abs(a) >> 14 < abs(b)) |
109 |
{ |
109 |
{ |
Lines 126-132
Link Here
|
126 |
#else /* I386_ASM */ |
126 |
#else /* I386_ASM */ |
127 |
/* CPhipps - made __inline__ to inline, as specified in the gcc docs |
127 |
/* CPhipps - made __inline__ to inline, as specified in the gcc docs |
128 |
* Also made const */ |
128 |
* Also made const */ |
129 |
inline static const fixed_t FixedDiv(fixed_t a, fixed_t b) |
129 |
inline static CONSTFUNC fixed_t FixedDiv(fixed_t a, fixed_t b) |
130 |
{ |
130 |
{ |
131 |
return (abs(a)>>14) >= abs(b) ? ((a^b)>>31) ^ INT_MAX : |
131 |
return (abs(a)>>14) >= abs(b) ? ((a^b)>>31) ^ INT_MAX : |
132 |
(fixed_t)(((int_64_t) a << FRACBITS) / b); |
132 |
(fixed_t)(((int_64_t) a << FRACBITS) / b); |
Lines 138-144
Link Here
|
138 |
* FixedMod - returns a % b, guaranteeing 0<=a<b |
138 |
* FixedMod - returns a % b, guaranteeing 0<=a<b |
139 |
* (notice that the C standard for % does not guarantee this) |
139 |
* (notice that the C standard for % does not guarantee this) |
140 |
*/ |
140 |
*/ |
141 |
inline static const fixed_t FixedMod(fixed_t a, fixed_t b) |
141 |
inline static CONSTFUNC fixed_t FixedMod(fixed_t a, fixed_t b) |
142 |
{ |
142 |
{ |
143 |
if (b & (b-1)) { |
143 |
if (b & (b-1)) { |
144 |
fixed_t r = a % b; |
144 |
fixed_t r = a % b; |