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

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

Issue 2478113003: [SubZero] Utilize instructions with immediate operands (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 1 month 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
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | tests_lit/llvm2ice_tests/8bit.pnacl.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; Test encoding of MIPS32 arithmetic instructions 1 ; Test encoding of MIPS32 arithmetic instructions
2 2
3 ; REQUIRES: allow_dump 3 ; REQUIRES: allow_dump
4 4
5 ; Compile using standalone assembler. 5 ; Compile using standalone assembler.
6 ; RUN: %p2i --filetype=asm -i %s --target=mips32 --args -O2 \ 6 ; RUN: %p2i --filetype=asm -i %s --target=mips32 --args -O2 \
7 ; RUN: --allow-externally-defined-symbols \ 7 ; RUN: --allow-externally-defined-symbols \
8 ; RUN: | FileCheck %s --check-prefix=ASM 8 ; RUN: | FileCheck %s --check-prefix=ASM
9 9
10 ; Show bytes in assembled standalone code. 10 ; Show bytes in assembled standalone code.
(...skipping 14 matching lines...) Expand all
25 define internal i32 @test_01(i32 %a) { 25 define internal i32 @test_01(i32 %a) {
26 %v = add i32 %a, 1 26 %v = add i32 %a, 1
27 %v1 = and i32 %v, 1 27 %v1 = and i32 %v, 1
28 %v2 = or i32 %v1, 1 28 %v2 = or i32 %v1, 1
29 %v3 = xor i32 %v2, 1 29 %v3 = xor i32 %v2, 1
30 ret i32 %v3 30 ret i32 %v3
31 } 31 }
32 32
33 ; ASM-LABEL: test_01: 33 ; ASM-LABEL: test_01:
34 ; ASM-NEXT: .Ltest_01$__0: 34 ; ASM-NEXT: .Ltest_01$__0:
35 ; ASM-NEXT:» # $zero = def.pseudo 35 ; ASM-NEXT:» addiu» $a0, $a0, 1
36 ; ASM-NEXT:» addiu» $v0, $zero, 1 36 ; ASM-NEXT:» andi» $a0, $a0, 1
37 ; ASM-NEXT:» addu» $a0, $a0, $v0 37 ; ASM-NEXT:» ori» $a0, $a0, 1
38 ; ASM-NEXT:» # $zero = def.pseudo 38 ; ASM-NEXT:» xori» $a0, $a0, 1
39 ; ASM-NEXT:» addiu» $v0, $zero, 1
40 ; ASM-NEXT:» and» $a0, $a0, $v0
41 ; ASM-NEXT:» # $zero = def.pseudo
42 ; ASM-NEXT:» addiu» $v0, $zero, 1
43 ; ASM-NEXT:» or» $a0, $a0, $v0
44 ; ASM-NEXT:» # $zero = def.pseudo
45 ; ASM-NEXT:» addiu» $v0, $zero, 1
46 ; ASM-NEXT:» xor» $a0, $a0, $v0
47 ; ASM-NEXT: move $v0, $a0 39 ; ASM-NEXT: move $v0, $a0
48 ; ASM-NEXT: jr $ra 40 ; ASM-NEXT: jr $ra
49 41
50 ; DIS-LABEL:00000000 <test_01>: 42 ; DIS-LABEL:00000000 <test_01>:
51 ; DIS-NEXT: 0: 24020001» li» v0,1 43 ; DIS-NEXT: 0:» 24840001 » addiu» a0,a0,1
52 ; DIS-NEXT: 4: 00822021» addu» a0,a0,v0 44 ; DIS-NEXT: 4:» 30840001 » andi» a0,a0,0x1
53 ; DIS-NEXT: 8: 24020001» li» v0,1 45 ; DIS-NEXT: 8:» 34840001 » ori» a0,a0,0x1
54 ; DIS-NEXT: c: 00822024» and» a0,a0,v0 46 ; DIS-NEXT: c:» 38840001 » xori» a0,a0,0x1
55 ; DIS-NEXT: 10: 24020001» li» v0,1 47 ; DIS-NEXT: 10:» 00801021 » move» v0,a0
56 ; DIS-NEXT: 14: 00822025» or» a0,a0,v0 48 ; DIS-NEXT: 14:» 03e00008 » jr» ra
57 ; DIS-NEXT: 18: 24020001» li» v0,1 49 ; DIS-NEXT: 18:» 00000000 » nop
58 ; DIS-NEXT: 1c: 00822026» xor» a0,a0,v0
59 ; DIS-NEXT: 20: 00801021» move» v0,a0
60 ; DIS-NEXT: 24: 03e00008» jr» ra
61 ; DIS-NEXT: 28: 00000000» nop
62 50
63 ; IASM-LABEL: test_01: 51 ; IASM-LABEL: test_01:
64 ; IASM-LABEL: .Ltest_01$__0: 52 ; IASM-LABEL: .Ltest_01$__0:
65 ; IASM-NEXT: .byte 0x1 53 ; IASM-NEXT: .byte 0x1
66 ; IASM-NEXT: .byte 0x0 54 ; IASM-NEXT: .byte 0x0
67 ; IASM-NEXT:» .byte 0x2 55 ; IASM-NEXT:» .byte 0x84
68 ; IASM-NEXT: .byte 0x24 56 ; IASM-NEXT: .byte 0x24
69 ; IASM-NEXT: .byte 0x21
70 ; IASM-NEXT: .byte 0x20
71 ; IASM-NEXT: .byte 0x82
72 ; IASM-NEXT: .byte 0x0
73 ; IASM-NEXT: .byte 0x1 57 ; IASM-NEXT: .byte 0x1
74 ; IASM-NEXT: .byte 0x0 58 ; IASM-NEXT: .byte 0x0
75 ; IASM-NEXT:» .byte 0x2 59 ; IASM-NEXT:» .byte 0x84
76 ; IASM-NEXT:» .byte 0x24 60 ; IASM-NEXT:» .byte 0x30
77 ; IASM-NEXT:» .byte 0x24
78 ; IASM-NEXT:» .byte 0x20
79 ; IASM-NEXT:» .byte 0x82
80 ; IASM-NEXT:» .byte 0x0
81 ; IASM-NEXT: .byte 0x1 61 ; IASM-NEXT: .byte 0x1
82 ; IASM-NEXT: .byte 0x0 62 ; IASM-NEXT: .byte 0x0
83 ; IASM-NEXT:» .byte 0x2 63 ; IASM-NEXT:» .byte 0x84
84 ; IASM-NEXT:» .byte 0x24 64 ; IASM-NEXT:» .byte 0x34
85 ; IASM-NEXT:» .byte 0x25
86 ; IASM-NEXT:» .byte 0x20
87 ; IASM-NEXT:» .byte 0x82
88 ; IASM-NEXT:» .byte 0x0
89 ; IASM-NEXT: .byte 0x1 65 ; IASM-NEXT: .byte 0x1
90 ; IASM-NEXT: .byte 0x0 66 ; IASM-NEXT: .byte 0x0
91 ; IASM-NEXT:» .byte 0x2 67 ; IASM-NEXT:» .byte 0x84
92 ; IASM-NEXT:» .byte 0x24 68 ; IASM-NEXT:» .byte 0x38
93 ; IASM-NEXT:» .byte 0x26
94 ; IASM-NEXT:» .byte 0x20
95 ; IASM-NEXT:» .byte 0x82
96 ; IASM-NEXT:» .byte 0x0
97 ; IASM-NEXT: .byte 0x21 69 ; IASM-NEXT: .byte 0x21
98 ; IASM-NEXT: .byte 0x10 70 ; IASM-NEXT: .byte 0x10
99 ; IASM-NEXT: .byte 0x80 71 ; IASM-NEXT: .byte 0x80
100 ; IASM-NEXT: .byte 0x0 72 ; IASM-NEXT: .byte 0x0
101 ; IASM-NEXT: .byte 0x8 73 ; IASM-NEXT: .byte 0x8
102 ; IASM-NEXT: .byte 0x0 74 ; IASM-NEXT: .byte 0x0
103 ; IASM-NEXT: .byte 0xe0 75 ; IASM-NEXT: .byte 0xe0
104 ; IASM-NEXT: .byte 0x3 76 ; IASM-NEXT: .byte 0x3
105 ; IASM-NEXT: .byte 0x0 77 ; IASM-NEXT: .byte 0x0
106 ; IASM-NEXT: .byte 0x0 78 ; IASM-NEXT: .byte 0x0
107 ; IASM-NEXT: .byte 0x0 79 ; IASM-NEXT: .byte 0x0
108 ; IASM-NEXT: .byte 0x0 80 ; IASM-NEXT: .byte 0x0
109 81
110 define internal i32 @test_02(i32 %a) { 82 define internal i32 @test_02(i32 %a) {
111 %cmp = icmp eq i32 %a, 9 83 %cmp = icmp eq i32 %a, 9
112 %cmp.ret_ext = zext i1 %cmp to i32 84 %cmp.ret_ext = zext i1 %cmp to i32
113 ret i32 %cmp.ret_ext 85 ret i32 %cmp.ret_ext
114 } 86 }
115 87
116 ; ASM-LABEL: test_02: 88 ; ASM-LABEL: test_02:
117 ; ASM-NEXT: .Ltest_02$__0: 89 ; ASM-NEXT: .Ltest_02$__0:
118 ; ASM-NEXT: # $zero = def.pseudo 90 ; ASM-NEXT: # $zero = def.pseudo
119 ; ASM-NEXT: addiu $v0, $zero, 9 91 ; ASM-NEXT: addiu $v0, $zero, 9
120 ; ASM-NEXT: xor $a0, $a0, $v0 92 ; ASM-NEXT: xor $a0, $a0, $v0
121 ; ASM-NEXT: sltiu $a0, $a0, 1 93 ; ASM-NEXT: sltiu $a0, $a0, 1
122 ; ASM-NEXT: andi $a0, $a0, 1 94 ; ASM-NEXT: andi $a0, $a0, 1
123 ; ASM-NEXT: move $v0, $a0 95 ; ASM-NEXT: move $v0, $a0
124 ; ASM-NEXT: jr $ra 96 ; ASM-NEXT: jr $ra
125 97
126 ; DIS-LABEL:00000030 <test_02>: 98 ; DIS-LABEL:00000020 <test_02>:
127 ; DIS-NEXT: 30: 24020009» li» v0,9 99 ; DIS-NEXT: 20:» 24020009 » li» v0,9
128 ; DIS-NEXT: 34: 00822026» xor» a0,a0,v0 100 ; DIS-NEXT: 24:» 00822026 » xor» a0,a0,v0
129 ; DIS-NEXT: 38: 2c840001» sltiu» a0,a0,1 101 ; DIS-NEXT: 28:» 2c840001 » sltiu» a0,a0,1
130 ; DIS-NEXT: 3c: 30840001» andi» a0,a0,0x1 102 ; DIS-NEXT: 2c:» 30840001 » andi» a0,a0,0x1
131 ; DIS-NEXT: 40: 00801021» move» v0,a0 103 ; DIS-NEXT: 30:» 00801021 » move» v0,a0
132 ; DIS-NEXT: 44: 03e00008» jr» ra 104 ; DIS-NEXT: 34:» 03e00008 » jr» ra
133 ; DIS-NEXT: 48: 00000000» nop 105 ; DIS-NEXT: 38:» 00000000 » nop
134 106
135 ; IASM-LABEL: test_02: 107 ; IASM-LABEL: test_02:
136 ; IASM-LABEL: .Ltest_02$__0: 108 ; IASM-LABEL: .Ltest_02$__0:
137 ; IASM-NEXT: .byte 0x9 109 ; IASM-NEXT: .byte 0x9
138 ; IASM-NEXT: .byte 0x0 110 ; IASM-NEXT: .byte 0x0
139 ; IASM-NEXT: .byte 0x2 111 ; IASM-NEXT: .byte 0x2
140 ; IASM-NEXT: .byte 0x24 112 ; IASM-NEXT: .byte 0x24
141 ; IASM-NEXT: .byte 0x26 113 ; IASM-NEXT: .byte 0x26
142 ; IASM-NEXT: .byte 0x20 114 ; IASM-NEXT: .byte 0x20
143 ; IASM-NEXT: .byte 0x82 115 ; IASM-NEXT: .byte 0x82
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ; ASM-NEXT: move $v0, $a0 147 ; ASM-NEXT: move $v0, $a0
176 ; ASM-NEXT: jr $ra 148 ; ASM-NEXT: jr $ra
177 149
178 ; DIS-LABEL: <ashrImm>: 150 ; DIS-LABEL: <ashrImm>:
179 ; DIS-NEXT: 00a42007 srav a0,a0,a1 151 ; DIS-NEXT: 00a42007 srav a0,a0,a1
180 ; DIS-NEXT: 00801021 move v0,a0 152 ; DIS-NEXT: 00801021 move v0,a0
181 ; DIS-NEXT: 03e00008 jr ra 153 ; DIS-NEXT: 03e00008 jr ra
182 154
183 ; IASM-LABEL: ashrImm: 155 ; IASM-LABEL: ashrImm:
184 ; IASM-NEXT: .LashrImm$entry: 156 ; IASM-NEXT: .LashrImm$entry:
185 ; IASM-NEXT: » .byte 0x7 157 ; IASM-NEXT:» .byte 0x7
186 ; IASM-NEXT: » .byte 0x20 158 ; IASM-NEXT:» .byte 0x20
187 ; IASM-NEXT: » .byte 0xa4 159 ; IASM-NEXT:» .byte 0xa4
188 ; IASM-NEXT: » .byte 0x0 160 ; IASM-NEXT:» .byte 0x0
189 ; IASM-NEXT: » .byte 0x21 161 ; IASM-NEXT:» .byte 0x21
190 ; IASM-NEXT: » .byte 0x10 162 ; IASM-NEXT:» .byte 0x10
191 ; IASM-NEXT: » .byte 0x80 163 ; IASM-NEXT:» .byte 0x80
192 ; IASM-NEXT: » .byte 0x0 164 ; IASM-NEXT:» .byte 0x0
193 ; IASM-NEXT: » .byte 0x8 165 ; IASM-NEXT:» .byte 0x8
194 ; IASM-NEXT: » .byte 0x0 166 ; IASM-NEXT:» .byte 0x0
195 ; IASM-NEXT: » .byte 0xe0 167 ; IASM-NEXT:» .byte 0xe0
196 ; IASM-NEXT: » .byte 0x3 168 ; IASM-NEXT:» .byte 0x3
169 ; IASM-NEXT:» .byte 0x0
170 ; IASM-NEXT:» .byte 0x0
171 ; IASM-NEXT:» .byte 0x0
172 ; IASM-NEXT:» .byte 0x0
OLDNEW
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | tests_lit/llvm2ice_tests/8bit.pnacl.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698