]> sourceware.org Git - cgen.git/commitdiff
[cgen]
authorDJ Delorie <dj@redhat.com>
Thu, 28 May 2009 22:53:08 +0000 (22:53 +0000)
committerDJ Delorie <dj@redhat.com>
Thu, 28 May 2009 22:53:08 +0000 (22:53 +0000)
* cpu/mep.opc (parse_signed16_range): New.
(parse_unsigned16_range): New.
* cpu/mep-ivc2.cpu (imm16p0, simm16p0): Use them.
[opcodes]
* mep-asm.c: Regenerate.
* mep-desc.c: Regenerate.

ChangeLog
cpu/mep-ivc2.cpu
cpu/mep.opc

index ff73243f842d8dac1b27c722b9343962d971e487..788b8269cd842e67b7d79743bc96e5ab49add552 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-28  DJ Delorie  <dj@redhat.com>
+
+       * cpu/mep.opc (parse_signed16_range): New.
+       (parse_unsigned16_range): New.
+       * cpu/mep-ivc2.cpu (imm16p0, simm16p0): Use them.
+
 2009-05-26  DJ Delorie  <dj@redhat.com>
 
        * cpu/mep-ivc2.cpu (h-ccr-ivc2): Enable for C3 slots, fix
index 20b5db77f8d5b2cf65e4d0e7f50585ecdc15ea25..6a9f9a43e87efdc99658389b67629243e92279b1 100644 (file)
 (dnop ivc-x-0-4 "filler" (all-mep-isas) h-uint f-ivc2-4u0)
 (dnop ivc-x-0-5 "filler" (all-mep-isas) h-uint f-ivc2-5u0)
 
-(dnop imm16p0 "Imm16p0" (all-mep-isas) h-uint f-ivc2-imm16p0)
-(dnop simm16p0 "sImm16p0" (all-mep-isas) h-sint f-ivc2-simm16p0)
+(dpop imm16p0 "Imm16p0" (all-mep-isas) h-uint f-ivc2-imm16p0 "unsigned16_range")
+(dpop simm16p0 "sImm16p0" (all-mep-isas) h-sint f-ivc2-simm16p0 "signed16_range")
 
 
 (df f-ivc2-ccrn-c3hi "ccrn hi  2u28" (all-mep-isas) 28 2 UINT #f #f)
index a2416dc5c9164b1cde55f0be0dbf07a0a5608b46..689e8d63c185b180656f19235ff6711c2c05956c 100644 (file)
@@ -88,7 +88,9 @@ extern int mep_cgen_insn_supported (CGEN_CPU_DESC, const CGEN_INSN *);
        const char * parse_mep_align  (CGEN_CPU_DESC, const char **, enum cgen_operand_type, long *);
        const char * parse_mep_alignu (CGEN_CPU_DESC, const char **, enum cgen_operand_type, unsigned long *);
 static const char * parse_signed16   (CGEN_CPU_DESC, const char **, int, long *);
+static const char * parse_signed16_range   (CGEN_CPU_DESC, const char **, int, long *);
 static const char * parse_unsigned16 (CGEN_CPU_DESC, const char **, int, unsigned long *);
+static const char * parse_unsigned16_range (CGEN_CPU_DESC, const char **, int, unsigned long *);
 static const char * parse_lo16       (CGEN_CPU_DESC, const char **, int, long *, long);
 static const char * parse_unsigned7  (CGEN_CPU_DESC, const char **, enum cgen_operand_type, unsigned long *);
 static const char * parse_zero       (CGEN_CPU_DESC, const char **, int, long *);
@@ -343,6 +345,46 @@ parse_unsigned16 (CGEN_CPU_DESC cd,
   return parse_lo16 (cd, strp, opindex, (long *) valuep, 0);
 }
 
+static const char *
+parse_signed16_range (CGEN_CPU_DESC cd,
+                     const char **strp,
+                     int opindex,
+                     signed long *valuep)
+{
+  const char *errmsg = 0;
+  signed long value;
+
+  errmsg = cgen_parse_signed_integer (cd, strp, opindex, & value);
+  if (errmsg)
+    return errmsg;
+
+  if (value < -32768 || value > 32767)
+    return _("Immediate is out of range -32768 to 32767");
+
+  *valuep = value;
+  return 0;
+}
+
+static const char *
+parse_unsigned16_range (CGEN_CPU_DESC cd,
+                       const char **strp,
+                       int opindex,
+                       unsigned long *valuep)
+{
+  const char *errmsg = 0;
+  unsigned long value;
+
+  errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, & value);
+  if (errmsg)
+    return errmsg;
+
+  if (value > 65535)
+    return _("Immediate is out of range 0 to 65535");
+
+  *valuep = value;
+  return 0;
+}
+
 /* A special case of parse_signed16 which accepts only the value zero.  */
 
 static const char *
This page took 0.040781 seconds and 5 git commands to generate.