OLD | NEW |
1 ; Test encoding of MIPS32 instructions used in intrinsic calls | 1 ; Test encoding of MIPS32 instructions used in intrinsic calls |
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 --skip-unimplemented \ | 7 ; RUN: --allow-externally-defined-symbols --skip-unimplemented \ |
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. |
11 ; RUN: %p2i --filetype=asm -i %s --target=mips32 --assemble --disassemble \ | 11 ; RUN: %p2i --filetype=asm -i %s --target=mips32 --assemble --disassemble \ |
12 ; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \ | 12 ; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \ |
13 ; RUN: | FileCheck %s --check-prefix=DIS | 13 ; RUN: | FileCheck %s --check-prefix=DIS |
14 | 14 |
15 ; Compile using integrated assembler. | 15 ; Compile using integrated assembler. |
16 ; RUN: %p2i --filetype=iasm -i %s --target=mips32 --args -O2 \ | 16 ; RUN: %p2i --filetype=iasm -i %s --target=mips32 --args -O2 \ |
17 ; RUN: --allow-externally-defined-symbols --skip-unimplemented \ | 17 ; RUN: --allow-externally-defined-symbols --skip-unimplemented \ |
18 ; RUN: | FileCheck %s --check-prefix=IASM | 18 ; RUN: | FileCheck %s --check-prefix=IASM |
19 | 19 |
20 ; Show bytes in assembled integrated code. | 20 ; Show bytes in assembled integrated code. |
21 ; RUN: %p2i --filetype=iasm -i %s --target=mips32 --assemble --disassemble \ | 21 ; RUN: %p2i --filetype=iasm -i %s --target=mips32 --assemble --disassemble \ |
22 ; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \ | 22 ; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \ |
23 ; RUN: | FileCheck %s --check-prefix=DIS | 23 ; RUN: | FileCheck %s --check-prefix=DIS |
24 | 24 |
| 25 declare i16 @llvm.bswap.i16(i16) |
| 26 declare i32 @llvm.bswap.i32(i32) |
| 27 declare i64 @llvm.bswap.i64(i64) |
25 declare i32 @llvm.ctlz.i32(i32, i1) | 28 declare i32 @llvm.ctlz.i32(i32, i1) |
26 declare i32 @llvm.cttz.i32(i32, i1) | 29 declare i32 @llvm.cttz.i32(i32, i1) |
27 declare void @llvm.trap() | 30 declare void @llvm.trap() |
28 | 31 |
| 32 define internal i32 @encBswap16(i32 %x) { |
| 33 entry: |
| 34 %x_trunc = trunc i32 %x to i16 |
| 35 %r = call i16 @llvm.bswap.i16(i16 %x_trunc) |
| 36 %r_zext = zext i16 %r to i32 |
| 37 ret i32 %r_zext |
| 38 } |
| 39 |
| 40 ; ASM-LABEL: encBswap16 |
| 41 ; ASM-NEXT: .LencBswap16$entry: |
| 42 ; ASM-NEXT: sll $v0, $a0, 8 |
| 43 ; ASM-NEXT: lui $v1, 255 |
| 44 ; ASM-NEXT: and $v0, $v0, $v1 |
| 45 ; ASM-NEXT: sll $a0, $a0, 24 |
| 46 ; ASM-NEXT: or $v0, $a0, $v0 |
| 47 ; ASM-NEXT: srl $v0, $v0, 16 |
| 48 ; ASM-NEXT: andi $v0, $v0, 65535 |
| 49 ; ASM-NEXT: jr $ra |
| 50 |
| 51 ; DIS-LABEL: {{.*}} <encBswap16>: |
| 52 ; DIS-NEXT: {{.*}} 00041200 sll v0,a0,0x8 |
| 53 ; DIS-NEXT: {{.*}} 3c0300ff lui v1,0xff |
| 54 ; DIS-NEXT: {{.*}} 00431024 and v0,v0,v1 |
| 55 ; DIS-NEXT: {{.*}} 00042600 sll a0,a0,0x18 |
| 56 ; DIS-NEXT: {{.*}} 00821025 or v0,a0,v0 |
| 57 ; DIS-NEXT: {{.*}} 00021402 srl v0,v0,0x10 |
| 58 ; DIS-NEXT: {{.*}} 3042ffff andi v0,v0,0xffff |
| 59 ; DIS-NEXT: {{.*}} 03e00008 jr ra |
| 60 |
| 61 ; IASM-LABEL: encBswap16 |
| 62 ; IASM-NEXT: .LencBswap16$entry: |
| 63 ; IASM-NEXT: .byte 0x0 |
| 64 ; IASM-NEXT: .byte 0x12 |
| 65 ; IASM-NEXT: .byte 0x4 |
| 66 ; IASM-NEXT: .byte 0x0 |
| 67 ; IASM-NEXT: .byte 0xff |
| 68 ; IASM-NEXT: .byte 0x0 |
| 69 ; IASM-NEXT: .byte 0x3 |
| 70 ; IASM-NEXT: .byte 0x3c |
| 71 ; IASM-NEXT: .byte 0x24 |
| 72 ; IASM-NEXT: .byte 0x10 |
| 73 ; IASM-NEXT: .byte 0x43 |
| 74 ; IASM-NEXT: .byte 0x0 |
| 75 ; IASM-NEXT: .byte 0x0 |
| 76 ; IASM-NEXT: .byte 0x26 |
| 77 ; IASM-NEXT: .byte 0x4 |
| 78 ; IASM-NEXT: .byte 0x0 |
| 79 ; IASM-NEXT: .byte 0x25 |
| 80 ; IASM-NEXT: .byte 0x10 |
| 81 ; IASM-NEXT: .byte 0x82 |
| 82 ; IASM-NEXT: .byte 0x0 |
| 83 ; IASM-NEXT: .byte 0x2 |
| 84 ; IASM-NEXT: .byte 0x14 |
| 85 ; IASM-NEXT: .byte 0x2 |
| 86 ; IASM-NEXT: .byte 0x0 |
| 87 ; IASM-NEXT: .byte 0xff |
| 88 ; IASM-NEXT: .byte 0xff |
| 89 ; IASM-NEXT: .byte 0x42 |
| 90 ; IASM-NEXT: .byte 0x30 |
| 91 ; IASM-NEXT: .byte 0x8 |
| 92 ; IASM-NEXT: .byte 0x0 |
| 93 ; IASM-NEXT: .byte 0xe0 |
| 94 ; IASM-NEXT: .byte 0x3 |
| 95 |
| 96 define internal i32 @encBswap32(i32 %x) { |
| 97 entry: |
| 98 %r = call i32 @llvm.bswap.i32(i32 %x) |
| 99 ret i32 %r |
| 100 } |
| 101 |
| 102 ; ASM-LABEL: encBswap32 |
| 103 ; ASM-NEXT: .LencBswap32$entry: |
| 104 ; ASM-NEXT: srl $v0, $a0, 24 |
| 105 ; ASM-NEXT: srl $v1, $a0, 8 |
| 106 ; ASM-NEXT: andi $v1, $v1, 65280 |
| 107 ; ASM-NEXT: or $v0, $v1, $v0 |
| 108 ; ASM-NEXT: sll $v1, $a0, 8 |
| 109 ; ASM-NEXT: lui $a1, 255 |
| 110 ; ASM-NEXT: and $v1, $v1, $a1 |
| 111 ; ASM-NEXT: sll $a0, $a0, 24 |
| 112 ; ASM-NEXT: or $v1, $a0, $v1 |
| 113 ; ASM-NEXT: or $v1, $v1, $v0 |
| 114 ; ASM-NEXT: move $v0, $v1 |
| 115 ; ASM-NEXT: jr $ra |
| 116 |
| 117 ; DIS-LABEL: {{.*}} <encBswap32>: |
| 118 ; DIS-NEXT: {{.*}} 00041602 srl v0,a0,0x18 |
| 119 ; DIS-NEXT: {{.*}} 00041a02 srl v1,a0,0x8 |
| 120 ; DIS-NEXT: {{.*}} 3063ff00 andi v1,v1,0xff00 |
| 121 ; DIS-NEXT: {{.*}} 00621025 or v0,v1,v0 |
| 122 ; DIS-NEXT: {{.*}} 00041a00 sll v1,a0,0x8 |
| 123 ; DIS-NEXT: {{.*}} 3c0500ff lui a1,0xff |
| 124 ; DIS-NEXT: {{.*}} 00651824 and v1,v1,a1 |
| 125 ; DIS-NEXT: {{.*}} 00042600 sll a0,a0,0x18 |
| 126 ; DIS-NEXT: {{.*}} 00831825 or v1,a0,v1 |
| 127 ; DIS-NEXT: {{.*}} 00621825 or v1,v1,v0 |
| 128 ; DIS-NEXT: {{.*}} 00601021 move v0,v1 |
| 129 ; DIS-NEXT: {{.*}} 03e00008 jr ra |
| 130 |
| 131 ; IASM-LABEL: encBswap32 |
| 132 ; IASM-NEXT: .LencBswap32$entry: |
| 133 ; IASM-NEXT: .byte 0x2 |
| 134 ; IASM-NEXT: .byte 0x16 |
| 135 ; IASM-NEXT: .byte 0x4 |
| 136 ; IASM-NEXT: .byte 0x0 |
| 137 ; IASM-NEXT: .byte 0x2 |
| 138 ; IASM-NEXT: .byte 0x1a |
| 139 ; IASM-NEXT: .byte 0x4 |
| 140 ; IASM-NEXT: .byte 0x0 |
| 141 ; IASM-NEXT: .byte 0x0 |
| 142 ; IASM-NEXT: .byte 0xff |
| 143 ; IASM-NEXT: .byte 0x63 |
| 144 ; IASM-NEXT: .byte 0x30 |
| 145 ; IASM-NEXT: .byte 0x25 |
| 146 ; IASM-NEXT: .byte 0x10 |
| 147 ; IASM-NEXT: .byte 0x62 |
| 148 ; IASM-NEXT: .byte 0x0 |
| 149 ; IASM-NEXT: .byte 0x0 |
| 150 ; IASM-NEXT: .byte 0x1a |
| 151 ; IASM-NEXT: .byte 0x4 |
| 152 ; IASM-NEXT: .byte 0x0 |
| 153 ; IASM-NEXT: .byte 0xff |
| 154 ; IASM-NEXT: .byte 0x0 |
| 155 ; IASM-NEXT: .byte 0x5 |
| 156 ; IASM-NEXT: .byte 0x3c |
| 157 ; IASM-NEXT: .byte 0x24 |
| 158 ; IASM-NEXT: .byte 0x18 |
| 159 ; IASM-NEXT: .byte 0x65 |
| 160 ; IASM-NEXT: .byte 0x0 |
| 161 ; IASM-NEXT: .byte 0x0 |
| 162 ; IASM-NEXT: .byte 0x26 |
| 163 ; IASM-NEXT: .byte 0x4 |
| 164 ; IASM-NEXT: .byte 0x0 |
| 165 ; IASM-NEXT: .byte 0x25 |
| 166 ; IASM-NEXT: .byte 0x18 |
| 167 ; IASM-NEXT: .byte 0x83 |
| 168 ; IASM-NEXT: .byte 0x0 |
| 169 ; IASM-NEXT: .byte 0x25 |
| 170 ; IASM-NEXT: .byte 0x18 |
| 171 ; IASM-NEXT: .byte 0x62 |
| 172 ; IASM-NEXT: .byte 0x0 |
| 173 ; IASM-NEXT: .byte 0x21 |
| 174 ; IASM-NEXT: .byte 0x10 |
| 175 ; IASM-NEXT: .byte 0x60 |
| 176 ; IASM-NEXT: .byte 0x0 |
| 177 ; IASM-NEXT: .byte 0x8 |
| 178 ; IASM-NEXT: .byte 0x0 |
| 179 ; IASM-NEXT: .byte 0xe0 |
| 180 ; IASM-NEXT: .byte 0x3 |
| 181 |
| 182 define internal i64 @encBswap64(i64 %x) { |
| 183 entry: |
| 184 %r = call i64 @llvm.bswap.i64(i64 %x) |
| 185 ret i64 %r |
| 186 } |
| 187 |
| 188 ; ASM-LABEL: encBswap64 |
| 189 ; ASM-NEXT: .LencBswap64$entry: |
| 190 ; ASM-NEXT: sll $v0, $a1, 8 |
| 191 ; ASM-NEXT: srl $v1, $a1, 24 |
| 192 ; ASM-NEXT: srl $a2, $a1, 8 |
| 193 ; ASM-NEXT: andi $a2, $a2, 65280 |
| 194 ; ASM-NEXT: lui $a3, 255 |
| 195 ; ASM-NEXT: or $a2, $a2, $v1 |
| 196 ; ASM-NEXT: and $v0, $v0, $a3 |
| 197 ; ASM-NEXT: sll $a1, $a1, 24 |
| 198 ; ASM-NEXT: or $a1, $a1, $v0 |
| 199 ; ASM-NEXT: srl $v0, $a0, 24 |
| 200 ; ASM-NEXT: srl $v1, $a0, 8 |
| 201 ; ASM-NEXT: andi $v1, $v1, 65280 |
| 202 ; ASM-NEXT: or $a1, $a1, $a2 |
| 203 ; ASM-NEXT: or $v1, $v1, $v0 |
| 204 ; ASM-NEXT: sll $v0, $a0, 8 |
| 205 ; ASM-NEXT: and $v0, $v0, $a3 |
| 206 ; ASM-NEXT: sll $a0, $a0, 24 |
| 207 ; ASM-NEXT: or $a0, $a0, $v0 |
| 208 ; ASM-NEXT: or $a0, $a0, $v1 |
| 209 ; ASM-NEXT: move $v0, $a1 |
| 210 ; ASM-NEXT: move $v1, $a0 |
| 211 ; ASM-NEXT: jr $ra |
| 212 |
| 213 ; DIS-LABEL: {{.*}} <encBswap64>: |
| 214 ; DIS-NEXT: {{.*}} 00051200 sll v0,a1,0x8 |
| 215 ; DIS-NEXT: {{.*}} 00051e02 srl v1,a1,0x18 |
| 216 ; DIS-NEXT: {{.*}} 00053202 srl a2,a1,0x8 |
| 217 ; DIS-NEXT: {{.*}} 30c6ff00 andi a2,a2,0xff00 |
| 218 ; DIS-NEXT: {{.*}} 3c0700ff lui a3,0xff |
| 219 ; DIS-NEXT: {{.*}} 00c33025 or a2,a2,v1 |
| 220 ; DIS-NEXT: {{.*}} 00471024 and v0,v0,a3 |
| 221 ; DIS-NEXT: {{.*}} 00052e00 sll a1,a1,0x18 |
| 222 ; DIS-NEXT: {{.*}} 00a22825 or a1,a1,v0 |
| 223 ; DIS-NEXT: {{.*}} 00041602 srl v0,a0,0x18 |
| 224 ; DIS-NEXT: {{.*}} 00041a02 srl v1,a0,0x8 |
| 225 ; DIS-NEXT: {{.*}} 3063ff00 andi v1,v1,0xff00 |
| 226 ; DIS-NEXT: {{.*}} 00a62825 or a1,a1,a2 |
| 227 ; DIS-NEXT: {{.*}} 00621825 or v1,v1,v0 |
| 228 ; DIS-NEXT: {{.*}} 00041200 sll v0,a0,0x8 |
| 229 ; DIS-NEXT: {{.*}} 00471024 and v0,v0,a3 |
| 230 ; DIS-NEXT: {{.*}} 00042600 sll a0,a0,0x18 |
| 231 ; DIS-NEXT: {{.*}} 00822025 or a0,a0,v0 |
| 232 ; DIS-NEXT: {{.*}} 00832025 or a0,a0,v1 |
| 233 ; DIS-NEXT: {{.*}} 00a01021 move v0,a1 |
| 234 ; DIS-NEXT: {{.*}} 00801821 move v1,a0 |
| 235 ; DIS-NEXT: {{.*}} 03e00008 jr ra |
| 236 |
| 237 |
| 238 ; IASM-LABEL: encBswap64 |
| 239 ; IASM-NEXT: .LencBswap64$entry: |
| 240 ; IASM-NEXT: .byte 0x0 |
| 241 ; IASM-NEXT: .byte 0x12 |
| 242 ; IASM-NEXT: .byte 0x5 |
| 243 ; IASM-NEXT: .byte 0x0 |
| 244 ; IASM-NEXT: .byte 0x2 |
| 245 ; IASM-NEXT: .byte 0x1e |
| 246 ; IASM-NEXT: .byte 0x5 |
| 247 ; IASM-NEXT: .byte 0x0 |
| 248 ; IASM-NEXT: .byte 0x2 |
| 249 ; IASM-NEXT: .byte 0x32 |
| 250 ; IASM-NEXT: .byte 0x5 |
| 251 ; IASM-NEXT: .byte 0x0 |
| 252 ; IASM-NEXT: .byte 0x0 |
| 253 ; IASM-NEXT: .byte 0xff |
| 254 ; IASM-NEXT: .byte 0xc6 |
| 255 ; IASM-NEXT: .byte 0x30 |
| 256 ; IASM-NEXT: .byte 0xff |
| 257 ; IASM-NEXT: .byte 0x0 |
| 258 ; IASM-NEXT: .byte 0x7 |
| 259 ; IASM-NEXT: .byte 0x3c |
| 260 ; IASM-NEXT: .byte 0x25 |
| 261 ; IASM-NEXT: .byte 0x30 |
| 262 ; IASM-NEXT: .byte 0xc3 |
| 263 ; IASM-NEXT: .byte 0x0 |
| 264 ; IASM-NEXT: .byte 0x24 |
| 265 ; IASM-NEXT: .byte 0x10 |
| 266 ; IASM-NEXT: .byte 0x47 |
| 267 ; IASM-NEXT: .byte 0x0 |
| 268 ; IASM-NEXT: .byte 0x0 |
| 269 ; IASM-NEXT: .byte 0x2e |
| 270 ; IASM-NEXT: .byte 0x5 |
| 271 ; IASM-NEXT: .byte 0x0 |
| 272 ; IASM-NEXT: .byte 0x25 |
| 273 ; IASM-NEXT: .byte 0x28 |
| 274 ; IASM-NEXT: .byte 0xa2 |
| 275 ; IASM-NEXT: .byte 0x0 |
| 276 ; IASM-NEXT: .byte 0x2 |
| 277 ; IASM-NEXT: .byte 0x16 |
| 278 ; IASM-NEXT: .byte 0x4 |
| 279 ; IASM-NEXT: .byte 0x0 |
| 280 ; IASM-NEXT: .byte 0x2 |
| 281 ; IASM-NEXT: .byte 0x1a |
| 282 ; IASM-NEXT: .byte 0x4 |
| 283 ; IASM-NEXT: .byte 0x0 |
| 284 ; IASM-NEXT: .byte 0x0 |
| 285 ; IASM-NEXT: .byte 0xff |
| 286 ; IASM-NEXT: .byte 0x63 |
| 287 ; IASM-NEXT: .byte 0x30 |
| 288 ; IASM-NEXT: .byte 0x25 |
| 289 ; IASM-NEXT: .byte 0x28 |
| 290 ; IASM-NEXT: .byte 0xa6 |
| 291 ; IASM-NEXT: .byte 0x0 |
| 292 ; IASM-NEXT: .byte 0x25 |
| 293 ; IASM-NEXT: .byte 0x18 |
| 294 ; IASM-NEXT: .byte 0x62 |
| 295 ; IASM-NEXT: .byte 0x0 |
| 296 ; IASM-NEXT: .byte 0x0 |
| 297 ; IASM-NEXT: .byte 0x12 |
| 298 ; IASM-NEXT: .byte 0x4 |
| 299 ; IASM-NEXT: .byte 0x0 |
| 300 ; IASM-NEXT: .byte 0x24 |
| 301 ; IASM-NEXT: .byte 0x10 |
| 302 ; IASM-NEXT: .byte 0x47 |
| 303 ; IASM-NEXT: .byte 0x0 |
| 304 ; IASM-NEXT: .byte 0x0 |
| 305 ; IASM-NEXT: .byte 0x26 |
| 306 ; IASM-NEXT: .byte 0x4 |
| 307 ; IASM-NEXT: .byte 0x0 |
| 308 ; IASM-NEXT: .byte 0x25 |
| 309 ; IASM-NEXT: .byte 0x20 |
| 310 ; IASM-NEXT: .byte 0x82 |
| 311 ; IASM-NEXT: .byte 0x0 |
| 312 ; IASM-NEXT: .byte 0x25 |
| 313 ; IASM-NEXT: .byte 0x20 |
| 314 ; IASM-NEXT: .byte 0x83 |
| 315 ; IASM-NEXT: .byte 0x0 |
| 316 ; IASM-NEXT: .byte 0x21 |
| 317 ; IASM-NEXT: .byte 0x10 |
| 318 ; IASM-NEXT: .byte 0xa0 |
| 319 ; IASM-NEXT: .byte 0x0 |
| 320 ; IASM-NEXT: .byte 0x21 |
| 321 ; IASM-NEXT: .byte 0x18 |
| 322 ; IASM-NEXT: .byte 0x80 |
| 323 ; IASM-NEXT: .byte 0x0 |
| 324 ; IASM-NEXT: .byte 0x8 |
| 325 ; IASM-NEXT: .byte 0x0 |
| 326 ; IASM-NEXT: .byte 0xe0 |
| 327 ; IASM-NEXT: .byte 0x3 |
| 328 |
| 329 define internal i64 @encBswap64Undef() { |
| 330 entry: |
| 331 %r = call i64 @llvm.bswap.i64(i64 undef) |
| 332 ret i64 %r |
| 333 } |
| 334 |
| 335 ; ASM-LABEL: encBswap64Undef |
| 336 ; ASM-NEXT: .LencBswap64Undef$entry: |
| 337 ; ASM-NEXT: # $zero = def.pseudo |
| 338 ; ASM-NEXT: addiu $v0, $zero, 0 |
| 339 ; ASM-NEXT: # $zero = def.pseudo |
| 340 ; ASM-NEXT: addiu $v1, $zero, 0 |
| 341 ; ASM-NEXT: sll $a0, $v1, 8 |
| 342 ; ASM-NEXT: srl $a1, $v1, 24 |
| 343 ; ASM-NEXT: srl $a2, $v1, 8 |
| 344 ; ASM-NEXT: andi $a2, $a2, 65280 |
| 345 ; ASM-NEXT: lui $a3, 255 |
| 346 ; ASM-NEXT: or $a2, $a2, $a1 |
| 347 ; ASM-NEXT: and $a0, $a0, $a3 |
| 348 ; ASM-NEXT: sll $v1, $v1, 24 |
| 349 ; ASM-NEXT: or $v1, $v1, $a0 |
| 350 ; ASM-NEXT: srl $a0, $v0, 24 |
| 351 ; ASM-NEXT: srl $a1, $v0, 8 |
| 352 ; ASM-NEXT: andi $a1, $a1, 65280 |
| 353 ; ASM-NEXT: or $v1, $v1, $a2 |
| 354 ; ASM-NEXT: or $a1, $a1, $a0 |
| 355 ; ASM-NEXT: sll $a0, $v0, 8 |
| 356 ; ASM-NEXT: and $a0, $a0, $a3 |
| 357 ; ASM-NEXT: sll $v0, $v0, 24 |
| 358 ; ASM-NEXT: or $v0, $v0, $a0 |
| 359 ; ASM-NEXT: or $v0, $v0, $a1 |
| 360 ; ASM-NEXT: move $a0, $v0 |
| 361 ; ASM-NEXT: move $v0, $v1 |
| 362 ; ASM-NEXT: move $v1, $a0 |
| 363 ; ASM-NEXT: jr $ra |
| 364 |
| 365 ; DIS-LABEL: {{.*}} <encBswap64Undef>: |
| 366 ; DIS-NEXT: {{.*}} 24020000 li v0,0 |
| 367 ; DIS-NEXT: {{.*}} 24030000 li v1,0 |
| 368 ; DIS-NEXT: {{.*}} 00032200 sll a0,v1,0x8 |
| 369 ; DIS-NEXT: {{.*}} 00032e02 srl a1,v1,0x18 |
| 370 ; DIS-NEXT: {{.*}} 00033202 srl a2,v1,0x8 |
| 371 ; DIS-NEXT: {{.*}} 30c6ff00 andi a2,a2,0xff00 |
| 372 ; DIS-NEXT: {{.*}} 3c0700ff lui a3,0xff |
| 373 ; DIS-NEXT: {{.*}} 00c53025 or a2,a2,a1 |
| 374 ; DIS-NEXT: {{.*}} 00872024 and a0,a0,a3 |
| 375 ; DIS-NEXT: {{.*}} 00031e00 sll v1,v1,0x18 |
| 376 ; DIS-NEXT: {{.*}} 00641825 or v1,v1,a0 |
| 377 ; DIS-NEXT: {{.*}} 00022602 srl a0,v0,0x18 |
| 378 ; DIS-NEXT: {{.*}} 00022a02 srl a1,v0,0x8 |
| 379 ; DIS-NEXT: {{.*}} 30a5ff00 andi a1,a1,0xff00 |
| 380 ; DIS-NEXT: {{.*}} 00661825 or v1,v1,a2 |
| 381 ; DIS-NEXT: {{.*}} 00a42825 or a1,a1,a0 |
| 382 ; DIS-NEXT: {{.*}} 00022200 sll a0,v0,0x8 |
| 383 ; DIS-NEXT: {{.*}} 00872024 and a0,a0,a3 |
| 384 ; DIS-NEXT: {{.*}} 00021600 sll v0,v0,0x18 |
| 385 ; DIS-NEXT: {{.*}} 00441025 or v0,v0,a0 |
| 386 ; DIS-NEXT: {{.*}} 00451025 or v0,v0,a1 |
| 387 ; DIS-NEXT: {{.*}} 00402021 move a0,v0 |
| 388 ; DIS-NEXT: {{.*}} 00601021 move v0,v1 |
| 389 ; DIS-NEXT: {{.*}} 00801821 move v1,a0 |
| 390 ; DIS-NEXT: {{.*}} 03e00008 jr ra |
| 391 |
| 392 ; IASM-LABEL: encBswap64Undef |
| 393 ; IASM-NEXT: .LencBswap64Undef$entry: |
| 394 ; IASM-NEXT: .byte 0x0 |
| 395 ; IASM-NEXT: .byte 0x0 |
| 396 ; IASM-NEXT: .byte 0x2 |
| 397 ; IASM-NEXT: .byte 0x24 |
| 398 ; IASM-NEXT: .byte 0x0 |
| 399 ; IASM-NEXT: .byte 0x0 |
| 400 ; IASM-NEXT: .byte 0x3 |
| 401 ; IASM-NEXT: .byte 0x24 |
| 402 ; IASM-NEXT: .byte 0x0 |
| 403 ; IASM-NEXT: .byte 0x22 |
| 404 ; IASM-NEXT: .byte 0x3 |
| 405 ; IASM-NEXT: .byte 0x0 |
| 406 ; IASM-NEXT: .byte 0x2 |
| 407 ; IASM-NEXT: .byte 0x2e |
| 408 ; IASM-NEXT: .byte 0x3 |
| 409 ; IASM-NEXT: .byte 0x0 |
| 410 ; IASM-NEXT: .byte 0x2 |
| 411 ; IASM-NEXT: .byte 0x32 |
| 412 ; IASM-NEXT: .byte 0x3 |
| 413 ; IASM-NEXT: .byte 0x0 |
| 414 ; IASM-NEXT: .byte 0x0 |
| 415 ; IASM-NEXT: .byte 0xff |
| 416 ; IASM-NEXT: .byte 0xc6 |
| 417 ; IASM-NEXT: .byte 0x30 |
| 418 ; IASM-NEXT: .byte 0xff |
| 419 ; IASM-NEXT: .byte 0x0 |
| 420 ; IASM-NEXT: .byte 0x7 |
| 421 ; IASM-NEXT: .byte 0x3c |
| 422 ; IASM-NEXT: .byte 0x25 |
| 423 ; IASM-NEXT: .byte 0x30 |
| 424 ; IASM-NEXT: .byte 0xc5 |
| 425 ; IASM-NEXT: .byte 0x0 |
| 426 ; IASM-NEXT: .byte 0x24 |
| 427 ; IASM-NEXT: .byte 0x20 |
| 428 ; IASM-NEXT: .byte 0x87 |
| 429 ; IASM-NEXT: .byte 0x0 |
| 430 ; IASM-NEXT: .byte 0x0 |
| 431 ; IASM-NEXT: .byte 0x1e |
| 432 ; IASM-NEXT: .byte 0x3 |
| 433 ; IASM-NEXT: .byte 0x0 |
| 434 ; IASM-NEXT: .byte 0x25 |
| 435 ; IASM-NEXT: .byte 0x18 |
| 436 ; IASM-NEXT: .byte 0x64 |
| 437 ; IASM-NEXT: .byte 0x0 |
| 438 ; IASM-NEXT: .byte 0x2 |
| 439 ; IASM-NEXT: .byte 0x26 |
| 440 ; IASM-NEXT: .byte 0x2 |
| 441 ; IASM-NEXT: .byte 0x0 |
| 442 ; IASM-NEXT: .byte 0x2 |
| 443 ; IASM-NEXT: .byte 0x2a |
| 444 ; IASM-NEXT: .byte 0x2 |
| 445 ; IASM-NEXT: .byte 0x0 |
| 446 ; IASM-NEXT: .byte 0x0 |
| 447 ; IASM-NEXT: .byte 0xff |
| 448 ; IASM-NEXT: .byte 0xa5 |
| 449 ; IASM-NEXT: .byte 0x30 |
| 450 ; IASM-NEXT: .byte 0x25 |
| 451 ; IASM-NEXT: .byte 0x18 |
| 452 ; IASM-NEXT: .byte 0x66 |
| 453 ; IASM-NEXT: .byte 0x0 |
| 454 ; IASM-NEXT: .byte 0x25 |
| 455 ; IASM-NEXT: .byte 0x28 |
| 456 ; IASM-NEXT: .byte 0xa4 |
| 457 ; IASM-NEXT: .byte 0x0 |
| 458 ; IASM-NEXT: .byte 0x0 |
| 459 ; IASM-NEXT: .byte 0x22 |
| 460 ; IASM-NEXT: .byte 0x2 |
| 461 ; IASM-NEXT: .byte 0x0 |
| 462 ; IASM-NEXT: .byte 0x24 |
| 463 ; IASM-NEXT: .byte 0x20 |
| 464 ; IASM-NEXT: .byte 0x87 |
| 465 ; IASM-NEXT: .byte 0x0 |
| 466 ; IASM-NEXT: .byte 0x0 |
| 467 ; IASM-NEXT: .byte 0x16 |
| 468 ; IASM-NEXT: .byte 0x2 |
| 469 ; IASM-NEXT: .byte 0x0 |
| 470 ; IASM-NEXT: .byte 0x25 |
| 471 ; IASM-NEXT: .byte 0x10 |
| 472 ; IASM-NEXT: .byte 0x44 |
| 473 ; IASM-NEXT: .byte 0x0 |
| 474 ; IASM-NEXT: .byte 0x25 |
| 475 ; IASM-NEXT: .byte 0x10 |
| 476 ; IASM-NEXT: .byte 0x45 |
| 477 ; IASM-NEXT: .byte 0x0 |
| 478 ; IASM-NEXT: .byte 0x21 |
| 479 ; IASM-NEXT: .byte 0x20 |
| 480 ; IASM-NEXT: .byte 0x40 |
| 481 ; IASM-NEXT: .byte 0x0 |
| 482 ; IASM-NEXT: .byte 0x21 |
| 483 ; IASM-NEXT: .byte 0x10 |
| 484 ; IASM-NEXT: .byte 0x60 |
| 485 ; IASM-NEXT: .byte 0x0 |
| 486 ; IASM-NEXT: .byte 0x21 |
| 487 ; IASM-NEXT: .byte 0x18 |
| 488 ; IASM-NEXT: .byte 0x80 |
| 489 ; IASM-NEXT: .byte 0x0 |
| 490 ; IASM-NEXT: .byte 0x8 |
| 491 ; IASM-NEXT: .byte 0x0 |
| 492 ; IASM-NEXT: .byte 0xe0 |
| 493 ; IASM-NEXT: .byte 0x3 |
| 494 |
29 define internal i32 @encCtlz32(i32 %x) { | 495 define internal i32 @encCtlz32(i32 %x) { |
30 entry: | 496 entry: |
31 %r = call i32 @llvm.ctlz.i32(i32 %x, i1 false) | 497 %r = call i32 @llvm.ctlz.i32(i32 %x, i1 false) |
32 ret i32 %r | 498 ret i32 %r |
33 } | 499 } |
34 | 500 |
35 ; ASM-LABEL: encCtlz32 | 501 ; ASM-LABEL: encCtlz32 |
36 ; ASM-NEXT: .LencCtlz32$entry: | 502 ; ASM-NEXT: .LencCtlz32$entry: |
37 ; ASM-NEXT: clz $a0, $a0 | 503 ; ASM-NEXT: clz $a0, $a0 |
38 ; ASM-NEXT: move $v0, $a0 | 504 ; ASM-NEXT: move $v0, $a0 |
39 ; ASM-NEXT: jr $ra | 505 ; ASM-NEXT: jr $ra |
40 | 506 |
41 ; DIS-LABEL: 00000000 <encCtlz32>: | 507 ; DIS-LABEL: {{.*}} <encCtlz32>: |
42 ; DIS-NEXT: 0:» 70842020 » clz» a0,a0 | 508 ; DIS-NEXT: {{.*}} 70842020 » clz» a0,a0 |
43 ; DIS-NEXT: 4:» 00801021 » move» v0,a0 | 509 ; DIS-NEXT: {{.*}} 00801021 » move» v0,a0 |
44 ; DIS-NEXT: 8:» 03e00008 » jr» ra | 510 ; DIS-NEXT: {{.*}} 03e00008 » jr» ra |
45 | 511 |
46 ; IASM-LABEL: encCtlz32 | 512 ; IASM-LABEL: encCtlz32 |
47 ; IASM-NEXT: .LencCtlz32$entry: | 513 ; IASM-NEXT: .LencCtlz32$entry: |
48 ; IASM-NEXT: .byte 0x20 | 514 ; IASM-NEXT: .byte 0x20 |
49 ; IASM-NEXT: .byte 0x20 | 515 ; IASM-NEXT: .byte 0x20 |
50 ; IASM-NEXT: .byte 0x84 | 516 ; IASM-NEXT: .byte 0x84 |
51 ; IASM-NEXT: .byte 0x70 | 517 ; IASM-NEXT: .byte 0x70 |
52 ; IASM-NEXT: .byte 0x21 | 518 ; IASM-NEXT: .byte 0x21 |
53 ; IASM-NEXT: .byte 0x10 | 519 ; IASM-NEXT: .byte 0x10 |
54 ; IASM-NEXT: .byte 0x80 | 520 ; IASM-NEXT: .byte 0x80 |
(...skipping 12 matching lines...) Expand all Loading... |
67 ; ASM-LABEL: encCttz32 | 533 ; ASM-LABEL: encCttz32 |
68 ; ASM-NEXT: .LencCttz32$entry: | 534 ; ASM-NEXT: .LencCttz32$entry: |
69 ; ASM-NEXT: addiu $v0, $a0, -1 | 535 ; ASM-NEXT: addiu $v0, $a0, -1 |
70 ; ASM-NEXT: nor $a0, $a0, $zero | 536 ; ASM-NEXT: nor $a0, $a0, $zero |
71 ; ASM-NEXT: and $a0, $a0, $v0 | 537 ; ASM-NEXT: and $a0, $a0, $v0 |
72 ; ASM-NEXT: clz $a0, $a0 | 538 ; ASM-NEXT: clz $a0, $a0 |
73 ; ASM-NEXT: addiu $v0, $zero, 32 | 539 ; ASM-NEXT: addiu $v0, $zero, 32 |
74 ; ASM-NEXT: subu $v0, $v0, $a0 | 540 ; ASM-NEXT: subu $v0, $v0, $a0 |
75 ; ASM-NEXT: jr $ra | 541 ; ASM-NEXT: jr $ra |
76 | 542 |
77 ; DIS-LABEL: 00000010 <encCttz32>: | 543 ; DIS-LABEL: {{.*}} <encCttz32>: |
78 ; DIS-NEXT: 10:» 2482ffff » addiu» v0,a0,-1 | 544 ; DIS-NEXT: {{.*}} 2482ffff » addiu» v0,a0,-1 |
79 ; DIS-NEXT: 14:» 00802027 » nor» a0,a0,zero | 545 ; DIS-NEXT: {{.*}} 00802027 » nor» a0,a0,zero |
80 ; DIS-NEXT: 18:» 00822024 » and» a0,a0,v0 | 546 ; DIS-NEXT: {{.*}} 00822024 » and» a0,a0,v0 |
81 ; DIS-NEXT: 1c:» 70842020 » clz» a0,a0 | 547 ; DIS-NEXT: {{.*}} 70842020 » clz» a0,a0 |
82 ; DIS-NEXT: 20:» 24020020 » li» v0,32 | 548 ; DIS-NEXT: {{.*}} 24020020 » li» v0,32 |
83 ; DIS-NEXT: 24:» 00441023 » subu» v0,v0,a0 | 549 ; DIS-NEXT: {{.*}} 00441023 » subu» v0,v0,a0 |
84 ; DIS-NEXT: 28:» 03e00008 » jr» ra | 550 ; DIS-NEXT: {{.*}} 03e00008 » jr» ra |
85 | 551 |
86 ; IASM-LABEL: encCttz32 | 552 ; IASM-LABEL: encCttz32 |
87 ; IASM-NEXT: .LencCttz32$entry: | 553 ; IASM-NEXT: .LencCttz32$entry: |
88 ; IASM-NEXT: .byte 0xff | 554 ; IASM-NEXT: .byte 0xff |
89 ; IASM-NEXT: .byte 0xff | 555 ; IASM-NEXT: .byte 0xff |
90 ; IASM-NEXT: .byte 0x82 | 556 ; IASM-NEXT: .byte 0x82 |
91 ; IASM-NEXT: .byte 0x24 | 557 ; IASM-NEXT: .byte 0x24 |
92 ; IASM-NEXT: .byte 0x27 | 558 ; IASM-NEXT: .byte 0x27 |
93 ; IASM-NEXT: .byte 0x20 | 559 ; IASM-NEXT: .byte 0x20 |
94 ; IASM-NEXT: .byte 0x80 | 560 ; IASM-NEXT: .byte 0x80 |
(...skipping 20 matching lines...) Expand all Loading... |
115 ; IASM-NEXT: .byte 0x3 | 581 ; IASM-NEXT: .byte 0x3 |
116 | 582 |
117 define internal void @encTrap() { | 583 define internal void @encTrap() { |
118 unreachable | 584 unreachable |
119 } | 585 } |
120 | 586 |
121 ; ASM-LABEL: encTrap | 587 ; ASM-LABEL: encTrap |
122 ; ASM-NEXT: .LencTrap$__0: | 588 ; ASM-NEXT: .LencTrap$__0: |
123 ; ASM-NEXT: teq $zero, $zero, 0 | 589 ; ASM-NEXT: teq $zero, $zero, 0 |
124 | 590 |
125 ; DIS-LABEL: 00000030 <encTrap>: | 591 ; DIS-LABEL: {{.*}} <encTrap>: |
126 ; DIS-NEXT: 30:» 00000034 » teq» zero,zero | 592 ; DIS-NEXT: {{.*}} 00000034 » teq» zero,zero |
127 | 593 |
128 ; IASM-LABEL: encTrap: | 594 ; IASM-LABEL: encTrap: |
129 ; IASM-NEXT: .LencTrap$__0: | 595 ; IASM-NEXT: .LencTrap$__0: |
130 ; IASM-NEXT: .byte 0x34 | 596 ; IASM-NEXT: .byte 0x34 |
131 ; IASM-NEXT: .byte 0x0 | 597 ; IASM-NEXT: .byte 0x0 |
132 ; IASM-NEXT: .byte 0x0 | 598 ; IASM-NEXT: .byte 0x0 |
133 ; IASM-NEXT: .byte 0x0 | 599 ; IASM-NEXT: .byte 0x0 |
OLD | NEW |