[PATCH] D30162: [ARM] Add a div regression test for Cortex-M23
Sanne Wouda via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 20 04:16:49 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL295655: [ARM] Add a div regression test for Cortex-M23 (authored by sanwou01).
Changed prior to commit:
https://reviews.llvm.org/D30162?vs=89101&id=89104#toc
Repository:
rL LLVM
https://reviews.llvm.org/D30162
Files:
llvm/trunk/test/CodeGen/ARM/thumb1-div.ll
Index: llvm/trunk/test/CodeGen/ARM/thumb1-div.ll
===================================================================
--- llvm/trunk/test/CodeGen/ARM/thumb1-div.ll
+++ llvm/trunk/test/CodeGen/ARM/thumb1-div.ll
@@ -0,0 +1,67 @@
+; RUN: llc < %s -mtriple=arm-none-eabi -mcpu=cortex-m23 -march=thumb | \
+; RUN: FileCheck %s -check-prefix=CHECK
+
+define i32 @f1(i32 %a, i32 %b) {
+entry:
+; CHECK-LABEL: f1
+
+; CHECK: sdiv
+ %tmp1 = sdiv i32 %a, %b ; <i32> [#uses=1]
+ ret i32 %tmp1
+}
+
+define i32 @f2(i32 %a, i32 %b) {
+entry:
+; CHECK-LABEL: f2
+; CHECK: udiv
+ %tmp1 = udiv i32 %a, %b ; <i32> [#uses=1]
+ ret i32 %tmp1
+}
+
+define i32 @f3(i32 %a, i32 %b) {
+entry:
+; CHECK-LABEL: f3
+
+
+ %tmp1 = srem i32 %a, %b ; <i32> [#uses=1]
+ ret i32 %tmp1
+; CHECK: sdiv
+; CHECK-NEXT: muls
+; CHECK-NEXT: subs
+}
+
+define i32 @f4(i32 %a, i32 %b) {
+entry:
+; CHECK-LABEL: f4
+
+; CHECK: udiv
+; CHECK-NEXT: muls
+; CHECK-NEXT: subs
+ %tmp1 = urem i32 %a, %b ; <i32> [#uses=1]
+ ret i32 %tmp1
+}
+
+
+define i64 @f5(i64 %a, i64 %b) {
+entry:
+; CHECK-LABEL: f5
+
+; EABI MODE = Remainder in R2-R3, quotient in R0-R1
+; CHECK: __aeabi_ldivmod
+; CHECK-NEXT: mov r0, r2
+; CHECK-NEXT: mov r1, r3
+ %tmp1 = srem i64 %a, %b ; <i64> [#uses=1]
+ ret i64 %tmp1
+}
+
+define i64 @f6(i64 %a, i64 %b) {
+entry:
+; CHECK-LABEL: f6
+
+; EABI MODE = Remainder in R2-R3, quotient in R0-R1
+; CHECK: __aeabi_uldivmod
+; CHECK: mov r0, r2
+; CHECK: mov r1, r3
+ %tmp1 = urem i64 %a, %b ; <i64> [#uses=1]
+ ret i64 %tmp1
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30162.89104.patch
Type: text/x-patch
Size: 1640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170220/79193ab5/attachment.bin>
More information about the llvm-commits
mailing list