summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2019-09-05 23:40:03 +0000
committerEli Friedman <efriedma@quicinc.com>2019-09-05 23:40:03 +0000
commit9dd453ce8d6b0d0970ed11a93d5180f74f620078 (patch)
tree3216499d1cbf11810a2abb88554b72018a8322a3 /llvm/test/CodeGen
parent524a9d5774ff448ae9c05f0483cf449918d8c8d7 (diff)
downloadbcm5719-llvm-9dd453ce8d6b0d0970ed11a93d5180f74f620078.tar.gz
bcm5719-llvm-9dd453ce8d6b0d0970ed11a93d5180f74f620078.zip
[AArch64] Add testcase for codegen for sdiv by 2.
llvm-svn: 371147
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/AArch64/sdivpow2.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/sdivpow2.ll b/llvm/test/CodeGen/AArch64/sdivpow2.ll
index 158a778f0e9..25e89176ad0 100644
--- a/llvm/test/CodeGen/AArch64/sdivpow2.ll
+++ b/llvm/test/CodeGen/AArch64/sdivpow2.ll
@@ -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
+}
+
OpenPOWER on IntegriCloud