public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Clean up widen mult even/odd
@ 2012-07-10  8:23 Richard Henderson
  2012-07-10  8:23 ` [PATCH 7/7] Zap now unused builtin_mul_widen_even/odd target hooks Richard Henderson
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Richard Henderson @ 2012-07-10  8:23 UTC (permalink / raw)
  To: gcc-patches

I find it instructive that 4 of the 5 isas that actually implement
widening integer multiplication do have mult-widen-even as the isa
primitive (even if the -odd variant is missing).  The fact that this
operation is implemented as a set of builtins and target hooks has
lead to disturbingly cookie-cutter implementations of these hooks
in the various backends.

Thus I choose to add VEC_WIDEN_MULT_EVEN/ODD_EXPR as tree codes and
optabs.  This removes a farily trivial amount of code from three
backends (the fourth backend, ia64, never grew this support).

The existance of optabs then allows the expansion of MULT_HIGHPART_EXPR
at the rtl-expansion level without having to resort to builtin expansion
in order to emit the even/odd alternative.  This saves a fairly 
substantial amount of code from the vectorizer.

I've not touched the interface to supportable_widening_operation,
which is still prepared to return a CALL_EXPR and some decls.  After
this patch set it will never do so.  I'm undecided as to whether we
ought to be prepared for such in the future, or whether this should
simply go in as a completely separate patch that could in the future
be easily reverted.

Tested on x86_64; cross-compiled to ppc64 and spu, spot checking the
relevant division-by-constant testcases.


r~



Richard Henderson (7):
  Add VEC_WIDEN_MULT_EVEN/ODD_EXPR
  i386: Rename patterns for vec_widen_<s>mult_even/odd_<mode>
  rs6000: Rename patterns for vec_widen_<s>mult_even/odd_<mode>
  spu: Rename patterns for vec_widen_<s>mult_even/odd_<mode>
  Move vector highpart emulation to the optabs layer
  Use VEC_WIDEN_MULT_EVEN/ODD_EXPR in supportable_widening_operation
  Zap now unused builtin_mul_widen_even/odd target hooks

 gcc/ChangeLog                        |   89 ++++++++++++
 gcc/cfgexpand.c                      |    4 +-
 gcc/config/i386/i386.c               |  103 ++-----------
 gcc/config/i386/sse.md               |   18 +--
 gcc/config/rs6000/altivec.md         |   54 +++----
 gcc/config/rs6000/rs6000-builtin.def |   24 +--
 gcc/config/rs6000/rs6000.c           |   51 -------
 gcc/config/spu/spu-builtins.def      |   24 +--
 gcc/config/spu/spu-builtins.md       |   65 ---------
 gcc/config/spu/spu.c                 |   42 ------
 gcc/config/spu/spu.md                |   86 +++++++++--
 gcc/doc/md.texi                      |   12 +-
 gcc/doc/tm.texi                      |   22 ---
 gcc/doc/tm.texi.in                   |   22 ---
 gcc/expmed.c                         |   32 ++--
 gcc/expr.c                           |   35 ++---
 gcc/fold-const.c                     |   36 +++--
 gcc/genopinit.c                      |    4 +
 gcc/gimple-pretty-print.c            |    2 +
 gcc/optabs.c                         |  134 +++++++++++++++++
 gcc/optabs.h                         |   18 ++-
 gcc/system.h                         |    4 +-
 gcc/target.def                       |   14 --
 gcc/tree-cfg.c                       |    2 +
 gcc/tree-inline.c                    |    2 +
 gcc/tree-pretty-print.c              |   32 ++--
 gcc/tree-vect-generic.c              |  145 +++++-------------
 gcc/tree-vect-patterns.c             |   23 +--
 gcc/tree-vect-stmts.c                |  267 +++++++++-------------------------
 gcc/tree.c                           |    2 +
 gcc/tree.def                         |    4 +
 31 files changed, 580 insertions(+), 792 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-17 12:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10  8:23 [PATCH 0/7] Clean up widen mult even/odd Richard Henderson
2012-07-10  8:23 ` [PATCH 7/7] Zap now unused builtin_mul_widen_even/odd target hooks Richard Henderson
2012-07-10  8:23 ` [PATCH 6/7] Use VEC_WIDEN_MULT_EVEN/ODD_EXPR in supportable_widening_operation Richard Henderson
2012-07-10  8:23 ` [PATCH 2/7] i386: Rename patterns for vec_widen_<s>mult_even/odd_<mode> Richard Henderson
2012-07-10  8:23 ` [PATCH 3/7] rs6000: " Richard Henderson
2012-07-10  8:23 ` [PATCH 5/7] Move vector highpart emulation to the optabs layer Richard Henderson
2012-07-10  8:23 ` [PATCH 4/7] spu: Rename patterns for vec_widen_<s>mult_even/odd_<mode> Richard Henderson
2012-07-10  8:23 ` [PATCH 1/7] Add VEC_WIDEN_MULT_EVEN/ODD_EXPR Richard Henderson
2012-07-10  9:03 ` [PATCH 0/7] Clean up widen mult even/odd Richard Guenther
2012-07-10  9:12 ` Jakub Jelinek
2012-07-17 12:32   ` Richard Henderson

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).