Jan Vesely
5b10494fa8
remainder: Port from amd builtins
...
Mostly ported from amd_builtins, uses only denormal path for fp32.
Passes CTS on carrizo and turks
Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327818
2018-03-19 01:01:10 +00:00
Jan Vesely
b672f7a251
nan: Implement
...
Passes CTS on carrizo and turks
Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327324
2018-03-12 19:46:52 +00:00
Jan Vesely
08c96acb27
travis: Add build using llvm-6
...
Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327323
2018-03-12 19:46:48 +00:00
Jan Vesely
f96b1b88f8
amdgcn/fmax: fcanonicalize operands
...
v_max instruction needs canonicalized operands.
Passes CTS on carrizo
Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327076
2018-03-08 23:01:01 +00:00
Jan Vesely
e724e346ab
amdgcn/fmin: fcanonicalize operands
...
v_min instruction needs canonicalized operands.
Passes CTS on carrizo
Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327075
2018-03-08 23:00:58 +00:00
Jan Vesely
04a46bf0a2
amdgcn,popcount: Workaround broken llvm.ctpop intrinsic on some GCN ASICs
...
This is only really needed for VI+ ASICs. However, llvm would cast the value to
i32 for older asics anyway. The proper fix is in LLVM-7 (r326535).
Fixes CTS popcount on carrizo.
Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327044
2018-03-08 18:58:07 +00:00
Jan Vesely
0883c4d365
integer/gentype: Add __CLC_VECSIZE macro
...
Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327043
2018-03-08 18:58:05 +00:00
Jan Vesely
17e8679493
popcount: Provide function implementation rather than intrinsic redirect
...
amdgcn will need to override this
Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327042
2018-03-08 18:58:00 +00:00
Jan Vesely
c15a48dd9c
lgamma_r: Move code from .inc to .cl file
...
Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326821
2018-03-06 17:48:47 +00:00
Jan Vesely
2dcb382efc
frexp: Reuse types provided by gentype.inc
...
v2: Use select instead of bitselect to consolidate scalar and vector
versions
Passes CTS on Carrizo
Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326820
2018-03-06 17:48:45 +00:00
Jan Vesely
ae156b66f8
select: Add vector implementation
...
Passes CTS on Carrizo
Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326819
2018-03-06 17:48:43 +00:00
Jan Vesely
44f21978a2
minmag: Condition variable needs to be the same bitwidth as operands
...
No changes wrt CTS
Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326818
2018-03-06 17:48:40 +00:00
Jan Vesely
4e72300929
maxmag: Condition variable needs to be the same bitwidth as operands
...
No changes wrt CTS
Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326817
2018-03-06 17:48:38 +00:00
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
86db4302e0
utils: Adapt to llvm r325155
...
r325155 ("Pass a reference to a module to the bitcode writer.")
changed bit writer interface from pointer to reference
Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325867
2018-02-23 07:37:03 +00:00
Jan Vesely
1ad6a94676
amdgcn: Fix build after GDS/const AS swap in r325030
...
Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325866
2018-02-23 07:37:01 +00:00
Jan Vesely
eda1872d04
amdgcn: Fix datalayout after addition of 32bit const AS in r324747
...
Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325865
2018-02-23 07:36:54 +00:00
Jan Vesely
83cd840010
r600: Fix datalayout after clang r324101
...
r324101 switched around AS numbering
Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325864
2018-02-23 07:36:51 +00:00
Jan Vesely
911666f3fa
amdgcn: Fix datalayout after clang r324101
...
r324101 switched around AS numbering
Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325863
2018-02-23 07:36:39 +00:00
Jan Vesely
b424954682
amdgpu/half_recip: Switch implementation to native_recip
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325061
2018-02-13 22:09:46 +00:00
Jan Vesely
ed28c4458a
amdgpu/half_log2: Switch implementation to native_log2
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325060
2018-02-13 22:09:44 +00:00
Jan Vesely
86cbf56a4b
amdgpu/half_log10: Switch implementation to native_log10
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325059
2018-02-13 22:09:42 +00:00
Jan Vesely
65fd65efbf
amdgpu/half_log: Switch implementation to native_log
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325058
2018-02-13 22:09:41 +00:00
Jan Vesely
2d3b6dfdca
amdgpu/half_exp2: Switch implementation to native_exp2
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325057
2018-02-13 22:09:38 +00:00
Jan Vesely
021264c75a
amdgpu/half_exp10: Switch implementation to native_exp10
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325056
2018-02-13 22:09:37 +00:00
Jan Vesely
4879dd7471
amdgpu/half_exp: Switch implementation to native_exp
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325055
2018-02-13 22:09:35 +00:00
Jan Vesely
bca92445ba
amdgpu/half_sqrt: Switch implementation to native_sqrt
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325054
2018-02-13 22:09:33 +00:00
Jan Vesely
aad28681c2
amdgpu/half_rsqrt: Switch implementation to native_rsqrt
...
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325053
2018-02-13 22:09:31 +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