* mips-opc.c: R3900s can support all branch likely INSN_MACROs where
[deliverable/binutils-gdb.git] / opcodes / cgen-ibld.in
index ca2f1e5fcc19d8d461b2361795f03a90ba9b35e7..213b8882d95c3abd2ecadf3c3be2b5417c5ba9fc 100644 (file)
@@ -145,7 +145,22 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
     }
 
   /* Ensure VALUE will fit.  */
-  if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
+  if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
+    {
+      long minval = - (1L << (length - 1));
+      unsigned long maxval = mask;
+      
+      if ((value > 0 && (unsigned long) value > maxval)
+         || value < minval)
+       {
+         /* xgettext:c-format */
+         sprintf (errbuf,
+                  _("operand out of range (%ld not between %ld and %lu)"),
+                  value, minval, maxval);
+         return errbuf;
+       }
+    }
+  else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
     {
       unsigned long maxval = mask;
       
@@ -400,7 +415,7 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
 #endif
      long *valuep;
 {
-  CGEN_INSN_INT value, mask;
+  long value, mask;
 
   /* If LENGTH is zero, this operand doesn't contribute to the value
      so give it a standard value of zero.  */
This page took 0.029343 seconds and 4 git commands to generate.