1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=r600 -mcpu=cayman < %s | FileCheck %s
4 define amdgpu_kernel void @addrspacecast_flat_to_global(ptr addrspace(1) %out, ptr %src.ptr) {
5 ; CHECK-LABEL: addrspacecast_flat_to_global:
7 ; CHECK-NEXT: ALU 2, @4, KC0[CB0:0-32], KC1[]
8 ; CHECK-NEXT: MEM_RAT_CACHELESS STORE_DWORD T1.X, T0.X
11 ; CHECK-NEXT: ALU clause starting at 4:
12 ; CHECK-NEXT: LSHR * T0.X, KC0[2].Y, literal.x,
13 ; CHECK-NEXT: 2(2.802597e-45), 0(0.000000e+00)
14 ; CHECK-NEXT: MOV * T1.X, KC0[2].Z,
15 %cast = addrspacecast ptr %src.ptr to ptr addrspace(1)
16 store ptr addrspace(1) %cast, ptr addrspace(1) %out
20 define amdgpu_kernel void @addrspacecast_global_to_flat(ptr addrspace(1) %out, ptr addrspace(1) %src.ptr) {
21 ; CHECK-LABEL: addrspacecast_global_to_flat:
23 ; CHECK-NEXT: ALU 2, @4, KC0[CB0:0-32], KC1[]
24 ; CHECK-NEXT: MEM_RAT_CACHELESS STORE_DWORD T1.X, T0.X
27 ; CHECK-NEXT: ALU clause starting at 4:
28 ; CHECK-NEXT: LSHR * T0.X, KC0[2].Y, literal.x,
29 ; CHECK-NEXT: 2(2.802597e-45), 0(0.000000e+00)
30 ; CHECK-NEXT: MOV * T1.X, KC0[2].Z,
31 %cast = addrspacecast ptr addrspace(1) %src.ptr to ptr
32 store ptr %cast, ptr addrspace(1) %out
36 define amdgpu_kernel void @addrspacecast_flat_null_to_local(ptr addrspace(1) %out) {
37 ; CHECK-LABEL: addrspacecast_flat_null_to_local:
39 ; CHECK-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
40 ; CHECK-NEXT: MEM_RAT_CACHELESS STORE_DWORD T0.X, T1.X
43 ; CHECK-NEXT: ALU clause starting at 4:
44 ; CHECK-NEXT: MOV * T0.X, literal.x,
45 ; CHECK-NEXT: -1(nan), 0(0.000000e+00)
46 ; CHECK-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
47 ; CHECK-NEXT: 2(2.802597e-45), 0(0.000000e+00)
48 store ptr addrspace(3) addrspacecast (ptr null to ptr addrspace(3)), ptr addrspace(1) %out
52 define amdgpu_kernel void @addrspacecast_flat_null_to_global(ptr addrspace(1) %out) {
53 ; CHECK-LABEL: addrspacecast_flat_null_to_global:
55 ; CHECK-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
56 ; CHECK-NEXT: MEM_RAT_CACHELESS STORE_DWORD T0.X, T1.X
59 ; CHECK-NEXT: ALU clause starting at 4:
60 ; CHECK-NEXT: MOV * T0.X, literal.x,
61 ; CHECK-NEXT: 0(0.000000e+00), 0(0.000000e+00)
62 ; CHECK-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
63 ; CHECK-NEXT: 2(2.802597e-45), 0(0.000000e+00)
64 store ptr addrspace(1) addrspacecast (ptr null to ptr addrspace(1)), ptr addrspace(1) %out
68 define amdgpu_kernel void @addrspacecast_flat_undef_to_local(ptr addrspace(1) %out) {
69 ; CHECK-LABEL: addrspacecast_flat_undef_to_local:
73 store ptr addrspace(3) addrspacecast (ptr undef to ptr addrspace(3)), ptr addrspace(1) %out
77 define amdgpu_kernel void @addrspacecast_flat_poison_to_local(ptr addrspace(1) %out) {
78 ; CHECK-LABEL: addrspacecast_flat_poison_to_local:
82 store ptr addrspace(3) addrspacecast (ptr poison to ptr addrspace(3)), ptr addrspace(1) %out