This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Do better check for vector multiply-accumulate instruction in bfin gas


Previously bfin gas would accept this invalid instruction without any error:

R1.H = (A1=R7.L*R5.L) , A0 += R1.L*R0.L (IS);

When assembly and objdump, we get:

0: 04 c1 7d 08 R1.H = (a1 = R7.L * R5.L), a0 += R7.L * R5.L (IS);

Blackfin allows the two operations in vector multiply-accumulate
instruction to be different type, i.e. anyone of "A =", "A +=", or "A
-=". This patch will loose the condition to check all the combinations
of the two operations.

Committed.

Jie
 
	* config/bfin-parse.y (check_macfunc): Loose the condition of
	calling check_multiply_halfregs ().

 Index: config/bfin-parse.y
===================================================================
RCS file: /cvsroot/gcc3/binutils/binutils-2.15/gas/config/bfin-parse.y,v
retrieving revision 1.39
diff -u -p -r1.39 bfin-parse.y
--- config/bfin-parse.y	25 May 2006 03:50:59 -0000	1.39
+++ config/bfin-parse.y	28 May 2006 00:41:15 -0000
@@ -309,9 +309,10 @@ check_macfuncs (Macfunc *aa, Opt_mode *o
 	return yyerror ("Vector AxMACs can't be same");
     }
 
-  /*  If both ops are != 3, we have multiply_halfregs in both
+  /*  If both ops are one of 0, 1, or 2, we have multiply_halfregs in both
   assignment_or_macfuncs.  */
-  if (aa->op == ab->op && aa->op != 3)
+  if (aa->op < 3 && aa->op >=0
+      && ab->op < 3 && ab->op >= 0)
     {
       if (check_multiply_halfregs (aa, ab) < 0)
 	return -1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]