Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: tests_lit/assembler/mips32/encoding_test_02.ll

Issue 2259983004: [SubZero] Generate ELF output for MIPS (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Address review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 ; Test encoding of MIPS32 branch instructions
2
3 ; REQUIRES: allow_dump
4
5 ; Compile using standalone assembler.
6 ; RUN: %p2i --filetype=asm -i %s --target=mips32 --args -O2 \
7 ; RUN: --allow-externally-defined-symbols --skip-unimplemented \
8 ; RUN: | FileCheck %s --check-prefix=ASM
9
10 ; Show bytes in assembled standalone code.
11 ; RUN: %p2i --filetype=asm -i %s --target=mips32 --assemble --disassemble \
12 ; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \
13 ; RUN: | FileCheck %s --check-prefix=DIS
14
15 ; Compile using integrated assembler.
16 ; RUN: %p2i --filetype=iasm -i %s --target=mips32 --args -O2 \
17 ; RUN: --allow-externally-defined-symbols --skip-unimplemented \
18 ; RUN: | FileCheck %s --check-prefix=IASM
19
20 ; Show bytes in assembled integrated code.
21 ; RUN: %p2i --filetype=iasm -i %s --target=mips32 --assemble --disassemble \
22 ; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \
23 ; RUN: | FileCheck %s --check-prefix=DIS
24
25 define internal void @test_01(i32 %a) {
26 %cmp = icmp eq i32 %a, 1
27 br i1 %cmp, label %then, label %else
28 then:
29 br label %end
30 else:
31 br label %end
32 end:
33 ret void
34 }
35
36 ; ASM-LABEL: test_01:
37 ; ASM-LABEL: .Ltest_01$__0:
38 ; ASM-NEXT: # $zero = def.pseudo
39 ; ASM-NEXT: addiu $v0, $zero, 1
40 ; ASM-NEXT: bne $a0, $v0, .Ltest_01$end
41 ; ASM-LABEL: .Ltest_01$end:
42 ; ASM-NEXT: jr $ra
43 ; ASM-LABEL: .Ltest_01$then:
44 ; ASM-LABEL: .Ltest_01$else:
45
46 ; DIS-LABEL:00000000 <test_01>:
47 ; DIS-NEXT: 0: 24020001 li v0,1
48 ; DIS-NEXT: 4: 14820001 bne a0,v0,c <.Ltest_01$end>
49 ; DIS-NEXT: 8: 00000000 nop
50 ; DIS-LABEL:0000000c <.Ltest_01$end>:
51 ; DIS-NEXT: c: 03e00008 jr ra
52 ; DIS-NEXT: 10: 00000000 nop
53
54 ; IASM-LABEL: test_01:
55 ; IASM-LABEL: .Ltest_01$__0:
56 ; IASM-NEXT: .byte 0x1
57 ; IASM-NEXT: .byte 0x0
58 ; IASM-NEXT: .byte 0x2
59 ; IASM-NEXT: .byte 0x24
60 ; IASM-NEXT: .byte 0x1
61 ; IASM-NEXT: .byte 0x0
62 ; IASM-NEXT: .byte 0x82
63 ; IASM-NEXT: .byte 0x14
64 ; IASM-NEXT: .byte 0x0
65 ; IASM-NEXT: .byte 0x0
66 ; IASM-NEXT: .byte 0x0
67 ; IASM-NEXT: .byte 0x0
68 ; IASM-LABEL: .Ltest_01$end:
69 ; IASM-NEXT: .byte 0x8
70 ; IASM-NEXT: .byte 0x0
71 ; IASM-NEXT: .byte 0xe0
72 ; IASM-NEXT: .byte 0x3
73 ; IASM-NEXT: .byte 0x0
74 ; IASM-NEXT: .byte 0x0
75 ; IASM-NEXT: .byte 0x0
76 ; IASM-NEXT: .byte 0x0
77 ; IASM-LABEL: .Ltest_01$then:
78 ; IASM-LABEL: .Ltest_01$else:
79
80 define internal void @test_02(i32 %a) {
81 %cmp = icmp ne i32 %a, 2
82 br i1 %cmp, label %then, label %else
83 then:
84 br label %end
85 else:
86 br label %end
87 end:
88 ret void
89 }
90
91 ; ASM-LABEL: test_02:
92 ; ASM-LABEL: .Ltest_02$__0:
93 ; ASM-NEXT: # $zero = def.pseudo
94 ; ASM-NEXT: addiu $v0, $zero, 2
95 ; ASM-NEXT: beq $a0, $v0, .Ltest_02$end
96 ; ASM-LABEL: .Ltest_02$end:
97 ; ASM-NEXT: jr $ra
98 ; ASM-LABEL: .Ltest_02$then:
99 ; ASM-LABEL: .Ltest_02$else:
100
101 ; DIS-LABEL:00000020 <test_02>:
102 ; DIS-NEXT: 20: 24020002 li v0,2
103 ; DIS-NEXT: 24: 10820001 beq a0,v0,2c <.Ltest_02$end>
104 ; DIS-NEXT: 28: 00000000 nop
105 ; DIS-LABEL:0000002c <.Ltest_02$end>:
106 ; DIS-NEXT: 2c: 03e00008 jr ra
107 ; DIS-NEXT: 30: 00000000 nop
108
109 ; IASM-LABEL: test_02:
110 ; IASM-LABEL: .Ltest_02$__0:
111 ; IASM-NEXT: .byte 0x2
112 ; IASM-NEXT: .byte 0x0
113 ; IASM-NEXT: .byte 0x2
114 ; IASM-NEXT: .byte 0x24
115 ; IASM-NEXT: .byte 0x1
116 ; IASM-NEXT: .byte 0x0
117 ; IASM-NEXT: .byte 0x82
118 ; IASM-NEXT: .byte 0x10
119 ; IASM-NEXT: .byte 0x0
120 ; IASM-NEXT: .byte 0x0
121 ; IASM-NEXT: .byte 0x0
122 ; IASM-NEXT: .byte 0x0
123 ; IASM-LABEL: .Ltest_02$end:
124 ; IASM-NEXT: .byte 0x8
125 ; IASM-NEXT: .byte 0x0
126 ; IASM-NEXT: .byte 0xe0
127 ; IASM-NEXT: .byte 0x3
128 ; IASM-NEXT: .byte 0x0
129 ; IASM-NEXT: .byte 0x0
130 ; IASM-NEXT: .byte 0x0
131 ; IASM-NEXT: .byte 0x0
132 ; IASM-LABEL: .Ltest_02$then:
133 ; IASM-LABEL: .Ltest_02$else:
134
135 define internal void @test_03(i32 %a) {
136 %cmp = icmp ugt i32 %a, 3
137 br i1 %cmp, label %then, label %else
138 then:
139 br label %end
140 else:
141 br label %end
142 end:
143 ret void
144 }
145
146 ; ASM-LABEL: test_03:
147 ; ASM-LABEL: .Ltest_03$__0:
148 ; ASM-NEXT: # $zero = def.pseudo
149 ; ASM-NEXT: addiu $v0, $zero, 3
150 ; ASM-NEXT: sltu $v0, $v0, $a0
151 ; ASM-NEXT: beqz $v0, .Ltest_03$end
152 ; ASM-LABEL: .Ltest_03$end:
153 ; ASM-NEXT: jr $ra
154 ; ASM-LABEL: .Ltest_03$then:
155 ; ASM-LABEL: .Ltest_03$else:
156
157 ; DIS-LABEL:00000040 <test_03>:
158 ; DIS-NEXT: 40: 24020003 li v0,3
159 ; DIS-NEXT: 44: 0044102b sltu v0,v0,a0
160 ; DIS-NEXT: 48: 10400001 beqz v0,50 <.Ltest_03$end>
161 ; DIS-NEXT: 4c: 00000000 nop
162 ; DIS-LABEL:00000050 <.Ltest_03$end>:
163 ; DIS-NEXT: 50: 03e00008 jr ra
164 ; DIS-NEXT: 54: 00000000 nop
165
166 ; IASM-LABEL: test_03:
167 ; IASM-LABEL: .Ltest_03$__0:
168 ; IASM-NEXT: .byte 0x3
169 ; IASM-NEXT: .byte 0x0
170 ; IASM-NEXT: .byte 0x2
171 ; IASM-NEXT: .byte 0x24
172 ; IASM-NEXT: .byte 0x2b
173 ; IASM-NEXT: .byte 0x10
174 ; IASM-NEXT: .byte 0x44
175 ; IASM-NEXT: .byte 0x0
176 ; IASM-NEXT: .byte 0x1
177 ; IASM-NEXT: .byte 0x0
178 ; IASM-NEXT: .byte 0x40
179 ; IASM-NEXT: .byte 0x10
180 ; IASM-NEXT: .byte 0x0
181 ; IASM-NEXT: .byte 0x0
182 ; IASM-NEXT: .byte 0x0
183 ; IASM-NEXT: .byte 0x0
184 ; IASM-LABEL: .Ltest_03$end:
185 ; IASM-NEXT: .byte 0x8
186 ; IASM-NEXT: .byte 0x0
187 ; IASM-NEXT: .byte 0xe0
188 ; IASM-NEXT: .byte 0x3
189 ; IASM-NEXT: .byte 0x0
190 ; IASM-NEXT: .byte 0x0
191 ; IASM-NEXT: .byte 0x0
192 ; IASM-NEXT: .byte 0x0
193 ; IASM-LABEL: .Ltest_03$then:
194 ; IASM-LABEL: .Ltest_03$else:
195
196 define internal void @test_04(i32 %a) {
197 %cmp = icmp uge i32 %a, 4
198 br i1 %cmp, label %then, label %else
199 then:
200 br label %end
201 else:
202 br label %end
203 end:
204 ret void
205 }
206
207 ; ASM-LABEL: test_04:
208 ; ASM-LABEL: .Ltest_04$__0:
209 ; ASM-NEXT: # $zero = def.pseudo
210 ; ASM-NEXT: addiu $v0, $zero, 4
211 ; ASM-NEXT: sltu $a0, $a0, $v0
212 ; ASM-NEXT: bnez $a0, .Ltest_04$end
213 ; ASM-LABEL: .Ltest_04$end:
214 ; ASM-NEXT: jr $ra
215 ; ASM-LABEL: .Ltest_04$then:
216 ; ASM-LABEL: .Ltest_04$else:
217
218 ; DIS-LABEL:00000060 <test_04>:
219 ; DIS-NEXT: 60: 24020004 li v0,4
220 ; DIS-NEXT: 64: 0082202b sltu a0,a0,v0
221 ; DIS-NEXT: 68: 14800001 bnez a0,70 <.Ltest_04$end>
222 ; DIS-NEXT: 6c: 00000000 nop
223 ; DIS-LABEL:00000070 <.Ltest_04$end>:
224 ; DIS-NEXT: 70: 03e00008 jr ra
225 ; DIS-NEXT: 74: 00000000 nop
226
227 ; IASM-LABEL: test_04:
228 ; IASM-LABEL: .Ltest_04$__0:
229 ; IASM-NEXT: .byte 0x4
230 ; IASM-NEXT: .byte 0x0
231 ; IASM-NEXT: .byte 0x2
232 ; IASM-NEXT: .byte 0x24
233 ; IASM-NEXT: .byte 0x2b
234 ; IASM-NEXT: .byte 0x20
235 ; IASM-NEXT: .byte 0x82
236 ; IASM-NEXT: .byte 0x0
237 ; IASM-NEXT: .byte 0x1
238 ; IASM-NEXT: .byte 0x0
239 ; IASM-NEXT: .byte 0x80
240 ; IASM-NEXT: .byte 0x14
241 ; IASM-NEXT: .byte 0x0
242 ; IASM-NEXT: .byte 0x0
243 ; IASM-NEXT: .byte 0x0
244 ; IASM-NEXT: .byte 0x0
245 ; IASM-LABEL: .Ltest_04$end:
246 ; IASM-NEXT: .byte 0x8
247 ; IASM-NEXT: .byte 0x0
248 ; IASM-NEXT: .byte 0xe0
249 ; IASM-NEXT: .byte 0x3
250 ; IASM-NEXT: .byte 0x0
251 ; IASM-NEXT: .byte 0x0
252 ; IASM-NEXT: .byte 0x0
253 ; IASM-NEXT: .byte 0x0
254 ; IASM-LABEL: .Ltest_04$then:
255 ; IASM-LABEL: .Ltest_04$else:
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698