x86-64: bndmk, bndldx, and bndstx don't allow RIP-relative addressing
[binutils-gdb.git] / opcodes / riscv-dis.c
index cc642d4ad3045ac7920f3898647b9d0da1040564..890f1f8e697c06a51c12115160414c6ca8fab3d0 100644 (file)
@@ -64,8 +64,8 @@ parse_riscv_dis_option (const char *option)
     }
   else
     {
-      /* Invalid option.  */
-      fprintf (stderr, _("Unrecognized disassembler option: %s\n"), option);
+      /* xgettext:c-format */
+      opcodes_error_handler (_("unrecognized disassembler option: %s"), option);
     }
 }
 
@@ -430,7 +430,7 @@ riscv_disassemble_insn (bfd_vma memaddr, insn_t word, disassemble_info *info)
          if (no_aliases && (op->pinfo & INSN_ALIAS))
            continue;
          /* Is this instruction restricted to a certain value of XLEN?  */
-         if (isdigit (op->subset[0]) && atoi (op->subset) != xlen)
+         if ((op->xlen_requirement != 0) && (op->xlen_requirement != xlen))
            continue;
 
          /* It's a match.  */
@@ -446,6 +446,32 @@ riscv_disassemble_insn (bfd_vma memaddr, insn_t word, disassemble_info *info)
              pd->print_addr = -1;
            }
 
+         /* Finish filling out insn_info fields.  */
+         switch (op->pinfo & INSN_TYPE)
+           {
+           case INSN_BRANCH:
+             info->insn_type = dis_branch;
+             break;
+           case INSN_CONDBRANCH:
+             info->insn_type = dis_condbranch;
+             break;
+           case INSN_JSR:
+             info->insn_type = dis_jsr;
+             break;
+           case INSN_DREF:
+             info->insn_type = dis_dref;
+             break;
+           default:
+             break;
+           }
+
+         if (op->pinfo & INSN_DATA_SIZE)
+           {
+             int size = ((op->pinfo & INSN_DATA_SIZE)
+                         >> INSN_DATA_SIZE_SHIFT);
+             info->data_size = 1 << (size - 1);
+           }
+
          return insnlen;
        }
     }