[llvm] ee68b66 - [NFC][PowerPC] Add tests for `mul` with big constants.
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 02:46:21 PDT 2020
Author: Esme-Yi
Date: 2020-09-07T09:45:47Z
New Revision: ee68b66d94b50d8c9ff14d3217a77c66b0e2c32f
URL: https://github.com/llvm/llvm-project/commit/ee68b66d94b50d8c9ff14d3217a77c66b0e2c32f
DIFF: https://github.com/llvm/llvm-project/commit/ee68b66d94b50d8c9ff14d3217a77c66b0e2c32f.diff
LOG: [NFC][PowerPC] Add tests for `mul` with big constants.
Added:
llvm/test/CodeGen/PowerPC/mulli.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/PowerPC/mulli.ll b/llvm/test/CodeGen/PowerPC/mulli.ll
new file mode 100644
index 000000000000..3e417f9720a8
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/mulli.ll
@@ -0,0 +1,70 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --extra_scrub
+; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
+
+define i64 @test1(i64 %x) {
+; CHECK-LABEL: test1:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li 4, 625
+; CHECK-NEXT: sldi 4, 4, 36
+; CHECK-NEXT: mulld 3, 3, 4
+; CHECK-NEXT: blr
+ %y = mul i64 %x, 42949672960000
+ ret i64 %y
+}
+
+define i64 @test2(i64 %x) {
+; CHECK-LABEL: test2:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li 4, -625
+; CHECK-NEXT: sldi 4, 4, 36
+; CHECK-NEXT: mulld 3, 3, 4
+; CHECK-NEXT: blr
+ %y = mul i64 %x, -42949672960000
+ ret i64 %y
+}
+
+define i64 @test3(i64 %x) {
+; CHECK-LABEL: test3:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lis 4, 74
+; CHECK-NEXT: ori 4, 4, 16384
+; CHECK-NEXT: mulld 3, 3, 4
+; CHECK-NEXT: blr
+ %y = mul i64 %x, 4866048
+ ret i64 %y
+}
+
+define i64 @test4(i64 %x) {
+; CHECK-LABEL: test4:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lis 4, -75
+; CHECK-NEXT: ori 4, 4, 49152
+; CHECK-NEXT: mulld 3, 3, 4
+; CHECK-NEXT: blr
+ %y = mul i64 %x, -4866048
+ ret i64 %y
+}
+
+define i64 @test5(i64 %x) {
+; CHECK-LABEL: test5:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lis 4, 16
+; CHECK-NEXT: ori 4, 4, 1
+; CHECK-NEXT: sldi 4, 4, 12
+; CHECK-NEXT: mulld 3, 3, 4
+; CHECK-NEXT: blr
+ %y = mul i64 %x, 4294971392
+ ret i64 %y
+}
+
+define i64 @test6(i64 %x) {
+; CHECK-LABEL: test6:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lis 4, -17
+; CHECK-NEXT: ori 4, 4, 65535
+; CHECK-NEXT: sldi 4, 4, 12
+; CHECK-NEXT: mulld 3, 3, 4
+; CHECK-NEXT: blr
+ %y = mul i64 %x, -4294971392
+ ret i64 %y
+}
More information about the llvm-commits
mailing list