parent
7abca69750
commit
d837653b5f
|
@ -632,20 +632,20 @@ FORCEINLINE s32 vec3dot_fixed32(const s32* a, const s32* b) {
|
|||
//I'm going to start name these functions GE for GEOMETRY ENGINE MATH.
|
||||
//Pretty much any math function in this file should be explicit about how it's handling precision.
|
||||
//Handling that stuff generically globally is not a winning proposition.
|
||||
|
||||
FORCEINLINE s64 GEM_Mul32x32To64(const s32 a, const s32 b)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return __emul(a,b);
|
||||
#else
|
||||
return ((s64)a)*((s64)b);
|
||||
#endif
|
||||
|
||||
FORCEINLINE s64 GEM_Mul32x32To64(const s32 a, const s32 b)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return __emul(a,b);
|
||||
#else
|
||||
return ((s64)a)*((s64)b);
|
||||
#endif
|
||||
}
|
||||
|
||||
static s32 GEM_SaturateAndShiftdown36To32(const s64 val)
|
||||
{
|
||||
if(val>0x000007FFFFFFFFFFLL) return 0x7FFFFFFF;
|
||||
if(val<0xFFFFF80000000000LL) return 0x80000000;
|
||||
if(val>(s64)0x000007FFFFFFFFFFULL) return (s32)0x7FFFFFFFU;
|
||||
if(val<(s64)0xFFFFF80000000000ULL) return (s32)0x80000000U;
|
||||
|
||||
return fx32_shiftdown(val);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue