public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Joern Rennecke <joern.rennecke@superh.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: RFA: integer subregs of float vectors / Re: c/7225: ice on generic vectors (floats) Date: Thu, 11 Jul 2002 08:06:00 -0000 [thread overview] Message-ID: <20020711150601.22554.qmail@sources.redhat.com> (raw) 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--
next reply other threads:[~2002-07-11 15:06 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-07-11 8:06 Joern Rennecke [this message] 2002-07-11 14:06 Richard Henderson
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020711150601.22554.qmail@sources.redhat.com \ --to=joern.rennecke@superh.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).