let indev compile this branch uwu
This commit is contained in:
1 parent
634f8897b4
commit
944e019020
1 file changed
+7
-3
+7
-3
@@ -68,21 +68,25 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FloatToFixed(float f)
|
||||
*/
|
||||
FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedMul(fixed_t a, fixed_t b)
|
||||
{
|
||||
#if defined(_WIN32) && defined(__MINGW64__)
|
||||
int32_t a_int = (int32_t)a;
|
||||
int32_t b_int = (int32_t)b;
|
||||
|
||||
// Perform fixed-point multiplication using intrinsics
|
||||
int64_t result_int = _mul128(a_int, b_int, NULL);
|
||||
|
||||
// Right shift by FRACBITS
|
||||
result_int >>= FRACBITS;
|
||||
|
||||
// Cast the result back to fixed_t
|
||||
fixed_t result = (fixed_t)result_int;
|
||||
|
||||
return result;
|
||||
#else
|
||||
return (fixed_t)(((UINT64)((INT64)a * b)) >> FRACBITS);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief The FixedDiv2 function
|
||||
|
||||
\param a fixed_t number
|
||||
|
||||
Reference in new issue
Block a user