1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
| ; RUN: llc -o - %s -no-integrated-as | FileCheck %s
target triple = "x86_64--"
; Allow to specify any of the 8/16/32/64 register names interchangeably in
; constraints
; Produced by C-programs like this:
; void foo(int p) { register int reg __asm__("r8") = p;
; __asm__ __volatile__("# REG: %0" : : "r" (reg)); }
; CHECK-LABEL: reg64_as_32:
; CHECK: # REG: %r8d
define void @reg64_as_32(i32 %p) {
call void asm sideeffect "# REG: $0", "{r8}"(i32 %p)
ret void
}
; CHECK-LABEL: reg64_as_32_float:
; CHECK: # REG: %r8d
define void @reg64_as_32_float(float %p) {
call void asm sideeffect "# REG: $0", "{r8}"(float %p)
ret void
}
; CHECK-LABEL: reg64_as_16:
; CHECK: # REG: %r9w
define void @reg64_as_16(i16 %p) {
call void asm sideeffect "# REG: $0", "{r9}"(i16 %p)
ret void
}
; CHECK-LABEL: reg64_as_8:
; CHECK: # REG: %bpl
define void @reg64_as_8(i8 %p) {
call void asm sideeffect "# REG: $0", "{rbp}"(i8 %p)
ret void
}
; CHECK-LABEL: reg32_as_16:
; CHECK: # REG: %r15w
define void @reg32_as_16(i16 %p) {
call void asm sideeffect "# REG: $0", "{r15d}"(i16 %p)
ret void
}
; CHECK-LABEL: reg32_as_8:
; CHECK: # REG: %r12b
define void @reg32_as_8(i8 %p) {
call void asm sideeffect "# REG: $0", "{r12d}"(i8 %p)
ret void
}
; CHECK-LABEL: reg16_as_8:
; CHECK: # REG: %cl
define void @reg16_as_8(i8 %p) {
call void asm sideeffect "# REG: $0", "{cx}"(i8 %p)
ret void
}
; CHECK-LABEL: reg32_as_64:
; CHECK: # REG: %rbp
define void @reg32_as_64(i64 %p) {
call void asm sideeffect "# REG: $0", "{ebp}"(i64 %p)
ret void
}
; CHECK-LABEL: reg32_as_64_float:
; CHECK: # REG: %rbp
define void @reg32_as_64_float(double %p) {
call void asm sideeffect "# REG: $0", "{ebp}"(double %p)
ret void
}
; CHECK-LABEL: reg16_as_64:
; CHECK: # REG: %r13
define void @reg16_as_64(i64 %p) {
call void asm sideeffect "# REG: $0", "{r13w}"(i64 %p)
ret void
}
; CHECK-LABEL: reg16_as_64_float:
; CHECK: # REG: %r13
define void @reg16_as_64_float(double %p) {
call void asm sideeffect "# REG: $0", "{r13w}"(double %p)
ret void
}
; CHECK-LABEL: reg8_as_64:
; CHECK: # REG: %rax
define void @reg8_as_64(i64 %p) {
call void asm sideeffect "# REG: $0", "{al}"(i64 %p)
ret void
}
; CHECK-LABEL: reg8_as_64_float:
; CHECK: # REG: %rax
define void @reg8_as_64_float(double %p) {
call void asm sideeffect "# REG: $0", "{al}"(double %p)
ret void
}
; CHECK-LABEL: reg16_as_32:
; CHECK: # REG: %r11d
define void @reg16_as_32(i32 %p) {
call void asm sideeffect "# REG: $0", "{r11w}"(i32 %p)
ret void
}
; CHECK-LABEL: reg16_as_32_float:
; CHECK: # REG: %r11d
define void @reg16_as_32_float(float %p) {
call void asm sideeffect "# REG: $0", "{r11w}"(float %p)
ret void
}
; CHECK-LABEL: reg8_as_32:
; CHECK: # REG: %r9d
define void @reg8_as_32(i32 %p) {
call void asm sideeffect "# REG: $0", "{r9b}"(i32 %p)
ret void
}
; CHECK-LABEL: reg8_as_32_float:
; CHECK: # REG: %r9d
define void @reg8_as_32_float(float %p) {
call void asm sideeffect "# REG: $0", "{r9b}"(float %p)
ret void
}
; CHECK-LABEL: reg8_as_16:
; CHECK: # REG: %di
define void @reg8_as_16(i16 %p) {
call void asm sideeffect "# REG: $0", "{dil}"(i16 %p)
ret void
}
|