From: Will Schmidt <will_schmidt@vnet.ibm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
Segher Boessenkool <segher@kernel.crashing.org>,
David Edelsohn <dje.gcc@gmail.com>
Cc: Bill Schmidt <wschmidt@linux.vnet.ibm.com>,
Will Schmidt <will_schmidt@vnet.ibm.com>
Subject: [PATCH, rs6000] Fold vector multiplies in GIMPLE
Date: Thu, 11 May 2017 15:52:00 -0000 [thread overview]
Message-ID: <1494517914.15163.33.camel@brimstone.rchland.ibm.com> (raw)
Hi,
Add support for some of the vector multiply (sp,dp) operations in
the gimple folding. I missed these during an earlier pass that
added the other (mule, mulo) multiply operations. This change is
covered by the existing testcases for vector folding
(gcc.target/powerpc/fold-vec-mul-*.c).
Bootstrapped and tested on powerpc64le-unknown-linux-gnu, and
powerpc-unknown-linux, (p7,p8le,p8be) with no regressions.
Is this OK for trunk?
[gcc]
2017-05-10 Will Schmidt <will_schmidt@vnet.ibm.com>
* config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add handling for
early GIMPLE expansion of vector multiplies.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index a1b58e2..c4e03b4 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -16860,6 +16860,17 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
gsi_replace (gsi, g, true);
return true;
}
+ case VSX_BUILTIN_XVMULSP:
+ case VSX_BUILTIN_XVMULDP:
+ {
+ arg0 = gimple_call_arg (stmt, 0);
+ arg1 = gimple_call_arg (stmt, 1);
+ lhs = gimple_call_lhs (stmt);
+ gimple *g = gimple_build_assign (lhs, MULT_EXPR, arg0, arg1);
+ gimple_set_location (g, gimple_location (stmt));
+ gsi_replace (gsi, g, true);
+ return true;
+ }
/* Even element flavors of vec_mul (signed). */
case ALTIVEC_BUILTIN_VMULESB:
case ALTIVEC_BUILTIN_VMULESH:
next reply other threads:[~2017-05-11 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-11 15:52 Will Schmidt [this message]
2017-05-11 19:15 ` Segher Boessenkool
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=1494517914.15163.33.camel@brimstone.rchland.ibm.com \
--to=will_schmidt@vnet.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=segher@kernel.crashing.org \
--cc=wschmidt@linux.vnet.ibm.com \
/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: link
Be 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).