mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
Merge pull request #2220 from fabiangreffrath/volatile_div64_32
remove ASM div64_32() implementation
This commit is contained in:
commit
b89a6ae954
@ -30,20 +30,6 @@
|
|||||||
|
|
||||||
#define div64_32(a, b) _div64((a), (b), NULL)
|
#define div64_32(a, b) _div64((a), (b), NULL)
|
||||||
|
|
||||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
|
||||||
|
|
||||||
inline static int32_t div64_32(int64_t a, int32_t b)
|
|
||||||
{
|
|
||||||
if (__builtin_constant_p(b))
|
|
||||||
{
|
|
||||||
return a / b;
|
|
||||||
}
|
|
||||||
int32_t lo = a;
|
|
||||||
int32_t hi = a >> 32;
|
|
||||||
asm("idivl %[divisor]" : "+a" (lo), "+d" (hi) : [divisor] "r" (b));
|
|
||||||
return lo;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define div64_32(a, b) ((fixed_t)((a) / (b)))
|
#define div64_32(a, b) ((fixed_t)((a) / (b)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user