]> granicus.if.org Git - clang/commitdiff
AMDGPU: Add amdgcn cube builtins
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 26 Jan 2016 06:37:54 +0000 (06:37 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 26 Jan 2016 06:37:54 +0000 (06:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258794 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/BuiltinsAMDGPU.def
test/CodeGenOpenCL/builtins-amdgcn.cl

index 17d6547bb967db81d602f6894772f3804375cfdd..c0c7f08ebd35b5fc05b286f5bf3de8d0fe711beb 100644 (file)
@@ -33,6 +33,10 @@ BUILTIN(__builtin_amdgcn_ldexp, "ddi", "nc")
 BUILTIN(__builtin_amdgcn_ldexpf, "ffi", "nc")
 BUILTIN(__builtin_amdgcn_class, "bdi", "nc")
 BUILTIN(__builtin_amdgcn_classf, "bfi", "nc")
+BUILTIN(__builtin_amdgcn_cubeid, "ffff", "nc")
+BUILTIN(__builtin_amdgcn_cubesc, "ffff", "nc")
+BUILTIN(__builtin_amdgcn_cubetc, "ffff", "nc")
+BUILTIN(__builtin_amdgcn_cubema, "ffff", "nc")
 
 // Legacy names with amdgpu prefix
 BUILTIN(__builtin_amdgpu_rsq, "dd", "nc")
index 6f9a8cf921699c2f168a10ab66308cd1f671a1da..641ec8e0fd25130027731f2844b8765785d9b656 100644 (file)
@@ -148,6 +148,30 @@ void test_s_barrier()
   __builtin_amdgcn_s_barrier();
 }
 
+// CHECK-LABEL: @test_cubeid(
+// CHECK: call float @llvm.amdgcn.cubeid(float %a, float %b, float %c)
+void test_cubeid(global float* out, float a, float b, float c) {
+  *out = __builtin_amdgcn_cubeid(a, b, c);
+}
+
+// CHECK-LABEL: @test_cubesc(
+// CHECK: call float @llvm.amdgcn.cubesc(float %a, float %b, float %c)
+void test_cubesc(global float* out, float a, float b, float c) {
+  *out = __builtin_amdgcn_cubesc(a, b, c);
+}
+
+// CHECK-LABEL: @test_cubetc(
+// CHECK: call float @llvm.amdgcn.cubetc(float %a, float %b, float %c)
+void test_cubetc(global float* out, float a, float b, float c) {
+  *out = __builtin_amdgcn_cubetc(a, b, c);
+}
+
+// CHECK-LABEL: @test_cubema(
+// CHECK: call float @llvm.amdgcn.cubema(float %a, float %b, float %c)
+void test_cubema(global float* out, float a, float b, float c) {
+  *out = __builtin_amdgcn_cubema(a, b, c);
+}
+
 // Legacy intrinsics with AMDGPU prefix
 
 // CHECK-LABEL: @test_legacy_rsq_f32