summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/config/tc-riscv.c10
-rw-r--r--opcodes/riscv-dis.c9
2 files changed, 19 insertions, 0 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 00e4635de6e..d9f63b11398 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -1279,6 +1279,9 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length)
switch (*++oparg)
{
+ case 'l': /* Literal. */
+ oparg += strcspn(oparg, ",") - 1;
+ break;
case 's': /* 'XsN@S' ... N-bit signed immediate at bit S. */
goto use_imm;
case 'u': /* 'XuN@S' ... N-bit unsigned immediate at bit S. */
@@ -3310,6 +3313,13 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
switch (*++oparg)
{
+ case 'l': /* Literal. */
+ n = strcspn (++oparg, ",");
+ if (strncmp (oparg, asarg, n))
+ as_bad (_("unexpected literal (%s)"), asarg);
+ oparg += n - 1;
+ asarg += n;
+ continue;
case 's': /* 'XsN@S' ... N-bit signed immediate at bit S. */
sign = true;
goto parse_imm;
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
index 2594e818254..f2d399260c1 100644
--- a/opcodes/riscv-dis.c
+++ b/opcodes/riscv-dis.c
@@ -570,6 +570,15 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info
switch (*++oparg)
{
+ case 'l': /* Literal. */
+ oparg++;
+ while (*oparg && *oparg != ',')
+ {
+ print (info->stream, dis_style_text, "%c", *oparg);
+ oparg++;
+ }
+ oparg--;
+ break;
case 's': /* 'XsN@S' ... N-bit signed immediate at bit S. */
sign = true;
goto print_imm;