Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions system/include/compat/emmintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ _mm_cvtsd_si64(__m128d __a)
// TODO: optimize
if (isnan(__a[0]) || isinf(__a[0])) return 0x8000000000000000LL;
long long x = llrint(__a[0]);
if (x != 0xFFFFFFFF00000000ULL && (x != 0 || fabsf(__a[0]) < 2.f))
if (x != 0xFFFFFFFF00000000ULL && (x != 0 || fabs(__a[0]) < 2.f))
return x;
else
return 0x8000000000000000LL;
Expand All @@ -1018,10 +1018,10 @@ static __inline__ long long __attribute__((__always_inline__, __nodebug__))
_mm_cvttsd_si64(__m128d __a)
{
// TODO: optimize
float e = __a[0];
double e = __a[0];
if (isnan(e) || isinf(e) || e > LLONG_MAX || e < LLONG_MIN) return 0x8000000000000000LL;
long long x = llrint(e);
if (x != 0xFFFFFFFF00000000ULL && (x != 0 || fabsf(e) < 2.f))
if (x != 0xFFFFFFFF00000000ULL && (x != 0 || fabs(e) < 2.f))
// Use the trapping instruction here since we have explicit bounds checks
// above
return __builtin_wasm_trunc_s_i64_f32(e);
Expand Down
4 changes: 2 additions & 2 deletions system/include/compat/xmmintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ static __inline__ long long __attribute__((__always_inline__, __nodebug__, DIAGN
_mm_cvtss_si64(__m128 __a)
{
if (isnan(((__f32x4)__a)[0]) || isinf(((__f32x4)__a)[0])) return 0x8000000000000000LL;
long long x = llrint(((__f32x4)__a)[0]);
long long x = llrintf(((__f32x4)__a)[0]);
if (x != 0xFFFFFFFF00000000ULL && (x != 0 || fabsf(((__f32x4)__a)[0]) < 2.f))
return x;
else
Expand All @@ -640,7 +640,7 @@ _mm_cvttss_si64(__m128 __a)
{
float e = ((__f32x4)__a)[0];
if (isnan(e) || isinf(e) || e > LLONG_MAX || e < LLONG_MIN) return 0x8000000000000000LL;
long long x = llrint(e);
long long x = llrintf(e);
if (x != 0xFFFFFFFF00000000ULL && (x != 0 || fabsf(e) < 2.f))
return (long long)e;
else
Expand Down
Loading