1 ; RUN: llc -o - %s -no-integrated-as | FileCheck %s
2 target triple = "x86_64--"
4 ; Allow to specify any of the 8/16/32/64 register names interchangeably in
7 ; Produced by C-programs like this:
8 ; void foo(int p) { register int reg __asm__("r8") = p;
9 ; __asm__ __volatile__("# REG: %0" : : "r" (reg)); }
11 ; CHECK-LABEL: reg64_as_32:
13 define void @reg64_as_32(i32 %p) {
14 call void asm sideeffect "# REG: $0", "{r8}"(i32 %p)
18 ; CHECK-LABEL: reg64_as_32_float:
20 define void @reg64_as_32_float(float %p) {
21 call void asm sideeffect "# REG: $0", "{r8}"(float %p)
25 ; CHECK-LABEL: reg64_as_16:
27 define void @reg64_as_16(i16 %p) {
28 call void asm sideeffect "# REG: $0", "{r9}"(i16 %p)
32 ; CHECK-LABEL: reg64_as_8:
34 define void @reg64_as_8(i8 %p) {
35 call void asm sideeffect "# REG: $0", "{rbp}"(i8 %p)
39 ; CHECK-LABEL: reg32_as_16:
41 define void @reg32_as_16(i16 %p) {
42 call void asm sideeffect "# REG: $0", "{r15d}"(i16 %p)
46 ; CHECK-LABEL: reg32_as_8:
48 define void @reg32_as_8(i8 %p) {
49 call void asm sideeffect "# REG: $0", "{r12d}"(i8 %p)
53 ; CHECK-LABEL: reg16_as_8:
55 define void @reg16_as_8(i8 %p) {
56 call void asm sideeffect "# REG: $0", "{cx}"(i8 %p)
60 ; CHECK-LABEL: reg32_as_64:
62 define void @reg32_as_64(i64 %p) {
63 call void asm sideeffect "# REG: $0", "{ebp}"(i64 %p)
67 ; CHECK-LABEL: reg32_as_64_float:
69 define void @reg32_as_64_float(double %p) {
70 call void asm sideeffect "# REG: $0", "{ebp}"(double %p)
74 ; CHECK-LABEL: reg16_as_64:
76 define void @reg16_as_64(i64 %p) {
77 call void asm sideeffect "# REG: $0", "{r13w}"(i64 %p)
81 ; CHECK-LABEL: reg16_as_64_float:
83 define void @reg16_as_64_float(double %p) {
84 call void asm sideeffect "# REG: $0", "{r13w}"(double %p)
88 ; CHECK-LABEL: reg8_as_64:
90 define void @reg8_as_64(i64 %p) {
91 call void asm sideeffect "# REG: $0", "{al}"(i64 %p)
95 ; CHECK-LABEL: reg8_as_64_float:
97 define void @reg8_as_64_float(double %p) {
98 call void asm sideeffect "# REG: $0", "{al}"(double %p)
102 ; CHECK-LABEL: reg16_as_32:
103 ; CHECK: # REG: %r11d
104 define void @reg16_as_32(i32 %p) {
105 call void asm sideeffect "# REG: $0", "{r11w}"(i32 %p)
109 ; CHECK-LABEL: reg16_as_32_float:
110 ; CHECK: # REG: %r11d
111 define void @reg16_as_32_float(float %p) {
112 call void asm sideeffect "# REG: $0", "{r11w}"(float %p)
116 ; CHECK-LABEL: reg8_as_32:
118 define void @reg8_as_32(i32 %p) {
119 call void asm sideeffect "# REG: $0", "{r9b}"(i32 %p)
123 ; CHECK-LABEL: reg8_as_32_float:
125 define void @reg8_as_32_float(float %p) {
126 call void asm sideeffect "# REG: $0", "{r9b}"(float %p)
130 ; CHECK-LABEL: reg8_as_16:
132 define void @reg8_as_16(i16 %p) {
133 call void asm sideeffect "# REG: $0", "{dil}"(i16 %p)
137 ; CHECK-LABEL: egpr_reg64_as_32:
138 ; CHECK: # REG: %r16d
139 define void @egpr_reg64_as_32(i32 %p) {
140 call void asm sideeffect "# REG: $0", "{r16}"(i32 %p)
144 ; CHECK-LABEL: egpr_reg64_as_32_float:
145 ; CHECK: # REG: %r16d
146 define void @egpr_reg64_as_32_float(float %p) {
147 call void asm sideeffect "# REG: $0", "{r16}"(float %p)
151 ; CHECK-LABEL: egpr_reg64_as_16:
152 ; CHECK: # REG: %r17w
153 define void @egpr_reg64_as_16(i16 %p) {
154 call void asm sideeffect "# REG: $0", "{r17}"(i16 %p)
158 ; CHECK-LABEL: egpr_reg64_as_8:
159 ; CHECK: # REG: %r21b
160 define void @egpr_reg64_as_8(i8 %p) {
161 call void asm sideeffect "# REG: $0", "{r21}"(i8 %p)
165 ; CHECK-LABEL: egpr_reg32_as_16:
166 ; CHECK: # REG: %r21w
167 define void @egpr_reg32_as_16(i16 %p) {
168 call void asm sideeffect "# REG: $0", "{r21d}"(i16 %p)
172 ; CHECK-LABEL: egpr_reg32_as_8:
173 ; CHECK: # REG: %r20b
174 define void @egpr_reg32_as_8(i8 %p) {
175 call void asm sideeffect "# REG: $0", "{r20d}"(i8 %p)
179 ; CHECK-LABEL: egpr_reg16_as_8:
180 ; CHECK: # REG: %r17b
181 define void @egpr_reg16_as_8(i8 %p) {
182 call void asm sideeffect "# REG: $0", "{r17w}"(i8 %p)
186 ; CHECK-LABEL: egpr_reg32_as_64:
188 define void @egpr_reg32_as_64(i64 %p) {
189 call void asm sideeffect "# REG: $0", "{r21d}"(i64 %p)
193 ; CHECK-LABEL: egpr_reg32_as_64_float:
195 define void @egpr_reg32_as_64_float(double %p) {
196 call void asm sideeffect "# REG: $0", "{r21d}"(double %p)
200 ; CHECK-LABEL: egpr_reg16_as_64:
202 define void @egpr_reg16_as_64(i64 %p) {
203 call void asm sideeffect "# REG: $0", "{r21w}"(i64 %p)
207 ; CHECK-LABEL: egpr_reg16_as_64_float:
209 define void @egpr_reg16_as_64_float(double %p) {
210 call void asm sideeffect "# REG: $0", "{r21w}"(double %p)
214 ; CHECK-LABEL: egpr_reg8_as_64:
216 define void @egpr_reg8_as_64(i64 %p) {
217 call void asm sideeffect "# REG: $0", "{r16b}"(i64 %p)
221 ; CHECK-LABEL: egpr_reg8_as_64_float:
223 define void @egpr_reg8_as_64_float(double %p) {
224 call void asm sideeffect "# REG: $0", "{r16b}"(double %p)
228 ; CHECK-LABEL: egpr_reg16_as_32:
229 ; CHECK: # REG: %r19d
230 define void @egpr_reg16_as_32(i32 %p) {
231 call void asm sideeffect "# REG: $0", "{r19w}"(i32 %p)
235 ; CHECK-LABEL: egpr_reg16_as_32_float:
236 ; CHECK: # REG: %r19d
237 define void @egpr_reg16_as_32_float(float %p) {
238 call void asm sideeffect "# REG: $0", "{r19w}"(float %p)
242 ; CHECK-LABEL: egpr_reg8_as_32:
243 ; CHECK: # REG: %r17d
244 define void @egpr_reg8_as_32(i32 %p) {
245 call void asm sideeffect "# REG: $0", "{r17b}"(i32 %p)
249 ; CHECK-LABEL: egpr_reg8_as_32_float:
250 ; CHECK: # REG: %r17d
251 define void @egpr_reg8_as_32_float(float %p) {
252 call void asm sideeffect "# REG: $0", "{r17b}"(float %p)
256 ; CHECK-LABEL: egpr_reg8_as_16:
257 ; CHECK: # REG: %r18w
258 define void @egpr_reg8_as_16(i16 %p) {
259 call void asm sideeffect "# REG: $0", "{r18b}"(i16 %p)