1 // REQUIRES
: amdgpu-registered-target
2 // RUN
: %clang_cc1 -triple r600-unknown-unknown -target-cpu cypress -emit-llvm -o - %s | FileCheck %s
4 // CHECK-LABEL
: @test_recipsqrt_ieee_f32
5 // CHECK
: call float
@llvm.r600.recipsqrt.ieee.f32
6 void test_recipsqrt_ieee_f32
(global float
* out
, float a
)
8 *out
= __builtin_r600_recipsqrt_ieeef
(a);
12 // XCHECK-LABEL
: @test_recipsqrt_ieee_f64
13 // XCHECK
: call double
@llvm.r600.recipsqrt.ieee.f64
14 void test_recipsqrt_ieee_f64
(global double
* out
, double a
)
16 *out
= __builtin_r600_recipsqrt_ieee
(a);
20 // CHECK-LABEL
: @test_implicitarg_ptr
21 // CHECK
: call ptr addrspace
(7) @llvm.r600.implicitarg.ptr
()
22 void test_implicitarg_ptr
(__attribute__((address_space(7))) unsigned char
** out
)
24 *out
= __builtin_r600_implicitarg_ptr
();
27 // CHECK-LABEL
: @test_get_group_id
(
28 // CHECK
: tail call i32
@llvm.r600.read.tgid.x
()
29 // CHECK
: tail call i32
@llvm.r600.read.tgid.y
()
30 // CHECK
: tail call i32
@llvm.r600.read.tgid.z
()
31 void test_get_group_id
(int d
, global int
*out
)
34 case
0: *out
= __builtin_r600_read_tgid_x
(); break;
35 case
1: *out
= __builtin_r600_read_tgid_y
(); break;
36 case
2: *out
= __builtin_r600_read_tgid_z
(); break;
41 // CHECK-LABEL
: @test_get_local_id
(
42 // CHECK
: tail call noundef range
(i32 0, 1024) i32
@llvm.r600.read.tidig.x
()
43 // CHECK
: tail call noundef range
(i32 0, 1024) i32
@llvm.r600.read.tidig.y
()
44 // CHECK
: tail call noundef range
(i32 0, 1024) i32
@llvm.r600.read.tidig.z
()
45 void test_get_local_id
(int d
, global int
*out
)
48 case
0: *out
= __builtin_r600_read_tidig_x
(); break;
49 case
1: *out
= __builtin_r600_read_tidig_y
(); break;
50 case
2: *out
= __builtin_r600_read_tidig_z
(); break;