Merge pull request #2220 from fabiangreffrath/volatile_div64_32

remove ASM div64_32() implementation
This commit is contained in:
Fabian Greffrath 2025-03-04 13:02:42 +01:00 committed by GitHub
commit b89a6ae954
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)))