remquo: Flush denormals if not supported

It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs.
Fixes CTS on carrizo and turks.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 331435
This commit is contained in:
Jan Vesely 2018-05-03 05:44:28 +00:00
parent 8db45e4cf1
commit 21e77037c0
1 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,8 @@
_CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y, __private int *quo)
{
x = __clc_flush_denormal_if_not_supported(x);
y = __clc_flush_denormal_if_not_supported(y);
int ux = as_int(x);
int ax = ux & EXSIGNBIT_SP32;
float xa = as_float(ax);