This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: Bug in ARM long long multiply patterns.


Hi Richard,

: > 	* config/arm/arm.md (mulsidi3adddi): Change output operand
: > 	constraint from "=&" to "=&".
: > 	(umulsidi3adddi): Change output operand	constraint from "=&" to
: > 	"=&".
: 
: No, I think the pattern should be rewritten to not have a match_dup.  
: Apart from anything else, the pattern isn't in SSA form as it stands.
: 
: Also, what is alternative 2 supposed to do?  It tries to tie the input 
: operand[2] to another input (operands[1])!  This is bogus.

: Hmm, there's even more wrong with this pattern :-(
: 
: It isn't legal to tie operand 2 to operand 0 either, since the modes are 
: different.

OK, I am going to have leave this to you to fix, since you are far
better at this than I am.

I have updated the testcase (200011-08-1.c) to include a test of the
unsigned multiple accumulate instruction as well.

Cheers
	Nick


2000-11-10  Nick Clifton  <nickc@redhat.com>

	* gcc.c-torture/execute/20001108-1.c: Add test of unsigned long
	long multiply and accumulate.

Index: gcc.c-torture/execute/20001108-1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/gcc.c-torture/execute/20001108-1.c,v
retrieving revision 1.1
diff -p -r1.1 20001108-1.c
*** 20001108-1.c	2000/11/09 01:26:21	1.1
--- 20001108-1.c	2000/11/10 19:24:31
***************
*** 1,14 ****
  long long
! poly (long long sum, long x)
  {
    sum += (long long) (long) sum * (long long) x;
    return sum;
  }
  
  int
  main (void)
  {
!   if (poly (2LL, 3) != 8LL)
      abort ();
  
    exit (0);
--- 1,24 ----
  long long
! signed_poly (long long sum, long x)
  {
    sum += (long long) (long) sum * (long long) x;
    return sum;
  }
  
+ unsigned long long
+ unsigned_poly (unsigned long long sum, unsigned long x)
+ {
+   sum += (unsigned long long) (unsigned long) sum * (unsigned long long) x;
+   return sum;
+ }
+ 
  int
  main (void)
  {
!   if (signed_poly (2LL, -3) != -4LL)
!     abort ();
!   
!   if (unsigned_poly (2ULL, 3) != 8ULL)
      abort ();
  
    exit (0);


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