1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[AArch64] Add testcase for codegen for sdiv by 2.

llvm-svn: 371147
This commit is contained in:
Eli Friedman 2019-09-05 23:40:03 +00:00
parent cbb2d62b19
commit d3e1b3e8b2

View File

@ -87,3 +87,22 @@ define i64 @test7(i64 %x) {
ret i64 %div
}
define i64 @test8(i64 %x) {
; ISEL-LABEL: test8:
; ISEL: // %bb.0:
; ISEL-NEXT: cmp x0, #0 // =0
; ISEL-NEXT: cinc x8, x0, lt
; ISEL-NEXT: asr x0, x8, #1
; ISEL-NEXT: ret
;
; FAST-LABEL: test8:
; FAST: // %bb.0:
; FAST-NEXT: add x8, x0, #1 // =1
; FAST-NEXT: cmp x0, #0 // =0
; FAST-NEXT: csel x8, x8, x0, lt
; FAST-NEXT: asr x0, x8, #1
; FAST-NEXT: ret
%div = sdiv i64 %x, 2
ret i64 %div
}