mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
remove ASM div64_32() implementation
* Prone to miscompilation * Only helps with very old PCs * Really only helps with voxel rendering
This commit is contained in:
parent
3034f5d2c4
commit
1b0b2f7599
@ -30,20 +30,6 @@
|
||||
|
||||
#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;
|
||||
}
|
||||
volatile int32_t lo = a;
|
||||
volatile int32_t hi = a >> 32;
|
||||
asm("idivl %[divisor]" : "+a" (lo), "+d" (hi) : [divisor] "r" (b));
|
||||
return lo;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define div64_32(a, b) ((fixed_t)((a) / (b)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user