Commit Graph

534 Commits

Author SHA1 Message Date
Jan Vesely faa1ff16c1 amdgcn: Use __constant AS for amdgcn builtins.
Fixes build after clang r338707.
Reviewer: Matthew.Arsenault@amd.com
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

llvm-svn: 338898
2018-08-03 15:14:08 +00:00
Jan Vesely 8382e5bc48 atom: Use volatile pointers for cl_khr_{global,local}_int32_{base,extended}_atomics
int64 versions were switched to volatile pointers in cl1.1
cl1.1 also renamed atom_ functions to atomic_ that use volatile pointers.
CTS and applications use volatile pointers.

Passes CTS on carrizo
no return piglit tests still pass on turks.

Reviewed-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335280
2018-06-21 19:27:39 +00:00
Jan Vesely 65e3541b78 atom: Consolidate cl_khr_{local,global}_int32_{base,extended}_atomics implementation
These are just atomic_* wrappers.
Switch inc, dec to use atomic_* wrappers as well.

Reviewed-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335279
2018-06-21 19:27:33 +00:00
Jan Vesely f965b46c8e atomic: Provide function implementation of atomic_{dec,inc}
Reviewed-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335278
2018-06-21 19:27:26 +00:00
Jan Vesely b9cbe0bf51 atom: Consolidate cl_khr_int64_{base,extended}_atomics declarations
Reviewed-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335277
2018-06-21 19:27:23 +00:00
Jan Vesely d1c3811ff7 atom: Consolidate cl_khr_{local,global}_int32_{base,extended}_atomics declarations
Reviewed-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335276
2018-06-21 19:27:18 +00:00
Jan Vesely fe08de0c89 atomic: Cleanup atomic_cmpxchg header
It's easier to just list the four function declarations

Reviewed-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335275
2018-06-21 19:27:12 +00:00
Jan Vesely eabc110372 atomic: Move define cleanup to shared include
Reviewed-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335274
2018-06-21 19:27:07 +00:00
Paul Robinson 7555c589af Update copyright year to 2018.
llvm-svn: 334936
2018-06-18 12:22:17 +00:00
Jan Vesely e0edcaa4a9 r600/fmin: Flush denormals before calling builtin.
Same reason as amdgcn.
Fixes fmin, minmag CTS on turks.
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

llvm-svn: 334228
2018-06-07 20:27:58 +00:00
Jan Vesely e23c0ec086 r600/fmax: Flush denormals before calling builtin.
Same reason as amdgcn.
Fixes fmax, maxmag CTS on turks.
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

llvm-svn: 334227
2018-06-07 20:27:56 +00:00
Jan Vesely 6e85e6309d math/fma: Add fp32 software implementation
Passes CTS on carrizo (when forced to use sw fma) and turks.
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

llvm-svn: 334226
2018-06-07 20:27:43 +00:00
Jan Vesely 70a270da5f Add initial support for half precision builtins
v2: fix fmax implementation
    use consistent checks for __CLC_FP_SIZE
    add missing TODOs
    fix whitespace in definitions.h
v3: undef ZERO in modf.inc

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Reviewed-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 332677
2018-05-17 22:55:30 +00:00
Jan Vesely 58fdb3b09a rootn: 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
Use 0.0f explicitly intead of relying on GPU to flush it.
Fixes CTS on carrizo and turks

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 332324
2018-05-15 04:22:43 +00:00
Jan Vesely 21e77037c0 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
2018-05-03 05:44:28 +00:00
Jan Vesely 8db45e4cf1 remquo: Port from amd builtins
double version passes on carrizo. float version fails on denormals.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 331434
2018-05-03 05:44:26 +00:00
Jan Vesely 6146eda75d math: Add helper function to flush denormals if not supported.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 331433
2018-05-03 05:44:22 +00:00
Jan Vesely 616a38a693 clc_sqrt: Reuse unary_decl.inc
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 331366
2018-05-02 16:06:52 +00:00
Jan Vesely 1647e50359 relational/select: Condition types for half are short/ushort, not char/uchar
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 330851
2018-04-25 17:36:36 +00:00
Jan Vesely e7d567ee0d log10: Use sw implementation from amd builtins
Add missing table.
Fixes log10d CTS on carrizo.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>

llvm-svn: 330649
2018-04-23 21:10:42 +00:00
Jan Vesely 96591b6202 powr: 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: 330207
2018-04-17 19:35:32 +00:00
Jan Vesely 4388d2883c 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
2018-04-17 19:35:30 +00:00
Jan Vesely 0d92f3047f pow: 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: 330205
2018-04-17 19:35:28 +00:00
Jan Vesely 8fa100dfe3 amdgcn/fmin: Fix typos that reduced precision
Not sure how these sneaked in.
Fixes fminD and few other tests(fractD, cosD) on carrizo
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>

llvm-svn: 330198
2018-04-17 18:11:29 +00:00
Jan Vesely 15c388cd79 exp10: Port from amd builtins
Passes CTS on carrizo and turks.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed and Tested (on RX 580) by: Aaron Watry <awatry@gmail.com>

llvm-svn: 330197
2018-04-17 18:08:08 +00:00
Jan Vesely 4be0339023 hypot: Port from amd builtins
v2: Fix whitespace errors

Use only subnormal path.
Passes CTS on carrizo and turks.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>

llvm-svn: 329647
2018-04-10 00:11:58 +00:00
Jan Vesely 4c1112612c select: simplify implementation and fix fp16
Fix half precision implementation
Vector ?: operator should behave exactly as select
Passes CTS on carrizo

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
llvm-svn: 329462
2018-04-06 22:00:00 +00:00
Jan Vesely 93af966747 fmod: Port from amd_builtins
Uses only denormal path for fp32.
Passes CTS on carrizo and turks.

v2: whitespace fix

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 329433
2018-04-06 17:43:08 +00:00
Jan Vesely 92357a2336 r600: Update datalayout after LLVM r328656
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 329291
2018-04-05 14:47:57 +00:00
Jan Vesely fd11db19c2 amdgcn: Update datalayout after LLVM r328656
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 329290
2018-04-05 14:47:44 +00:00
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