summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Lanai/shift.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/Lanai/shift.ll')
-rw-r--r--llvm/test/CodeGen/Lanai/shift.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Lanai/shift.ll b/llvm/test/CodeGen/Lanai/shift.ll
new file mode 100644
index 00000000000..df5f91122ed
--- /dev/null
+++ b/llvm/test/CodeGen/Lanai/shift.ll
@@ -0,0 +1,28 @@
+; RUN: llc < %s -march=lanai | FileCheck %s
+
+; Test lowering of shifts.
+
+define i32 @irs(i32 inreg %a) #0 {
+entry:
+ %shr = ashr i32 %a, 13
+ ret i32 %shr
+}
+; CHECK-LABEL: irs
+; CHECK: sha %r6, -0xd, %rv
+
+define i32 @urs(i32 inreg %a) #0 {
+entry:
+ %shr = lshr i32 %a, 13
+ ret i32 %shr
+}
+; CHECK-LABEL: urs
+; CHECK: sh %r6, -0xd, %rv
+
+define i32 @ls(i32 inreg %a) #0 {
+entry:
+ %shl = shl i32 %a, 13
+ ret i32 %shl
+}
+; CHECK-LABEL: ls
+; CHECK: sh %r6, 0xd, %rv
+
OpenPOWER on IntegriCloud