Skip to content

Commit

Permalink
Fix fast_exp2 with MSVC and sse4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Apr 14, 2023
1 parent a77e362 commit defb06b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/include/OpenImageIO/fmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -2068,7 +2068,10 @@ OIIO_FORCEINLINE OIIO_HOSTDEVICE T fast_exp2 (const T& xval) {
r = madd(x, r, kD);
r = madd(x, r, kE);
r = madd(x, r, one);
return bitcast_to_float (bitcast_to_int(r) + (m << 23));

intN i = bitcast_to_int(r);
T f = bitcast_to_float(i + (m << 23));
return f;
#else
T r;
for (int i = 0; i < r.elements; ++i)
Expand Down

0 comments on commit defb06b

Please sign in to comment.