public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: RFA: integer subregs of float vectors / Re: c/7225: ice on generic vectors (floats)
@ 2002-07-11 14:06 Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2002-07-11 14:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7225; it has been noted by GNATS.
From: Richard Henderson <rth@redhat.com>
To: Joern Rennecke <joern.rennecke@superh.com>
Cc: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, pinskia@physics.uc.edu,
gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: RFA: integer subregs of float vectors / Re: c/7225: ice on generic vectors (floats)
Date: Thu, 11 Jul 2002 13:59:32 -0700
On Thu, Jul 11, 2002 at 03:59:31PM +0100, Joern Rennecke wrote:
> * simplify-rtx.c (simplify_subreg): Handle floating point
> CONST_DOUBLEs. When an integer subreg of a smaller mode than
> the element mode is requested, compute a subreg with an
> integer mode of the same size as the element mode first.
> gcc.c-torture/compile/simd-2.c: New testcase.
> gcc.c-torture/compile/simd-3.c: Likewise.
Ok.
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
* RFA: integer subregs of float vectors / Re: c/7225: ice on generic vectors (floats)
@ 2002-07-11 8:06 Joern Rennecke
0 siblings, 0 replies; 2+ messages in thread
From: Joern Rennecke @ 2002-07-11 8:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7225; it has been noted by GNATS.
From: Joern Rennecke <joern.rennecke@superh.com>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, pinskia@physics.uc.edu,
gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-patches@gcc.gnu.org
Cc:
Subject: RFA: integer subregs of float vectors / Re: c/7225: ice on generic
vectors (floats)
Date: Thu, 11 Jul 2002 15:59:31 +0100
This is a multi-part message in MIME format.
--------------6B10FD973BDC80FBAEB516C0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7225
Regression tested on i686-linux-gnu. The new testcases also succeed.
--
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330
--------------6B10FD973BDC80FBAEB516C0
Content-Type: text/plain; charset=us-ascii;
name="simd-fix-10"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="simd-fix-10"
The second hunk is not covered by the original testcase, therefore
I made a variant that uses double instead of float.
We still don't conver integer CONST_DOUBLES, but I think we should
have a testcase first to see that we get this right.
gcc:
Thu Jul 11 15:39:21 2002 J"orn Rennecke <joern.rennecke@superh.com>
* simplify-rtx.c (simplify_subreg): Handle floating point
CONST_DOUBLEs. When an integer subreg of a smaller mode than
the element mode is requested, compute a subreg with an
integer mode of the same size as the element mode first.
testsuite:
Thu Jul 11 15:39:21 2002 J"orn Rennecke <joern.rennecke@superh.com>
Andrew Pinski <pinskia@physics.uc.edu>
gcc.c-torture/compile/simd-2.c: New testcase.
gcc.c-torture/compile/simd-3.c: Likewise.
Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.109
diff -p -r1.109 simplify-rtx.c
*** simplify-rtx.c 4 Jul 2002 06:38:54 -0000 1.109
--- simplify-rtx.c 11 Jul 2002 14:35:17 -0000
*************** simplify_subreg (outermode, op, innermod
*** 2307,2312 ****
--- 2307,2320 ----
for (; n_elts--; i += step)
{
elt = CONST_VECTOR_ELT (op, i);
+ if (GET_CODE (elt) == CONST_DOUBLE
+ && GET_MODE_CLASS (GET_MODE (elt)) == MODE_FLOAT)
+ {
+ elt = gen_lowpart_common (int_mode_for_mode (GET_MODE (elt)),
+ elt);
+ if (! elt)
+ return NULL_RTX;
+ }
if (GET_CODE (elt) != CONST_INT)
return NULL_RTX;
high = high << shift | sum >> (HOST_BITS_PER_WIDE_INT - shift);
*************** simplify_subreg (outermode, op, innermod
*** 2319,2324 ****
--- 2327,2344 ----
else
return NULL_RTX;
}
+ else if (GET_MODE_CLASS (outermode) == MODE_INT
+ && (elt_size % GET_MODE_SIZE (outermode) == 0))
+ {
+ enum machine_mode new_mode
+ = int_mode_for_mode (GET_MODE_INNER (innermode));
+ int subbyte = byte % elt_size;
+
+ op = simplify_subreg (new_mode, op, innermode, byte - subbyte);
+ if (! op)
+ return NULL_RTX;
+ return simplify_subreg (outermode, op, new_mode, subbyte);
+ }
else if (GET_MODE_CLASS (outermode) != MODE_VECTOR_INT
&& GET_MODE_CLASS (outermode) != MODE_VECTOR_FLOAT)
/* This shouldn't happen, but let's not do anything stupid. */
*** /dev/null Thu Aug 30 21:30:55 2001
--- testsuite/gcc.c-torture/compile/simd-2.c Thu Jul 11 15:38:21 2002
***************
*** 0 ****
--- 1,17 ----
+ typedef float floatvect2 __attribute__((mode(V2SF)));
+
+ typedef union
+ {
+ floatvect2 vector;
+ float f[2];
+ }resfloatvect2;
+
+ void tempf(float *x, float *y)
+ {
+ floatvect2 temp={x[0],x[1]};
+ floatvect2 temp1={y[0],y[1]};
+ resfloatvect2 temp2;
+ temp2.vector=temp+temp1;
+ x[0]=temp2.f[0];
+ x[1]=temp2.f[1];
+ }
*** /dev/null Thu Aug 30 21:30:55 2001
--- testsuite/gcc.c-torture/compile/simd-3.c Thu Jul 11 15:38:29 2002
***************
*** 0 ****
--- 1,17 ----
+ typedef float floatvect2 __attribute__((mode(V2DF)));
+
+ typedef union
+ {
+ floatvect2 vector;
+ double f[2];
+ }resfloatvect2;
+
+ void tempf(double *x, double *y)
+ {
+ floatvect2 temp={x[0],x[1]};
+ floatvect2 temp1={y[0],y[1]};
+ resfloatvect2 temp2;
+ temp2.vector=temp+temp1;
+ x[0]=temp2.f[0];
+ x[1]=temp2.f[1];
+ }
--------------6B10FD973BDC80FBAEB516C0--
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-07-11 21:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-11 14:06 RFA: integer subregs of float vectors / Re: c/7225: ice on generic vectors (floats) Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
2002-07-11 8:06 Joern Rennecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).