Commit Graph

343 Commits

Author SHA1 Message Date
Jan Vesely
dbaf6d0f7c Move cl_khr_fp64 exntension enablement to gentype include lists
This will make adding cl_khr_fp16 support easier

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326816
2018-03-06 17:48:35 +00:00
Jan Vesely
1c570566c3 Add vstore_half_rte implementation
Passes CTS on carrizo

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 324376
2018-02-06 18:44:50 +00:00
Jan Vesely
f2d876ae83 Add vstore_half_rtp implementation
Passes CTS on carrizo

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 324375
2018-02-06 18:44:47 +00:00
Jan Vesely
2655312c69 Add vstore_half_rtn implementation
Passes CTS on carrizo

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 324374
2018-02-06 18:44:45 +00:00
Jan Vesely
d526a2b6e8 Add vstore_half_rtz implementation
Passes CTS on carrizo

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 324373
2018-02-06 18:44:43 +00:00
Jan Vesely
4475aca172 vstore_half: Consolidate declarations
Add support for rounding suffix

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 324372
2018-02-06 18:44:41 +00:00
Jan Vesely
187ec00556 vstore_half: Add support for custom rounding functions
Add another layer of indirection
This will be used for specific rounding modes

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 324371
2018-02-06 18:44:39 +00:00
Jan Vesely
87036d2701 vstore_half: Make sure the helper function is always inline
Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 324370
2018-02-06 18:44:35 +00:00
Jan Vesely
3b8b4eb64d half_powr: Implement using powr
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 323942
2018-02-01 03:00:35 +00:00
Jan Vesely
a75677c2b7 math.h: Use logical operations instead of bit operations for readability
Trivial.

Reported-by: Roman Lebedev <lebedev.ri@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 323920
2018-01-31 21:53:42 +00:00
Jan Vesely
0ecb5e511e math.h: Set HAVE_HW_FMA32 based on compiler provided macro
Fixes sin/cos piglits on non-FMA capable asics.
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=35983

Reviewer: Tom Stellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 323677
2018-01-29 19:05:08 +00:00
Jan Vesely
7013857f95 tanpi: Port from amd_builtins
Passes piglit on turks and carrizo.
Passes CTS on carrizo.

Acked-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322980
2018-01-19 18:57:22 +00:00
Jan Vesely
03937bdec3 tan: Port from amd_builtins
v2: fixup constant precision
Passes piglit on turks and carrizo.
Passes CTS on carrizo
Fixes half_tan to pass CTS on carrizo

Acked-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322979
2018-01-19 18:57:19 +00:00
Jan Vesely
44e0522c09 half_divide: Implement using x/y
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322899
2018-01-18 21:12:06 +00:00
Jan Vesely
2813b4f8d9 half_tan: Implement using tan
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322898
2018-01-18 21:12:04 +00:00
Jan Vesely
bf38fae8de half_sin: Implement using sin
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322897
2018-01-18 21:12:01 +00:00
Jan Vesely
398108b91e half_recip: Implement using 1/x
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322896
2018-01-18 21:11:58 +00:00
Jan Vesely
a1aba44ffa half_log2: Implement using log2
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322895
2018-01-18 21:11:56 +00:00
Jan Vesely
b3b72af4b9 half_log10: Implement using log10
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322894
2018-01-18 21:11:53 +00:00
Jan Vesely
6852023802 half_log: Implement using log
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322893
2018-01-18 21:11:50 +00:00
Jan Vesely
aa4c3899b5 half_exp10: Implement using exp10
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322892
2018-01-18 21:11:48 +00:00
Jan Vesely
3c0e19b61a half_exp2: Implement using exp2
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322891
2018-01-18 21:11:45 +00:00
Jan Vesely
caa9000b1c half_exp: Implement using exp
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322890
2018-01-18 21:11:43 +00:00
Jan Vesely
b5d556061d half_cos: Implement using cos
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322889
2018-01-18 21:11:40 +00:00
Jan Vesely
e53ae3b596 half_sqrt: Cleanup implementation
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322888
2018-01-18 21:11:38 +00:00
Jan Vesely
a95db14461 half_rsqrt: Cleanup implementation
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322887
2018-01-18 21:11:35 +00:00
Jan Vesely
fe8e00bc3c rootn: Port from amd_builtins
Passes piglit on turks and carrizo
fp64 passes ctx on carrizo

v2: fix formatting
    check fp32 denormal support at runtime

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322763
2018-01-17 21:22:14 +00:00
Jan Vesely
c45ec604f5 powr: Port from amd_builtins
Passes piglit on turks and carrizo
fp64 passes cts on carrizo

v2: fix formatting
    check fp32 denormal support at runtime

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322762
2018-01-17 21:22:06 +00:00
Jan Vesely
5efc8fe321 pown: Port from amd_builtins
Passes piglit on turks and carrizo
fp64 passes CTS on carrizo

v2: fix formatting
    check fp32 denormal support at runtime

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322761
2018-01-17 21:22:03 +00:00
Jan Vesely
cc5c65b2c2 pow: Port from amd_builtins
Passes piglit on turks and carrizo
fp64 passes CTS on carrizo

v2: fix formatting
    check fp32 denormal support at runtime

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322760
2018-01-17 21:21:35 +00:00
Jan Vesely
fe7c045753 math: Implement minmag
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318265
2017-11-15 04:10:39 +00:00
Jan Vesely
7ba243cc3d math: Implement maxmag
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318264
2017-11-15 04:10:37 +00:00
Jan Vesely
383fbd050c native_powr: Switch implementation to native_exp2 and native_log2
v2: don't use assume
    check only for x<0, the other conditions are handled transparently
v3: don't check inputs at all, nan propagation works as expected

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318204
2017-11-14 21:55:41 +00:00
Jan Vesely
f38b40daf7 native_divide: provide function implementation instead of macro
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318067
2017-11-13 18:28:56 +00:00
Jan Vesely
1b9825f982 native_recip: provide function implementation instead of macro
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318066
2017-11-13 18:28:53 +00:00
Jan Vesely
a6758c94ef native_rsqrt: Switch implementation to 1 / native_sqrt
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318065
2017-11-13 18:28:51 +00:00
Jan Vesely
541a3f0758 native_tan: Switch implementation to use native_sin/native_cos
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318064
2017-11-13 18:28:48 +00:00
Jan Vesely
79b7566210 math: Use precomputed constant for log2(10.0)
exp10 CTS fails with or without this change

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318063
2017-11-13 18:28:45 +00:00
Jan Vesely
6b4a625438 native_exp10: Switch implementation to llvm intrinsic
v2: Use native_log2 instead of wrong constant

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317941
2017-11-10 22:16:41 +00:00
Jan Vesely
4301e6d0c9 native_sqrt: Switch implementation to llvm intrinsic
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317940
2017-11-10 22:16:39 +00:00
Jan Vesely
1f34c851e0 native_sin: Switch implementation to llvm intrinsic
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317939
2017-11-10 22:16:36 +00:00
Jan Vesely
0750b7df51 native_cos: Switch implementation to llvm intrinsic
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317938
2017-11-10 22:16:33 +00:00
Jan Vesely
edbde58de0 native_exp2: Switch implementation to llvm intrinsic
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317937
2017-11-10 22:16:31 +00:00
Jan Vesely
504f85c551 native_exp: Switch implementation to llvm intrinsic
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317936
2017-11-10 22:16:28 +00:00
Jan Vesely
adc1eaedf8 native_log10: Switch to generic native intrinsic inc file
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317934
2017-11-10 22:16:22 +00:00
Jan Vesely
086e796053 native_log: Switch to generic native intrinsic inc file
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317933
2017-11-10 22:16:20 +00:00
Jan Vesely
f58dee9f3a native_log2: Switch to generic native intrinsic inc file
v2: Add __CLC_XCONCAT instead of function name redirection
    Use __CLC_XCONCAT for intrinsic functions as well

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317932
2017-11-10 22:16:15 +00:00
Jan Vesely
39ef293533 tgamma: Use unary_decl instead of custom inc file
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 317260
2017-11-02 19:49:00 +00:00
Jan Vesely
91d7b92d8a tanh: Use unary_decl instead of custom inc file
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 317259
2017-11-02 19:48:58 +00:00
Jan Vesely
e4d5d10076 tan: Use unary_decl instead of custom inc file
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 317258
2017-11-02 19:48:57 +00:00