Skip to content

Commit 1bebbac

Browse files
authored
Fix call to _mm_cvtps_ph in half.h (#448)
_mm_cvtps_ph doesn't support _MM_FROUND_NO_EXC. On Windows, if this is compiled, you will get the following warning: `warning C4556: value of intrinsic immediate argument '8' is out of range '0 - 7'` There is no corresponding instruction, so the flag should be removed. References: https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cvtps_ph&ig_expand=2244,2221,2220,2221,2252,2220,2221,2220,2221,2221,2107,2252,2107,2107 https://developercommunity.visualstudio.com/t/-mm-cvtps-ph-doesnt-accept-mm-fround-no-exc/1343857 Signed-off-by: John Mather <[email protected]>
1 parent 95923d2 commit 1bebbac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Imath/half.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ imath_float_to_half (float f)
378378
// msvc does not seem to have cvtsh_ss :(
379379
return _mm_extract_epi16 (
380380
_mm_cvtps_ph (
381-
_mm_set_ss (f), (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC)),
381+
_mm_set_ss (f), (_MM_FROUND_TO_NEAREST_INT)),
382382
0);
383383
# else
384384
// preserve the fixed rounding mode to nearest

0 commit comments

Comments
 (0)