OLD | NEW |
---|---|
(Empty) | |
1 ; Show that we know how to translate vcmp. | |
2 | |
3 ; REQUIRES: allow_dump | |
4 | |
5 ; Compile using standalone assembler. | |
6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \ | |
Jim Stichnoth
2016/01/09 01:34:28
Can you use -O2 like in many/most other tests, to
Karl
2016/01/11 16:42:20
If you use -O2, you will get different register as
| |
7 ; RUN: | FileCheck %s --check-prefix=ASM | |
8 | |
9 ; Show bytes in assembled standalone code. | |
10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ | |
11 ; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS | |
12 | |
13 ; Compile using integrated assembler. | |
14 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \ | |
15 ; RUN: | FileCheck %s --check-prefix=IASM | |
16 | |
17 ; Show bytes in assembled integrated code. | |
18 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ | |
19 ; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS | |
20 | |
21 define internal i32 @vcmpFloat(float %v1, float %v2) { | |
22 ; ASM-LABEL: vcmpFloat: | |
23 ; DIS-LABEL: 00000000 <vcmpFloat>: | |
24 ; IASM-LABEL: vcmpFloat: | |
25 | |
26 entry: | |
27 ; ASM-NEXT: .LvcmpFloat$entry: | |
28 ; IASM-NEXT: .LvcmpFloat$entry: | |
29 | |
30 ; ASM-NEXT: sub sp, sp, #16 | |
31 ; DIS-NEXT: 0: e24dd010 | |
32 ; IASM-NEXT: .byte 0x10 | |
33 ; IASM-NEXT: .byte 0xd0 | |
34 ; IASM-NEXT: .byte 0x4d | |
35 ; IASM-NEXT: .byte 0xe2 | |
36 | |
37 ; ASM-NEXT: vstr s0, [sp, #12] | |
38 ; ASM-NEXT: # [sp, #12] = def.pseudo | |
39 ; DIS-NEXT: 4: ed8d0a03 | |
40 ; IASM-NEXT: vstr s0, [sp, #12] | |
41 | |
42 ; ASM-NEXT: vstr s1, [sp, #8] | |
43 ; ASM-NEXT: # [sp, #8] = def.pseudo | |
44 ; DIS-NEXT: 8: edcd0a02 | |
45 ; IASM-NEXT: vstr s1, [sp, #8] | |
46 | |
47 %cmp = fcmp olt float %v1, %v2 | |
48 | |
49 ; ASM-NEXT: vldr s0, [sp, #12] | |
50 ; DIS-NEXT: c: ed9d0a03 | |
51 ; IASM-NEXT: vldr s0, [sp, #12] | |
52 | |
53 ; ASM-NEXT: vldr s1, [sp, #8] | |
54 ; DIS-NEXT: 10: eddd0a02 | |
55 ; IASM-NEXT: vldr s1, [sp, #8] | |
56 | |
57 ; ASM-NEXT: vcmp.f32 s0, s1 | |
58 ; DIS-NEXT: 14: eeb40a60 | |
59 ; IASM-NEXT: .byte 0x60 | |
60 ; IASM-NEXT: .byte 0xa | |
61 ; IASM-NEXT: .byte 0xb4 | |
62 ; IASM-NEXT: .byte 0xee | |
63 | |
64 %res = zext i1 %cmp to i32 | |
65 ret i32 %res | |
66 } | |
67 | |
68 define internal i32 @vcmpFloatToZero(float %v) { | |
69 ; ASM-LABEL: vcmpFloatToZero: | |
70 ; DIS-LABEL: 00000040 <vcmpFloatToZero>: | |
71 ; IASM-LABEL: vcmpFloatToZero: | |
72 | |
73 entry: | |
74 ; ASM-NEXT: .LvcmpFloatToZero$entry: | |
75 ; IASM-NEXT: .LvcmpFloatToZero$entry: | |
76 | |
77 ; ASM-NEXT: sub sp, sp, #12 | |
78 ; DIS-NEXT: 40: e24dd00c | |
79 ; IASM-NEXT: .byte 0xc | |
80 ; IASM-NEXT: .byte 0xd0 | |
81 ; IASM-NEXT: .byte 0x4d | |
82 ; IASM-NEXT: .byte 0xe2 | |
83 | |
84 ; ASM-NEXT: vstr s0, [sp, #8] | |
85 ; ASM-NEXT: # [sp, #8] = def.pseudo | |
86 ; DIS-NEXT: 44: ed8d0a02 | |
87 ; IASM-NEXT: vstr s0, [sp, #8] | |
88 | |
89 %cmp = fcmp olt float %v, 0.0 | |
90 | |
91 ; ASM-NEXT: vldr s0, [sp, #8] | |
92 ; DIS-NEXT: 48: ed9d0a02 | |
93 ; IASM-NEXT: vldr s0, [sp, #8] | |
94 | |
95 ; ASM-NEXT: vcmp.f32 s0, #0.0 | |
96 ; DIS-NEXT: 4c: eeb50a40 | |
97 ; IASM-NEXT: .byte 0x40 | |
98 ; IASM-NEXT: .byte 0xa | |
99 ; IASM-NEXT: .byte 0xb5 | |
100 ; IASM-NEXT: .byte 0xee | |
101 | |
102 %res = zext i1 %cmp to i32 | |
103 ret i32 %res | |
104 } | |
105 | |
106 define internal i32 @vcmpDouble(double %v1, double %v2) { | |
107 ; ASM-LABEL: vcmpDouble: | |
108 ; DIS-LABEL: 00000080 <vcmpDouble>: | |
109 ; IASM-LABEL: vcmpDouble: | |
110 | |
111 entry: | |
112 ; ASM-NEXT: .LvcmpDouble$entry: | |
113 ; IASM-NEXT: .LvcmpDouble$entry: | |
114 | |
115 ; ASM-NEXT: sub sp, sp, #24 | |
116 ; DIS-NEXT: 80: e24dd018 | |
117 ; IASM-NEXT: .byte 0x18 | |
118 ; IASM-NEXT: .byte 0xd0 | |
119 ; IASM-NEXT: .byte 0x4d | |
120 ; IASM-NEXT: .byte 0xe2 | |
121 | |
122 ; ASM-NEXT: vstr d0, [sp, #16] | |
123 ; ASM-NEXT: # [sp, #16] = def.pseudo | |
124 ; DIS-NEXT: 84: ed8d0b04 | |
125 ; IASM-NEXT: vstr d0, [sp, #16] | |
126 | |
127 ; ASM-NEXT: vstr d1, [sp, #8] | |
128 ; ASM-NEXT: # [sp, #8] = def.pseudo | |
129 ; DIS-NEXT: 88: ed8d1b02 | |
130 ; IASM-NEXT: vstr d1, [sp, #8] | |
131 | |
132 %cmp = fcmp olt double %v1, %v2 | |
133 | |
134 ; ASM-NEXT: vldr d31, [sp, #16] | |
135 ; DIS-NEXT: 8c: edddfb04 | |
136 ; IASM-NEXT: vldr d31, [sp, #16] | |
137 | |
138 ; ASM-NEXT: vldr d30, [sp, #8] | |
139 ; DIS-NEXT: 90: edddeb02 | |
140 ; IASM-NEXT: vldr d30, [sp, #8] | |
141 | |
142 ; ASM-NEXT: vcmp.f64 d31, d30 | |
143 ; DIS-NEXT: 94: eef4fb6e | |
144 ; IASM-NEXT: .byte 0x6e | |
145 ; IASM-NEXT: .byte 0xfb | |
146 ; IASM-NEXT: .byte 0xf4 | |
147 ; IASM-NEXT: .byte 0xee | |
148 | |
149 %res = zext i1 %cmp to i32 | |
150 ret i32 %res | |
151 } | |
152 | |
153 define internal i32 @vcmpDoubleToZero(double %v) { | |
154 ; ASM-LABEL: vcmpDoubleToZero: | |
155 ; DIS-LABEL: 000000c0 <vcmpDoubleToZero>: | |
156 | |
157 entry: | |
158 ; ASM-NEXT: .LvcmpDoubleToZero$entry: | |
159 | |
160 ; ASM-NEXT: sub sp, sp, #16 | |
161 ; DIS-NEXT: c0: e24dd010 | |
162 | |
163 ; ASM-NEXT: vstr d0, [sp, #8] | |
164 ; ASM-NEXT: # [sp, #8] = def.pseudo | |
165 ; DIS-NEXT: c4: ed8d0b02 | |
166 | |
167 %cmp = fcmp olt double %v, 0.0 | |
168 | |
169 ; ASM-NEXT: vldr d31, [sp, #8] | |
170 ; DIS-NEXT: c8: edddfb02 | |
171 | |
172 ; ASM-NEXT: vcmp.f64 d31, #0.0 | |
173 ; DIS-NEXT: cc: eef5fb40 | |
174 | |
175 %res = zext i1 %cmp to i32 | |
176 ret i32 %res | |
177 } | |
OLD | NEW |