summaryrefslogtreecommitdiff
path: root/gas/config/bfin-parse.y
diff options
context:
space:
mode:
authorJie Zhang <jie.zhang@analog.com>2008-08-26 10:03:24 +0000
committerJie Zhang <jie.zhang@analog.com>2008-08-26 10:03:24 +0000
commit6429b084782c31cb40056a47eead0b65796b4d1e (patch)
tree98fc78ced869a7ab472583b41a5db7017e7d1eb5 /gas/config/bfin-parse.y
parente584b8a1b7a384a194614e73f1243f8828588f9e (diff)
downloadbinutils-gdb-6429b084782c31cb40056a47eead0b65796b4d1e.tar.gz
* config/bfin-parse.y (check_macfunc_option): Fix instruction
mode checking. (asm_1): Check mode for 16-bit multiply instructions. testsuite/ * gas/bfin/arith_mode.d: New test. * gas/bfin/arith_mode.s: New test. * gas/bfin/invalid_arith_mode.l: New test. * gas/bfin/invalid_arith_mode.s: New test. * gas/bfin/bfin.exp: Add arith_mode and invalid_arith_mode.
Diffstat (limited to 'gas/config/bfin-parse.y')
-rw-r--r--gas/config/bfin-parse.y27
1 files changed, 15 insertions, 12 deletions
diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y
index 0110482705f..283b8130fc3 100644
--- a/gas/config/bfin-parse.y
+++ b/gas/config/bfin-parse.y
@@ -273,21 +273,15 @@ check_macfunc_option (Macfunc *a, Opt_mode *opt)
if (opt->mod == 0)
return 0;
- if ((a->op == 3 && a->w == 1 && a->P == 1
- && opt->mod != M_FU && opt->mod != M_S2RND && opt->mod != M_ISS2)
- || (a->op == 3 && a->w == 1 && a->P == 0
- && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_IU
- && opt->mod != M_T && opt->mod != M_S2RND && opt->mod != M_ISS2
- && opt->mod != M_IH)
- || (a->w == 0 && a->P == 0
- && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_W32)
- || (a->w == 1 && a->P == 1
- && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_S2RND
- && opt->mod != M_ISS2 && opt->mod != M_IU)
+ if ((a->w == 1 && a->P == 1
+ && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_IU
+ && opt->mod != M_S2RND && opt->mod != M_ISS2)
|| (a->w == 1 && a->P == 0
&& opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_IU
&& opt->mod != M_T && opt->mod != M_TFU && opt->mod != M_S2RND
- && opt->mod != M_ISS2 && opt->mod != M_IH))
+ && opt->mod != M_ISS2 && opt->mod != M_IH)
+ || (a->w == 0 && a->P == 0
+ && opt->mod != M_FU && opt->mod != M_IS && opt->mod != M_W32))
return -1;
return 0;
@@ -1756,6 +1750,11 @@ asm_1:
if (!IS_H ($1) && $4.MM)
return yyerror ("(M) not allowed with MAC0");
+ if ($4.mod != 0 && $4.mod != M_FU && $4.mod != M_IS
+ && $4.mod != M_IU && $4.mod != M_T && $4.mod != M_TFU
+ && $4.mod != M_S2RND && $4.mod != M_ISS2 && $4.mod != M_IH)
+ return yyerror ("bad option.");
+
if (IS_H ($1))
{
$$ = DSP32MULT (0, $4.MM, $4.mod, 1, 0,
@@ -1779,6 +1778,10 @@ asm_1:
if (IS_EVEN ($1) && $4.MM)
return yyerror ("(M) not allowed with MAC0");
+ if ($4.mod != 0 && $4.mod != M_FU && $4.mod != M_IS
+ && $4.mod != M_S2RND && $4.mod != M_ISS2)
+ return yyerror ("bad option");
+
if (!IS_EVEN ($1))
{
notethat ("dsp32mult: dregs = multiply_halfregs (opt_mode)\n");