gas: blackfin: catch invalid register combinations with SEARCH/BITMUX
authorMike Frysinger <vapier@gentoo.org>
Thu, 24 Mar 2011 04:20:10 +0000 (04:20 +0000)
committerMike Frysinger <vapier@gentoo.org>
Thu, 24 Mar 2011 04:20:10 +0000 (04:20 +0000)
The destination registers for SEARCH cannot be the same.  Same rule
for the source registers for BITMUX.

Signed-off-by: Mike Frsyinger <vapier@gentoo.org>
gas/ChangeLog
gas/config/bfin-parse.y
gas/testsuite/ChangeLog
gas/testsuite/gas/bfin/expected_errors.l
gas/testsuite/gas/bfin/expected_errors.s

index 3112924c850c7698a28eb96da201e2b5eaea457f..e283ac511c20afcccea8e95b0ddddb287907dc25 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * config/bfin-parse.y (SEARCH): Return yyerror when dest reg $2 is
+       the same as dest reg $4.
+       (BITMUX): Return yyerror when dest reg $3 is the same as dest reg $5.
+
 2011-03-23  Eric B. Weddington  <eric.weddington@atmel.com>
 
        * config/tc-avr.c (mcu_types): Add new xmega devices: atxmega64a1u,
index c43d1b35d12e1726817e7614f9cdd05d9e30c1b8..fcc2ee8b0f8fe43033ae9cbc7fce5d089e9d9605 100644 (file)
@@ -868,6 +868,9 @@ asm_1:
        }
        | LPAREN REG COMMA REG RPAREN ASSIGN SEARCH REG LPAREN searchmod RPAREN
        {
+         if (REG_SAME ($2, $4))
+           return yyerror ("Illegal dest register combination");
+
          if (IS_DREG ($2) && IS_DREG ($4) && IS_DREG ($8))
            {
              notethat ("dsp32alu: (dregs , dregs ) = SEARCH dregs (searchmod)\n");
@@ -2388,6 +2391,9 @@ asm_1:
 
        | BITMUX LPAREN REG COMMA REG COMMA REG_A RPAREN asr_asl
        {
+         if (REG_SAME ($3, $5))
+           return yyerror ("Illegal source register combination");
+
          if (IS_DREG ($3) && IS_DREG ($5) && !IS_A1 ($7))
            {
              notethat ("dsp32shift: BITMUX (dregs , dregs , A0) (ASR)\n");
index 352966dc1857cdc67d98f57e39cbf8392e221133..32073628d02524984f06927340d106da4fb992cf 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * gas/bfin/expected_errors.s: Add invalid SEARCH/BITMUX insns.
+       * gas/bfin/expected_errors.l: Add expected errors.
+
 2011-03-18  Alan Modra  <amodra@gmail.com>
 
        * gas/elf/bad-size.err: Adjust expected error.
index 25cb69054295007dd6eb571186159d36ad8bad2e..09bfd7fd683c0a4eadb70798c69f08d6221e2879 100644 (file)
@@ -90,3 +90,5 @@
 .*:113: Error: Preg expected in address. Input text was \).
 .*:114: Error: Preg expected in address. Input text was \).
 .*:115: Error: Dreg expected for destination operand. Input text was \).
+.*:117: Error: Illegal dest register combination. Input text was \).
+.*:118: Error: Illegal source register combination. Input text was \).
index 812c2d9b5aeb77fa281b3185c79a8929bf294119..0cea5ffe404962e65ecee121c309bb2b96fdc917 100644 (file)
        R2 = B [ R0 ++ ] (X);
        R2 = B [ I0 ++ ] (X);
        P2 = B [ P0 ++ ] (X);
+
+       (R3, R3) = SEARCH R0 (GE);
+       BITMUX (R4, R4, A0) (ASR);
This page took 0.028532 seconds and 4 git commands to generate.