OSDN Git Service

gas: blackfin: gas: blackfin: reject invalid BYTEUNPACK insns
authorvapier <vapier>
Tue, 29 Mar 2011 05:54:39 +0000 (05:54 +0000)
committervapier <vapier>
Tue, 29 Mar 2011 05:54:39 +0000 (05:54 +0000)
The destination registers must be different with BYTEUNPACK insns,
otherwise the hardware throws up an exception.  So reject them.

Signed-off-by: Mike Frysinger <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 5ae246e..7c5b705 100644 (file)
@@ -1,5 +1,10 @@
 2011-03-29  Mike Frysinger  <vapier@gentoo.org>
 
+       * config/bfin-parse.y (BYTEUNPACK): Return yyerror when dest
+       reg $2 is the same as dest reg $4.
+
+2011-03-29  Mike Frysinger  <vapier@gentoo.org>
+
        * config/bfin-parse.y (BYTEOP16M): Return yyerror when dest
        reg $2 is the same as dest reg $4.
 
index 7961e2e..797664a 100644 (file)
@@ -866,6 +866,8 @@ asm_1:
        {
          if (!IS_DREG ($2) || !IS_DREG ($4))
            return yyerror ("Dregs expected");
+         else if (REG_SAME ($2, $4))
+           return yyerror ("Illegal dest register combination");
          else if (!valid_dreg_pair (&$8, $10))
            return yyerror ("Bad dreg pair");
          else
index 20aeb3f..2101e9f 100644 (file)
@@ -1,5 +1,10 @@
 2011-03-29  Mike Frysinger  <vapier@gentoo.org>
 
+       * gas/bfin/expected_errors.s: Add invalid BYTEUNPACK insn tests.
+       * gas/bfin/expected_errors.l: Add new error messages.
+
+2011-03-29  Mike Frysinger  <vapier@gentoo.org>
+
        * gas/bfin/expected_errors.s: Add invalid BYTEOP16M insn tests.
        * gas/bfin/expected_errors.l: Add new error messages.
 
index 1c12e65..40a9043 100644 (file)
 .*:134: Error: Illegal dest register combination.
 .*:135: Error: Illegal dest register combination.
 .*:136: Error: Illegal dest register combination.
+.*:137: Error: Illegal dest register combination.
index a671a2c..6ff14a6 100644 (file)
        (R7, R7) = BYTEOP16P (R1:0, R3:2);
        (R1, R1) = BYTEOP16M (R1:0, R3:2);
        (R4, R4) = BYTEOP16M (R1:0, R3:2);
+       (R5, R5) = BYTEUNPACK R3:2;