[PATCH] D111526: [RISCV][test] Add more tests of immediate materialisation
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 11 01:30:51 PDT 2021
benshi001 created this revision.
benshi001 added reviewers: craig.topper, jrtc27, luismarques, asb.
Herald added subscribers: achieveartificialintelligence, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar.
benshi001 requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D111526
Files:
llvm/test/CodeGen/RISCV/imm.ll
Index: llvm/test/CodeGen/RISCV/imm.ll
===================================================================
--- llvm/test/CodeGen/RISCV/imm.ll
+++ llvm/test/CodeGen/RISCV/imm.ll
@@ -776,3 +776,38 @@
; RV64IB-NEXT: ret
ret i64 9223354442718100411 ; 0x7fffefff8bbbbbbb
}
+
+define i64 @imm_2863311530() {
+; RV32IB-LABEL: imm_2863311530:
+; RV32IB: # %bb.0:
+; RV32IB-NEXT: lui a0, 699051
+; RV32IB-NEXT: addi a0, a0, -1366
+; RV32IB-NEXT: mv a1, zero
+; RV32IB-NEXT: ret
+;
+; RV64IB-LABEL: imm_2863311530:
+; RV64IB: # %bb.0:
+; RV64IB-NEXT: lui a0, 699051
+; RV64IB-NEXT: addiw a0, a0, -1366
+; RV64IB-NEXT: zext.w a0, a0
+; RV64IB-NEXT: ret
+ ret i64 2863311530 ; #0xaaaaaaaa
+}
+
+define i64 @imm_neg_2863311530() {
+; RV32IB-LABEL: imm_neg_2863311530:
+; RV32IB: # %bb.0:
+; RV32IB-NEXT: lui a0, 349525
+; RV32IB-NEXT: addi a0, a0, 1366
+; RV32IB-NEXT: addi a1, zero, -1
+; RV32IB-NEXT: ret
+;
+; RV64IB-LABEL: imm_neg_2863311530:
+; RV64IB: # %bb.0:
+; RV64IB-NEXT: lui a0, 1048405
+; RV64IB-NEXT: addiw a0, a0, 1365
+; RV64IB-NEXT: slli a0, a0, 12
+; RV64IB-NEXT: addi a0, a0, 1366
+; RV64IB-NEXT: ret
+ ret i64 -2863311530 ; #0xffffffff55555556
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111526.378588.patch
Type: text/x-patch
Size: 1236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211011/0fd53bef/attachment.bin>
More information about the llvm-commits
mailing list