[PATCH] D100767: [RISCV][test] Add a new test of addition

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 08:28:50 PDT 2021


benshi001 created this revision.
benshi001 added reviewers: craig.topper, MaskRay.
Herald added subscribers: vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb.
benshi001 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100767

Files:
  llvm/test/CodeGen/RISCV/add-imm.ll


Index: llvm/test/CodeGen/RISCV/add-imm.ll
===================================================================
--- llvm/test/CodeGen/RISCV/add-imm.ll
+++ llvm/test/CodeGen/RISCV/add-imm.ll
@@ -150,6 +150,23 @@
   ret i32 %1
 }
 
+define signext i32 @add32_sext_accept(i32 signext %a) nounwind {
+; RV32I-LABEL: add32_sext_accept:
+; RV32I:       # %bb.0:
+; RV32I-NEXT:    addi a0, a0, 1500
+; RV32I-NEXT:    addi a0, a0, 1499
+; RV32I-NEXT:    ret
+;
+; RV64I-LABEL: add32_sext_accept:
+; RV64I:       # %bb.0:
+; RV64I-NEXT:    lui a1, 1
+; RV64I-NEXT:    addiw a1, a1, -1097
+; RV64I-NEXT:    addw a0, a0, a1
+; RV64I-NEXT:    ret
+  %1 = add i32 %a, 2999
+  ret i32 %1
+}
+
 define i64 @add64_accept(i64 %a) nounwind {
 ; RV32I-LABEL: add64_accept:
 ; RV32I:       # %bb.0:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100767.338530.patch
Type: text/x-patch
Size: 777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210419/ee0e55d3/attachment.bin>


More information about the llvm-commits mailing list