msvc/sh4: Compilation fix for cvt_f2i_t
This commit is contained in:
parent
8194254fa1
commit
4dd6ccea8d
|
@ -719,6 +719,8 @@ shil_opc_end()
|
|||
|
||||
//shop_cvt_f2i_t //float to integer : truncate
|
||||
shil_opc(cvt_f2i_t)
|
||||
|
||||
#if HOST_CPU == CPU_X86 || HOST_CPU == CPU_X64
|
||||
shil_canonical
|
||||
(
|
||||
u32,f1,(f32 f1),
|
||||
|
@ -727,14 +729,24 @@ u32,f1,(f32 f1),
|
|||
else
|
||||
{
|
||||
s32 res = (s32)f1;
|
||||
#if HOST_CPU == CPU_X86 || HOST_CPU == CPU_X64
|
||||
|
||||
// Fix result sign for Intel CPUs
|
||||
if (res == 0x80000000 && *(s32 *)&f1 > 0)
|
||||
res = 0x7fffffff;
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
)
|
||||
#else
|
||||
shil_canonical
|
||||
(
|
||||
u32,f1,(f32 f1),
|
||||
if (f1 > 2147483520.0f) // IEEE 754: 0x4effffff
|
||||
return 0x7fffffff;
|
||||
else
|
||||
return (s32)f1;
|
||||
)
|
||||
#endif
|
||||
|
||||
shil_compile
|
||||
(
|
||||
|
|
Loading…
Reference in New Issue