From fc99ebdc2b470b31622d9efc28fca6f03945532c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 29 Mar 2011 05:54:41 +0000 Subject: [PATCH] gas: blackfin: gas: blackfin: reject invalid BYTEUNPACK insns The destination registers must be different with BYTEUNPACK 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 | 1 + gas/testsuite/gas/bfin/expected_errors.s | 1 + 5 files changed, 14 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 5ae246e5eca..7c5b7054bf8 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2011-03-29 Mike Frysinger + + * config/bfin-parse.y (BYTEUNPACK): Return yyerror when dest + reg $2 is the same as dest reg $4. + 2011-03-29 Mike Frysinger * config/bfin-parse.y (BYTEOP16M): Return yyerror when dest diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y index 7961e2e031f..797664a5015 100644 --- a/gas/config/bfin-parse.y +++ b/gas/config/bfin-parse.y @@ -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 diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 20aeb3fbb86..2101e9fc3da 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-29 Mike Frysinger + + * gas/bfin/expected_errors.s: Add invalid BYTEUNPACK insn tests. + * gas/bfin/expected_errors.l: Add new error messages. + 2011-03-29 Mike Frysinger * gas/bfin/expected_errors.s: Add invalid BYTEOP16M insn tests. diff --git a/gas/testsuite/gas/bfin/expected_errors.l b/gas/testsuite/gas/bfin/expected_errors.l index 1c12e65f10d..40a90437c9f 100644 --- a/gas/testsuite/gas/bfin/expected_errors.l +++ b/gas/testsuite/gas/bfin/expected_errors.l @@ -105,3 +105,4 @@ .*:134: Error: Illegal dest register combination. .*:135: Error: Illegal dest register combination. .*:136: Error: Illegal dest register combination. +.*:137: Error: Illegal dest register combination. diff --git a/gas/testsuite/gas/bfin/expected_errors.s b/gas/testsuite/gas/bfin/expected_errors.s index a671a2cd66a..6ff14a68b50 100644 --- a/gas/testsuite/gas/bfin/expected_errors.s +++ b/gas/testsuite/gas/bfin/expected_errors.s @@ -134,3 +134,4 @@ (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; -- 2.30.2