Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Fix sinH to return the valid result intead of nan
Browse files Browse the repository at this point in the history
A previous change swapped the return values so that the function
return nan when BUILTIN_ISFINITE_F16 is true.

Change-Id: Ie37ced76c5b53787016bf1437a00cec3c2e34191
(cherry picked from commit 05637f6)
  • Loading branch information
bcahoon committed Nov 3, 2022
1 parent c812a99 commit 8cf1b11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocml/src/sinH.cl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MATH_MANGLE(sin)(half x)
s ^= (r.i > (short)1 ? (short)0x8000 : (short)0) ^ (AS_SHORT(x) & (short)0x8000);

if (!FINITE_ONLY_OPT()) {
s = BUILTIN_ISFINITE_F16(ax) ?(short)QNANBITPATT_HP16 : s;
s = BUILTIN_ISFINITE_F16(ax) ? s : (short)QNANBITPATT_HP16;
}

return AS_HALF(s);
Expand Down

0 comments on commit 8cf1b11

Please sign in to comment.