[PATCH] D124460: [RISCV] Add out of range immediate tests for shifts and rotates on rv64.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 26 10:55:36 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3a9ae9cf7c34: [RISCV] Add out of range immediate tests for shifts and rotates on rv64. (authored by craig.topper).
Changed prior to commit:
https://reviews.llvm.org/D124460?vs=425231&id=425267#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124460/new/
https://reviews.llvm.org/D124460
Files:
llvm/test/MC/RISCV/rv64i-invalid.s
llvm/test/MC/RISCV/rv64zbbp-invalid.s
Index: llvm/test/MC/RISCV/rv64zbbp-invalid.s
===================================================================
--- llvm/test/MC/RISCV/rv64zbbp-invalid.s
+++ llvm/test/MC/RISCV/rv64zbbp-invalid.s
@@ -9,6 +9,8 @@
# Immediate operand out of range
roriw t0, t1, 32 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 31]
roriw t0, t1, -1 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 31]
+rori t0, t1, 64 # CHECK: :[[@LINE]]:14: error: immediate must be an integer in the range [0, 63]
+rori t0, t1, -1 # CHECK: :[[@LINE]]:14: error: immediate must be an integer in the range [0, 63]
# Too few operands
packw t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
# Too few operands
Index: llvm/test/MC/RISCV/rv64i-invalid.s
===================================================================
--- llvm/test/MC/RISCV/rv64i-invalid.s
+++ llvm/test/MC/RISCV/rv64i-invalid.s
@@ -6,6 +6,11 @@
srliw a0, a0, -1 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 31]
sraiw a0, a0, -19 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 31]
+## uimm6
+slli a0, a0, 64 # CHECK: :[[@LINE]]:14: error: immediate must be an integer in the range [0, 63]
+srli a0, a0, -1 # CHECK: :[[@LINE]]:14: error: immediate must be an integer in the range [0, 63]
+srai a0, a0, -19 # CHECK: :[[@LINE]]:14: error: immediate must be an integer in the range [0, 63]
+
## simm12
addiw a0, a1, -2049 # CHECK: :[[@LINE]]:15: error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo modifier or an integer in the range [-2048, 2047]
ld ra, 2048(sp) # CHECK: :[[@LINE]]:8: error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo modifier or an integer in the range [-2048, 2047]
@@ -16,5 +21,10 @@
srliw a0, a0, %lo(a) # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 31]
sraiw a0, a0, %hi(2) # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 31]
+## uimm6
+slli a0, a0, %lo(1) # CHECK: :[[@LINE]]:14: error: immediate must be an integer in the range [0, 63]
+srli a0, a0, %lo(a) # CHECK: :[[@LINE]]:14: error: immediate must be an integer in the range [0, 63]
+srai a0, a0, %hi(2) # CHECK: :[[@LINE]]:14: error: immediate must be an integer in the range [0, 63]
+
## simm12
addiw a0, a1, %hi(foo) # CHECK: :[[@LINE]]:15: error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo modifier or an integer in the range [-2048, 2047]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124460.425267.patch
Type: text/x-patch
Size: 2504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220426/578827a7/attachment.bin>
More information about the llvm-commits
mailing list