Skip to content

Commit

Permalink
fix for unclear clang format discrepancy
Browse files Browse the repository at this point in the history
  • Loading branch information
shajder committed Nov 15, 2023
1 parent 26c507f commit a99d062
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test_conformance/conversions/conversions_data_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,8 @@ void DataInfoSpec<InType, OutType, InFP, OutFP>::conv_sat(OutType *out,
#else
*out = x >= MAKE_HEX_DOUBLE(0x1.0p64, 0x1LL, 64)
? (OutType)0xFFFFFFFFFFFFFFFFULL
: x < 0 ? 0 : (OutType)x;
: x < 0 ? 0
: (OutType)x;
#endif
}
else if ((std::is_same<InType, cl_float>::value || is_in_half())
Expand All @@ -637,16 +638,17 @@ void DataInfoSpec<InType, OutType, InFP, OutFP>::conv_sat(OutType *out,
*out = f >= MAKE_HEX_DOUBLE(0x1.0p63, 0x1LL, 63)
? (OutType)0x7FFFFFFFFFFFFFFFULL
: f < MAKE_HEX_DOUBLE(-0x1.0p63, -0x1LL, 63)
? (OutType)0x8000000000000000LL
: (OutType)f;
? (OutType)0x8000000000000000LL
: (OutType)f;
}
else if (std::is_same<InType, cl_double>::value
&& std::is_same<cl_ulong, OutType>::value)
{
InType f = rint(*in);
*out = f >= MAKE_HEX_DOUBLE(0x1.0p64, 0x1LL, 64)
? (OutType)0xFFFFFFFFFFFFFFFFULL
: f < 0 ? 0 : (OutType)f;
: f < 0 ? 0
: (OutType)f;
}
else if (std::is_same<InType, cl_double>::value
&& std::is_same<cl_long, OutType>::value)
Expand All @@ -655,8 +657,8 @@ void DataInfoSpec<InType, OutType, InFP, OutFP>::conv_sat(OutType *out,
*out = f >= MAKE_HEX_DOUBLE(0x1.0p63, 0x1LL, 63)
? (OutType)0x7FFFFFFFFFFFFFFFULL
: f < MAKE_HEX_DOUBLE(-0x1.0p63, -0x1LL, 63)
? (OutType)0x8000000000000000LL
: (OutType)f;
? (OutType)0x8000000000000000LL
: (OutType)f;
}
else
{ // in half/float/double, out char/uchar/short/ushort/int/uint
Expand Down

0 comments on commit a99d062

Please sign in to comment.