aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-riscv.c
diff options
context:
space:
mode:
authorNelson Chu <nelson.chu@sifive.com>2021-04-16 14:50:32 +0800
committerNelson Chu <nelson.chu@sifive.com>2021-04-16 17:03:29 +0800
commit768589d18042a55f0e1f77f466568a1c102ab099 (patch)
tree3dafb73e357fc2697e42b3d17d59dbb0a2308c19 /gas/config/tc-riscv.c
parenta21b96dd6661d30b6322a934bacc9c4faa248f29 (diff)
downloadgdb-768589d18042a55f0e1f77f466568a1c102ab099.zip
gdb-768589d18042a55f0e1f77f466568a1c102ab099.tar.gz
gdb-768589d18042a55f0e1f77f466568a1c102ab099.tar.bz2
RISC-V: PR27436, make operand C> work the same as >.
gas/ PR 27436 * config/tc-riscv.c (riscv_ip): make operand C> work the same as >. * testsuite/gas/riscv/shamt-32.d: New testcase. * testsuite/gas/riscv/shamt-32.l: Likewise. * testsuite/gas/riscv/shamt-32.s: Likewise. * testsuite/gas/riscv/shamt-64.d: Likewise. * testsuite/gas/riscv/shamt-64.l: Likewise. * testsuite/gas/riscv/shamt-64.s: Likewise.
Diffstat (limited to 'gas/config/tc-riscv.c')
-rw-r--r--gas/config/tc-riscv.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 2bce5e8..3fff33e 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -2088,11 +2088,10 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
|| regno != 0)
break;
continue;
- case '>':
+ case '>': /* Shift amount, 0 - (XLEN-1). */
if (my_getSmallExpression (imm_expr, imm_reloc, s, p)
|| imm_expr->X_op != O_constant
- || imm_expr->X_add_number <= 0
- || imm_expr->X_add_number >= 64)
+ || (unsigned long) imm_expr->X_add_number >= xlen)
break;
ip->insn_opcode |= ENCODE_CITYPE_IMM (imm_expr->X_add_number);
rvc_imm_done: