Index: include/clang/Basic/BuiltinsAMDGPU.def =================================================================== --- include/clang/Basic/BuiltinsAMDGPU.def +++ include/clang/Basic/BuiltinsAMDGPU.def @@ -33,6 +33,10 @@ 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: test/CodeGenOpenCL/builtins-amdgcn.cl =================================================================== --- test/CodeGenOpenCL/builtins-amdgcn.cl +++ test/CodeGenOpenCL/builtins-amdgcn.cl @@ -148,6 +148,30 @@ __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