OLD | NEW |
1 ; This tries to be a comprehensive test of i64 operations, in | 1 ; This tries to be a comprehensive test of i64 operations, in |
2 ; particular the patterns for lowering i64 operations into constituent | 2 ; particular the patterns for lowering i64 operations into constituent |
3 ; i32 operations on x86-32. | 3 ; i32 operations on x86-32. |
4 | 4 |
5 ; TODO(jvoung): fix extra "CALLTARGETS" run. The llvm-objdump symbolizer | 5 ; TODO(jvoung): fix extra "CALLTARGETS" run. The llvm-objdump symbolizer |
6 ; doesn't know how to symbolize non-section-local functions. | 6 ; doesn't know how to symbolize non-section-local functions. |
7 ; The newer LLVM 3.6 one does work, but watch out for other bugs. | 7 ; The newer LLVM 3.6 one does work, but watch out for other bugs. |
8 | 8 |
9 ; RUN: %p2i -i %s --args -O2 --verbose none \ | 9 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
10 ; RUN: | FileCheck --check-prefix=CALLTARGETS %s | 10 ; RUN: | FileCheck --check-prefix=CALLTARGETS %s |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 ; CHECK: shl e | 310 ; CHECK: shl e |
311 ; CHECK: test {{.*}}, 32 | 311 ; CHECK: test {{.*}}, 32 |
312 ; CHECK: je | 312 ; CHECK: je |
313 ; | 313 ; |
314 ; OPTM1-LABEL: shl64BitSigned | 314 ; OPTM1-LABEL: shl64BitSigned |
315 ; OPTM1: shld | 315 ; OPTM1: shld |
316 ; OPTM1: shl e | 316 ; OPTM1: shl e |
317 ; OPTM1: test {{.*}}, 32 | 317 ; OPTM1: test {{.*}}, 32 |
318 ; OPTM1: je | 318 ; OPTM1: je |
319 | 319 |
| 320 define internal i32 @shl64BitSignedTrunc(i64 %a, i64 %b) { |
| 321 entry: |
| 322 %shl = shl i64 %a, %b |
| 323 %result = trunc i64 %shl to i32 |
| 324 ret i32 %result |
| 325 } |
| 326 ; CHECK-LABEL: shl64BitSignedTrunc |
| 327 ; CHECK: mov |
| 328 ; CHECK: shl e |
| 329 ; CHECK: test {{.*}}, 32 |
| 330 ; CHECK: je |
| 331 ; |
| 332 ; OPTM1-LABEL: shl64BitSignedTrunc |
| 333 ; OPTM1: shld |
| 334 ; OPTM1: shl e |
| 335 ; OPTM1: test {{.*}}, 32 |
| 336 ; OPTM1: je |
| 337 |
320 define internal i64 @shl64BitUnsigned(i64 %a, i64 %b) { | 338 define internal i64 @shl64BitUnsigned(i64 %a, i64 %b) { |
321 entry: | 339 entry: |
322 %shl = shl i64 %a, %b | 340 %shl = shl i64 %a, %b |
323 ret i64 %shl | 341 ret i64 %shl |
324 } | 342 } |
325 ; CHECK-LABEL: shl64BitUnsigned | 343 ; CHECK-LABEL: shl64BitUnsigned |
326 ; CHECK: shld | 344 ; CHECK: shld |
327 ; CHECK: shl e | 345 ; CHECK: shl e |
328 ; CHECK: test {{.*}}, 32 | 346 ; CHECK: test {{.*}}, 32 |
329 ; CHECK: je | 347 ; CHECK: je |
(...skipping 16 matching lines...) Expand all Loading... |
346 ; CHECK: je | 364 ; CHECK: je |
347 ; CHECK: sar {{.*}}, 31 | 365 ; CHECK: sar {{.*}}, 31 |
348 ; | 366 ; |
349 ; OPTM1-LABEL: shr64BitSigned | 367 ; OPTM1-LABEL: shr64BitSigned |
350 ; OPTM1: shrd | 368 ; OPTM1: shrd |
351 ; OPTM1: sar | 369 ; OPTM1: sar |
352 ; OPTM1: test {{.*}}, 32 | 370 ; OPTM1: test {{.*}}, 32 |
353 ; OPTM1: je | 371 ; OPTM1: je |
354 ; OPTM1: sar {{.*}}, 31 | 372 ; OPTM1: sar {{.*}}, 31 |
355 | 373 |
| 374 define internal i32 @shr64BitSignedTrunc(i64 %a, i64 %b) { |
| 375 entry: |
| 376 %shr = ashr i64 %a, %b |
| 377 %result = trunc i64 %shr to i32 |
| 378 ret i32 %result |
| 379 } |
| 380 ; CHECK-LABEL: shr64BitSignedTrunc |
| 381 ; CHECK: shrd |
| 382 ; CHECK: sar |
| 383 ; CHECK: test {{.*}}, 32 |
| 384 ; CHECK: je |
| 385 ; |
| 386 ; OPTM1-LABEL: shr64BitSignedTrunc |
| 387 ; OPTM1: shrd |
| 388 ; OPTM1: sar |
| 389 ; OPTM1: test {{.*}}, 32 |
| 390 ; OPTM1: je |
| 391 ; OPTM1: sar {{.*}}, 31 |
| 392 |
356 define internal i64 @shr64BitUnsigned(i64 %a, i64 %b) { | 393 define internal i64 @shr64BitUnsigned(i64 %a, i64 %b) { |
357 entry: | 394 entry: |
358 %shr = lshr i64 %a, %b | 395 %shr = lshr i64 %a, %b |
359 ret i64 %shr | 396 ret i64 %shr |
360 } | 397 } |
361 ; CHECK-LABEL: shr64BitUnsigned | 398 ; CHECK-LABEL: shr64BitUnsigned |
362 ; CHECK: shrd | 399 ; CHECK: shrd |
363 ; CHECK: shr | 400 ; CHECK: shr |
364 ; CHECK: test {{.*}}, 32 | 401 ; CHECK: test {{.*}}, 32 |
365 ; CHECK: je | 402 ; CHECK: je |
366 ; | 403 ; |
367 ; OPTM1-LABEL: shr64BitUnsigned | 404 ; OPTM1-LABEL: shr64BitUnsigned |
368 ; OPTM1: shrd | 405 ; OPTM1: shrd |
369 ; OPTM1: shr | 406 ; OPTM1: shr |
370 ; OPTM1: test {{.*}}, 32 | 407 ; OPTM1: test {{.*}}, 32 |
371 ; OPTM1: je | 408 ; OPTM1: je |
372 | 409 |
| 410 define internal i32 @shr64BitUnsignedTrunc(i64 %a, i64 %b) { |
| 411 entry: |
| 412 %shr = lshr i64 %a, %b |
| 413 %result = trunc i64 %shr to i32 |
| 414 ret i32 %result |
| 415 } |
| 416 ; CHECK-LABEL: shr64BitUnsignedTrunc |
| 417 ; CHECK: shrd |
| 418 ; CHECK: shr |
| 419 ; CHECK: test {{.*}}, 32 |
| 420 ; CHECK: je |
| 421 ; |
| 422 ; OPTM1-LABEL: shr64BitUnsignedTrunc |
| 423 ; OPTM1: shrd |
| 424 ; OPTM1: shr |
| 425 ; OPTM1: test {{.*}}, 32 |
| 426 ; OPTM1: je |
| 427 |
373 define internal i64 @and64BitSigned(i64 %a, i64 %b) { | 428 define internal i64 @and64BitSigned(i64 %a, i64 %b) { |
374 entry: | 429 entry: |
375 %and = and i64 %b, %a | 430 %and = and i64 %b, %a |
376 ret i64 %and | 431 ret i64 %and |
377 } | 432 } |
378 ; CHECK-LABEL: and64BitSigned | 433 ; CHECK-LABEL: and64BitSigned |
379 ; CHECK: and | 434 ; CHECK: and |
380 ; CHECK: and | 435 ; CHECK: and |
381 ; | 436 ; |
382 ; OPTM1-LABEL: and64BitSigned | 437 ; OPTM1-LABEL: and64BitSigned |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 ret void | 1322 ret void |
1268 } | 1323 } |
1269 ; The following checks are not strictly necessary since one of the RUN | 1324 ; The following checks are not strictly necessary since one of the RUN |
1270 ; lines actually runs the output through the assembler. | 1325 ; lines actually runs the output through the assembler. |
1271 ; CHECK-LABEL: icmpLt64Imm | 1326 ; CHECK-LABEL: icmpLt64Imm |
1272 ; CHECK-NOT: cmp {{[0-9]+}}, | 1327 ; CHECK-NOT: cmp {{[0-9]+}}, |
1273 ; OPTM1-LABEL: icmpLt64Imm | 1328 ; OPTM1-LABEL: icmpLt64Imm |
1274 ; OPTM1-NOT: cmp {{[0-9]+}}, | 1329 ; OPTM1-NOT: cmp {{[0-9]+}}, |
1275 | 1330 |
1276 ; ERRORS-NOT: ICE translation error | 1331 ; ERRORS-NOT: ICE translation error |
OLD | NEW |