[llvm] 5b77e25 - [LoongArch] Pre-commit test for immediate value materialization using BSTRINS_D
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 30 01:37:23 PDT 2024
Author: wanglei
Date: 2024-08-30T16:37:20+08:00
New Revision: 5b77e254e814eb9a56d31c30a5c8289c07d8a6ff
URL: https://github.com/llvm/llvm-project/commit/5b77e254e814eb9a56d31c30a5c8289c07d8a6ff
DIFF: https://github.com/llvm/llvm-project/commit/5b77e254e814eb9a56d31c30a5c8289c07d8a6ff.diff
LOG: [LoongArch] Pre-commit test for immediate value materialization using BSTRINS_D
Reviewed By: SixWeining
Pull Request: https://github.com/llvm/llvm-project/pull/106331
Added:
Modified:
llvm/test/CodeGen/LoongArch/imm.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/LoongArch/imm.ll b/llvm/test/CodeGen/LoongArch/imm.ll
index f84fddaec66b9f..746306bacc8d57 100644
--- a/llvm/test/CodeGen/LoongArch/imm.ll
+++ b/llvm/test/CodeGen/LoongArch/imm.ll
@@ -164,3 +164,65 @@ define i64 @imm0008000080000800() {
; CHECK-NEXT: ret
ret i64 2251801961170944
}
+
+define i64 @imm14000000a() {
+; CHECK-LABEL: imm14000000a:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lu12i.w $a0, 262144
+; CHECK-NEXT: ori $a0, $a0, 10
+; CHECK-NEXT: lu32i.d $a0, 1
+; CHECK-NEXT: ret
+ ret i64 5368709130
+}
+
+define i64 @imm0fff000000000fff() {
+; CHECK-LABEL: imm0fff000000000fff:
+; CHECK: # %bb.0:
+; CHECK-NEXT: ori $a0, $zero, 4095
+; CHECK-NEXT: lu32i.d $a0, -65536
+; CHECK-NEXT: lu52i.d $a0, $a0, 255
+; CHECK-NEXT: ret
+ ret i64 1152640029630140415
+}
+
+define i64 @immffecffffffffffec() {
+; CHECK-LABEL: immffecffffffffffec:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addi.w $a0, $zero, -20
+; CHECK-NEXT: lu32i.d $a0, -196609
+; CHECK-NEXT: lu52i.d $a0, $a0, -2
+; CHECK-NEXT: ret
+ ret i64 -5348024557502484
+}
+
+define i64 @imm1c000000700000() {
+; CHECK-LABEL: imm1c000000700000:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lu12i.w $a0, 1792
+; CHECK-NEXT: lu32i.d $a0, -262144
+; CHECK-NEXT: lu52i.d $a0, $a0, 1
+; CHECK-NEXT: ret
+ ret i64 7881299355238400
+}
+
+define i64 @immf0f0f0f0f0f0f0f0() {
+; CHECK-LABEL: immf0f0f0f0f0f0f0f0:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lu12i.w $a0, -61681
+; CHECK-NEXT: ori $a0, $a0, 240
+; CHECK-NEXT: lu32i.d $a0, 61680
+; CHECK-NEXT: lu52i.d $a0, $a0, -241
+; CHECK-NEXT: ret
+ ret i64 -1085102592571150096
+}
+
+define i64 @imm110000014000000a() {
+; CHECK-LABEL: imm110000014000000a:
+; CHECK: # %bb.0:
+; CHECK-NEXT: lu12i.w $a0, 262144
+; CHECK-NEXT: ori $a0, $a0, 10
+; CHECK-NEXT: lu32i.d $a0, 1
+; CHECK-NEXT: lu52i.d $a0, $a0, 272
+; CHECK-NEXT: ret
+ ret i64 1224979104013484042
+}
More information about the llvm-commits
mailing list