blob: d85e16f5248aa0086a833a103c5147f0846d03e1 [file] [log] [blame]
Tom Stellard919bb6b2014-04-29 23:12:53 +00001; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s
Matt Arsenault470acd82014-04-15 22:28:39 +00002
3
Tom Stellard79243d92014-10-01 17:15:17 +00004; SI-LABEL: {{^}}global_copy_i1_to_i1:
Tom Stellard326d6ec2014-11-05 14:50:53 +00005; SI: buffer_load_ubyte
6; SI: v_and_b32_e32 v{{[0-9]+}}, 1
7; SI: buffer_store_byte
8; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +00009define void @global_copy_i1_to_i1(i1 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
10 %load = load i1 addrspace(1)* %in
11 store i1 %load, i1 addrspace(1)* %out, align 1
12 ret void
13}
14
Tom Stellard79243d92014-10-01 17:15:17 +000015; SI-LABEL: {{^}}global_sextload_i1_to_i32:
Matt Arsenault470acd82014-04-15 22:28:39 +000016; XSI: BUFFER_LOAD_BYTE
Tom Stellard326d6ec2014-11-05 14:50:53 +000017; SI: buffer_store_dword
18; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +000019define void @global_sextload_i1_to_i32(i32 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
20 %load = load i1 addrspace(1)* %in
21 %ext = sext i1 %load to i32
22 store i32 %ext, i32 addrspace(1)* %out, align 4
23 ret void
24}
25
Tom Stellard79243d92014-10-01 17:15:17 +000026; SI-LABEL: {{^}}global_zextload_i1_to_i32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000027; SI: buffer_load_ubyte
28; SI: buffer_store_dword
29; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +000030define void @global_zextload_i1_to_i32(i32 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
31 %load = load i1 addrspace(1)* %in
32 %ext = zext i1 %load to i32
33 store i32 %ext, i32 addrspace(1)* %out, align 4
34 ret void
35}
36
Tom Stellard79243d92014-10-01 17:15:17 +000037; SI-LABEL: {{^}}global_sextload_i1_to_i64:
Matt Arsenault470acd82014-04-15 22:28:39 +000038; XSI: BUFFER_LOAD_BYTE
Tom Stellard326d6ec2014-11-05 14:50:53 +000039; SI: buffer_store_dwordx2
40; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +000041define void @global_sextload_i1_to_i64(i64 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
42 %load = load i1 addrspace(1)* %in
43 %ext = sext i1 %load to i64
44 store i64 %ext, i64 addrspace(1)* %out, align 4
45 ret void
46}
47
Tom Stellard79243d92014-10-01 17:15:17 +000048; SI-LABEL: {{^}}global_zextload_i1_to_i64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000049; SI: buffer_load_ubyte
50; SI: buffer_store_dwordx2
51; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +000052define void @global_zextload_i1_to_i64(i64 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
53 %load = load i1 addrspace(1)* %in
54 %ext = zext i1 %load to i64
55 store i64 %ext, i64 addrspace(1)* %out, align 4
56 ret void
57}
58
Tom Stellard79243d92014-10-01 17:15:17 +000059; SI-LABEL: {{^}}i1_arg:
Tom Stellard326d6ec2014-11-05 14:50:53 +000060; SI: buffer_load_ubyte
61; SI: v_and_b32_e32
62; SI: buffer_store_byte
63; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +000064define void @i1_arg(i1 addrspace(1)* %out, i1 %x) nounwind {
65 store i1 %x, i1 addrspace(1)* %out, align 1
66 ret void
67}
68
Tom Stellard79243d92014-10-01 17:15:17 +000069; SI-LABEL: {{^}}i1_arg_zext_i32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000070; SI: buffer_load_ubyte
71; SI: buffer_store_dword
72; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +000073define void @i1_arg_zext_i32(i32 addrspace(1)* %out, i1 %x) nounwind {
74 %ext = zext i1 %x to i32
75 store i32 %ext, i32 addrspace(1)* %out, align 4
76 ret void
77}
78
Tom Stellard79243d92014-10-01 17:15:17 +000079; SI-LABEL: {{^}}i1_arg_zext_i64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000080; SI: buffer_load_ubyte
81; SI: buffer_store_dwordx2
82; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +000083define void @i1_arg_zext_i64(i64 addrspace(1)* %out, i1 %x) nounwind {
84 %ext = zext i1 %x to i64
85 store i64 %ext, i64 addrspace(1)* %out, align 8
86 ret void
87}
88
Tom Stellard79243d92014-10-01 17:15:17 +000089; SI-LABEL: {{^}}i1_arg_sext_i32:
Matt Arsenault470acd82014-04-15 22:28:39 +000090; XSI: BUFFER_LOAD_BYTE
Tom Stellard326d6ec2014-11-05 14:50:53 +000091; SI: buffer_store_dword
92; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +000093define void @i1_arg_sext_i32(i32 addrspace(1)* %out, i1 %x) nounwind {
94 %ext = sext i1 %x to i32
95 store i32 %ext, i32addrspace(1)* %out, align 4
96 ret void
97}
98
Tom Stellard79243d92014-10-01 17:15:17 +000099; SI-LABEL: {{^}}i1_arg_sext_i64:
Matt Arsenault470acd82014-04-15 22:28:39 +0000100; XSI: BUFFER_LOAD_BYTE
Tom Stellard326d6ec2014-11-05 14:50:53 +0000101; SI: buffer_store_dwordx2
102; SI: s_endpgm
Matt Arsenault470acd82014-04-15 22:28:39 +0000103define void @i1_arg_sext_i64(i64 addrspace(1)* %out, i1 %x) nounwind {
104 %ext = sext i1 %x to i64
105 store i64 %ext, i64 addrspace(1)* %out, align 8
106 ret void
107}