Replace xmalloc/xfree with vector in jit.c
[deliverable/binutils-gdb.git] / cpu / frv.opc
index 3dfadb3b9ba4e6085124ad2549e06d5f3fade3bc..1b0b05c29a061cb1d33076aed7e3893cc1179d6d 100644 (file)
@@ -78,9 +78,13 @@ int spr_valid           (long);
 /* -- */
 \f
 /* -- opc.c */
+#include "opintl.h"
 #include "elf/frv.h"
 #include <stdio.h>
 
+/* DEBUG appears below as argument of OP macro.  */
+#undef DEBUG
+
 /* Returns TRUE if {MAJOR,MACH} is a major branch of the FRV
    development tree.  */
 
@@ -497,9 +501,9 @@ add_next_to_vliw (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE unit)
 
   if (next <= 0)
     {
-      fprintf (stderr, "frv-opc.c line %d: bad vliw->next_slot value.\n",
-              __LINE__);
-      abort (); /* Should never happen.  */
+      /* xgettext:c-format */
+      opcodes_error_handler (_("internal error: bad vliw->next_slot value"));
+      abort ();
     }
 
   /* The table is sorted by units allowed within slots, so vliws with
@@ -807,8 +811,8 @@ fr500_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE ma
        &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_6)
        &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_7);
     default:
-      fprintf (stderr, "frv-opc.c, line %d: bad major code, aborting.\n",
-              __LINE__);
+      /* xgettext:c-format */
+      opcodes_error_handler (_("internal error: bad major code"));
       abort ();
       break;
     }
@@ -857,9 +861,9 @@ frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn)
   unit = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_UNIT);
   if (unit == UNIT_NIL)
     {
-      fprintf (stderr, "frv-opc.c line %d: bad insn unit.\n",
-              __LINE__);
-      abort (); /* No UNIT specified for this insn in frv.cpu.  */
+      /* xgettext:c-format */
+      opcodes_error_handler (_("internal error: bad insn unit"));
+      abort ();
     }
 
   switch (vliw->mach)
@@ -1340,11 +1344,11 @@ parse_uhi16 (CGEN_CPU_DESC cd,
          if (errmsg == NULL
              && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
            {
-             /* If bfd_vma is wider than 32 bits, but we have a sign-
-                or zero-extension, truncate it.  */
-             if (value >= - ((bfd_vma)1 << 31)
-                 || value <= ((bfd_vma)1 << 31) - (bfd_vma)1)
-               value &= (((bfd_vma)1 << 16) << 16) - 1;
+             /* If value is wider than 32 bits then be
+                careful about how we extract bits 16-31.  */
+             if (sizeof (value) > 4)
+               value &= (((bfd_vma)1 << 16) << 16) - 1;
+
              value >>= 16;
            }
          *valuep = value;
This page took 0.023324 seconds and 4 git commands to generate.