Skip to content

Commit

Permalink
update long2float
Browse files Browse the repository at this point in the history
  • Loading branch information
wwXing0 committed Dec 6, 2023
1 parent a690ce4 commit 9d4c698
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test_conformance/conversions/conversions_data_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,10 @@ void DataInfoSpec<InType, OutType>::conv(OutType *out, InType *in)
cl_float outVal = 0.f;

#if defined(_MSC_VER) && defined(_M_X64)
cl_ulong l = ((cl_ulong *)in)[0];
float result;
if (std::is_same<cl_ulong, InType>::value)
{
cl_ulong l = ((cl_ulong *)in)[0];
cl_long sl = ((cl_long)l < 0) ? (cl_long)((l >> 1) | (l & 1))
: (cl_long)l;
_mm_store_ss(&result, _mm_cvtsi64_ss(_mm_setzero_ps(), sl));
Expand All @@ -435,6 +435,7 @@ void DataInfoSpec<InType, OutType>::conv(OutType *out, InType *in)
}
else
{
cl_long l = ((cl_long *)in)[0];
_mm_store_ss(&result, _mm_cvtsi64_ss(_mm_setzero_ps(), l));
outVal = (l == 0 ? 0.0f : result); // Per IEEE-754-2008 5.4.1,
// 0's always convert to +0.0
Expand Down

0 comments on commit 9d4c698

Please sign in to comment.