diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2018-04-17 19:35:30 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2018-04-17 19:35:30 +0000 |
commit | 4388d2883c58230cce1f540066c8955e2e4964de (patch) | |
tree | 9b54546b1905d1579d85f65e74cac6365090bd46 /libclc | |
parent | 0d92f3047f2bafc60f0d48fcb6e2e5197c97318d (diff) |
pown: Use denormal path only
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: 330206
Diffstat (limited to 'libclc')
-rw-r--r-- | libclc/generic/lib/math/clc_pown.cl | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/libclc/generic/lib/math/clc_pown.cl b/libclc/generic/lib/math/clc_pown.cl index f5b36b3d14af..0b7ac327512d 100644 --- a/libclc/generic/lib/math/clc_pown.cl +++ b/libclc/generic/lib/math/clc_pown.cl @@ -167,17 +167,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_pown(float x, int ny) tv = USE_TABLE(exp_tbl_ep, j); float expylogx = mad(tv.s0, poly, mad(tv.s1, poly, tv.s1)) + tv.s0; - float sexpylogx; - if (!__clc_fp32_subnormals_supported()) { - int explg = ((as_uint(expylogx) & EXPBITS_SP32 >> 23) - 127); - m = (23-(m + 149)) == 0 ? 1: m; - uint mantissa = ((as_uint(expylogx) & MANTBITS_SP32)|IMPBIT_SP32) >> (23-(m + 149)); - sexpylogx = as_float(mantissa); - } else { - sexpylogx = expylogx * as_float(0x1 << (m + 149)); - } - - + float sexpylogx = expylogx * as_float(0x1 << (m + 149)); float texpylogx = as_float(as_int(expylogx) + m2); expylogx = m < -125 ? sexpylogx : texpylogx; |