From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31839 invoked by alias); 10 Jul 2012 08:23:24 -0000 Received: (qmail 31804 invoked by uid 22791); 10 Jul 2012 08:23:17 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-we0-f175.google.com (HELO mail-we0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jul 2012 08:23:01 +0000 Received: by weyr6 with SMTP id r6so5810110wey.20 for ; Tue, 10 Jul 2012 01:23:00 -0700 (PDT) Received: by 10.216.133.130 with SMTP id q2mr18431929wei.131.1341908580189; Tue, 10 Jul 2012 01:23:00 -0700 (PDT) Received: from pebble.cz (vpn-konference.ms.mff.cuni.cz. [195.113.20.101]) by mx.google.com with ESMTPS id ch9sm41442328wib.8.2012.07.10.01.22.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 Jul 2012 01:22:59 -0700 (PDT) From: Richard Henderson To: gcc-patches@gcc.gnu.org Subject: [PATCH 0/7] Clean up widen mult even/odd Date: Tue, 10 Jul 2012 08:23:00 -0000 Message-Id: <1341908571-30346-1-git-send-email-rth@redhat.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg00366.txt.bz2 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_mult_even/odd_ rs6000: Rename patterns for vec_widen_mult_even/odd_ spu: Rename patterns for vec_widen_mult_even/odd_ 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