From patchwork Tue Nov 8 23:00:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 124453 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id CF96BB6F67 for ; Wed, 9 Nov 2011 10:01:11 +1100 (EST) Received: (qmail 30696 invoked by alias); 8 Nov 2011 23:01:09 -0000 Received: (qmail 30679 invoked by uid 22791); 8 Nov 2011 23:01:07 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from e35.co.us.ibm.com (HELO e35.co.us.ibm.com) (32.97.110.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Nov 2011 23:00:50 +0000 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Nov 2011 16:00:49 -0700 Received: from d03relay02.boulder.ibm.com ([9.17.195.227]) by e35.co.us.ibm.com ([192.168.1.135]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Nov 2011 16:00:24 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA8N0JJI153804 for ; Tue, 8 Nov 2011 16:00:21 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA8N0IeR030443 for ; Tue, 8 Nov 2011 16:00:19 -0700 Received: from meissner-tiger.homedns.org (dyn9033037049.westford.ibm.com [9.33.37.49]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pA8N0Hh2030243; Tue, 8 Nov 2011 16:00:17 -0700 Received: by meissner-tiger.homedns.org (Postfix, from userid 500) id 9BB763FD5F; Tue, 8 Nov 2011 18:00:12 -0500 (EST) Date: Tue, 8 Nov 2011 18:00:11 -0500 From: Michael Meissner To: Richard Henderson , dje.gcc@gmail.com Cc: GCC Patches , dplotnikov@ispras.ru, meissner@linux.vnet.ibm.com Subject: Re: [i386] Remove TARGET_VECTORIZE_BUILTIN_CONVERSION Message-ID: <20111108230011.GA21496@meissner-tiger.homedns.org> Mail-Followup-To: Michael Meissner , Richard Henderson , dje.gcc@gmail.com, GCC Patches , dplotnikov@ispras.ru References: <4EAEFA52.8080502@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4EAEFA52.8080502@redhat.com> User-Agent: Mutt/1.5.20 (2009-12-10) x-cbid: 11110823-6148-0000-0000-0000010CEA66 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Mon, Oct 31, 2011 at 12:43:14PM -0700, Richard Henderson wrote: > I checked in the generic portion of Dmitry Plotnikov's patch > to the vectorizer and optabs that enables this patch. The ARM > portion of his patch is still outstanding, awaiting approval. > > This allows this target hook to be removed from other targets. > > Can I talk you into doing a similar patch for rs6000, Mike? > After that I can take care of removing the target hook entirely. > > Tested on x86_64-linux. The rs6000 already uses the standard names, but it still defined the target hook. I came up with with quick patch to delete the rs6000 target hook, and it appears that the same code is now generated. I'll start a full bootstrap and make check comparison. 2011-11-08 Michael Meissner * config/rs6000/rs6000.c (rs6000_builtin_conversion): Delete, target hook is not needed anymore to do conversion. (TARGET_VECTORIZE_BUILTIN_CONVERSION): Delete. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 181174) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -1403,8 +1403,6 @@ static const struct attribute_spec rs600 #define TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN rs6000_builtin_mul_widen_even #undef TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD #define TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD rs6000_builtin_mul_widen_odd -#undef TARGET_VECTORIZE_BUILTIN_CONVERSION -#define TARGET_VECTORIZE_BUILTIN_CONVERSION rs6000_builtin_conversion #undef TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT #define TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT \ rs6000_builtin_support_vector_misalignment @@ -3299,69 +3297,6 @@ rs6000_loop_align_max_skip (rtx label) return (1 << rs6000_loop_align (label)) - 1; } -/* Implement targetm.vectorize.builtin_conversion. - Returns a decl of a function that implements conversion of an integer vector - into a floating-point vector, or vice-versa. DEST_TYPE is the - destination type and SRC_TYPE the source type of the conversion. - Return NULL_TREE if it is not available. */ -static tree -rs6000_builtin_conversion (unsigned int tcode, tree dest_type, tree src_type) -{ - enum tree_code code = (enum tree_code) tcode; - - switch (code) - { - case FIX_TRUNC_EXPR: - switch (TYPE_MODE (dest_type)) - { - case V2DImode: - if (!VECTOR_UNIT_VSX_P (V2DFmode)) - return NULL_TREE; - - return TYPE_UNSIGNED (dest_type) - ? rs6000_builtin_decls[VSX_BUILTIN_XVCVDPUXDS_UNS] - : rs6000_builtin_decls[VSX_BUILTIN_XVCVDPSXDS]; - - case V4SImode: - if (VECTOR_UNIT_NONE_P (V4SImode) || VECTOR_UNIT_NONE_P (V4SFmode)) - return NULL_TREE; - - return TYPE_UNSIGNED (dest_type) - ? rs6000_builtin_decls[VECTOR_BUILTIN_FIXUNS_V4SF_V4SI] - : rs6000_builtin_decls[VECTOR_BUILTIN_FIX_V4SF_V4SI]; - - default: - return NULL_TREE; - } - - case FLOAT_EXPR: - switch (TYPE_MODE (src_type)) - { - case V2DImode: - if (!VECTOR_UNIT_VSX_P (V2DFmode)) - return NULL_TREE; - - return TYPE_UNSIGNED (src_type) - ? rs6000_builtin_decls[VSX_BUILTIN_XVCVUXDDP] - : rs6000_builtin_decls[VSX_BUILTIN_XVCVSXDDP]; - - case V4SImode: - if (VECTOR_UNIT_NONE_P (V4SImode) || VECTOR_UNIT_NONE_P (V4SFmode)) - return NULL_TREE; - - return TYPE_UNSIGNED (src_type) - ? rs6000_builtin_decls[VECTOR_BUILTIN_UNSFLOAT_V4SI_V4SF] - : rs6000_builtin_decls[VECTOR_BUILTIN_FLOAT_V4SI_V4SF]; - - default: - return NULL_TREE; - } - - default: - return NULL_TREE; - } -} - /* Implement targetm.vectorize.builtin_mul_widen_even. */ static tree rs6000_builtin_mul_widen_even (tree type)