From d12e3a27325345a0d9fb77273751e861d8ec6a8c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 29 Mar 2011 05:51:20 +0000 Subject: [PATCH] gas: blackfin: gas: blackfin: reject invalid BYTEOP16M insns The destination registers must be different with BYTEOP16M insns, otherwise the hardware throws up an exception. So reject them. Signed-off-by: Mike Frysinger --- gas/ChangeLog | 5 +++++ gas/config/bfin-parse.y | 2 ++ gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/bfin/expected_errors.l | 2 ++ gas/testsuite/gas/bfin/expected_errors.s | 2 ++ 5 files changed, 16 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 428d26663..5ae246e5e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2011-03-29 Mike Frysinger + * config/bfin-parse.y (BYTEOP16M): Return yyerror when dest + reg $2 is the same as dest reg $4. + +2011-03-29 Mike Frysinger + * config/bfin-parse.y (BYTEOP16P): Return yyerror when dest reg $2 is the same as dest reg $4. diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y index 12e752584..7961e2e03 100644 --- a/gas/config/bfin-parse.y +++ b/gas/config/bfin-parse.y @@ -849,6 +849,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 (&$9, $11)) return yyerror ("Bad dreg pair"); else if (!valid_dreg_pair (&$13, $15)) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 24726279b..20aeb3fbb 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2011-03-29 Mike Frysinger + * gas/bfin/expected_errors.s: Add invalid BYTEOP16M insn tests. + * gas/bfin/expected_errors.l: Add new error messages. + +2011-03-29 Mike Frysinger + * gas/bfin/expected_errors.s: Add invalid BYTEOP16P insn tests. * gas/bfin/expected_errors.l: Add new error messages. diff --git a/gas/testsuite/gas/bfin/expected_errors.l b/gas/testsuite/gas/bfin/expected_errors.l index 216c8e141..1c12e65f1 100644 --- a/gas/testsuite/gas/bfin/expected_errors.l +++ b/gas/testsuite/gas/bfin/expected_errors.l @@ -103,3 +103,5 @@ .*:131: Error: Illegal dest register combination. Input text was A0.H. .*:133: Error: Illegal dest register combination. .*:134: Error: Illegal dest register combination. +.*:135: Error: Illegal dest register combination. +.*:136: Error: Illegal dest register combination. diff --git a/gas/testsuite/gas/bfin/expected_errors.s b/gas/testsuite/gas/bfin/expected_errors.s index 677103c9e..a671a2cd6 100644 --- a/gas/testsuite/gas/bfin/expected_errors.s +++ b/gas/testsuite/gas/bfin/expected_errors.s @@ -132,3 +132,5 @@ (R0, R0) = BYTEOP16P (R1:0, R3:2); (R7, R7) = BYTEOP16P (R1:0, R3:2); + (R1, R1) = BYTEOP16M (R1:0, R3:2); + (R4, R4) = BYTEOP16M (R1:0, R3:2); -- 2.11.4.GIT