From: Mike Frysinger Date: Thu, 24 Mar 2011 04:20:10 +0000 (+0000) Subject: gas: blackfin: catch invalid register combinations with SEARCH/BITMUX X-Git-Tag: cgen-snapshot-20110401~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba48c47be52907e872d3aed50406986979e2358b;p=external%2Fbinutils.git gas: blackfin: catch invalid register combinations with SEARCH/BITMUX The destination registers for SEARCH cannot be the same. Same rule for the source registers for BITMUX. Signed-off-by: Mike Frsyinger --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 3112924..e283ac5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2011-03-23 Mike Frysinger + + * 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 * config/tc-avr.c (mcu_types): Add new xmega devices: atxmega64a1u, diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y index c43d1b3..fcc2ee8 100644 --- a/gas/config/bfin-parse.y +++ b/gas/config/bfin-parse.y @@ -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"); diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 352966d..3207362 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-23 Mike Frysinger + + * gas/bfin/expected_errors.s: Add invalid SEARCH/BITMUX insns. + * gas/bfin/expected_errors.l: Add expected errors. + 2011-03-18 Alan Modra * gas/elf/bad-size.err: Adjust expected error. diff --git a/gas/testsuite/gas/bfin/expected_errors.l b/gas/testsuite/gas/bfin/expected_errors.l index 25cb690..09bfd7f 100644 --- a/gas/testsuite/gas/bfin/expected_errors.l +++ b/gas/testsuite/gas/bfin/expected_errors.l @@ -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 \). diff --git a/gas/testsuite/gas/bfin/expected_errors.s b/gas/testsuite/gas/bfin/expected_errors.s index 812c2d9..0cea5ff 100644 --- a/gas/testsuite/gas/bfin/expected_errors.s +++ b/gas/testsuite/gas/bfin/expected_errors.s @@ -113,3 +113,6 @@ R2 = B [ R0 ++ ] (X); R2 = B [ I0 ++ ] (X); P2 = B [ P0 ++ ] (X); + + (R3, R3) = SEARCH R0 (GE); + BITMUX (R4, R4, A0) (ASR);