From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51176 invoked by alias); 16 Jun 2017 21:11:22 -0000 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 Received: (qmail 51157 invoked by uid 89); 16 Jun 2017 21:11:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2222, love X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Jun 2017 21:11:20 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id v5GLBG7Z023402; Fri, 16 Jun 2017 16:11:17 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id v5GLBDxa023400; Fri, 16 Jun 2017 16:11:13 -0500 Date: Fri, 16 Jun 2017 21:11:00 -0000 From: Segher Boessenkool To: Carl Love Cc: gcc-patches@gcc.gnu.org, David Edelsohn , Bill Schmidt Subject: Re: [PATCH v4, rs6000] gcc mainline, add builtin support for vec_float, vec_float2, vec_floate, vec_floate, builtins Message-ID: <20170616211111.GI16550@gate.crashing.org> References: <1497630186.3664.23.camel@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1497630186.3664.23.camel@us.ibm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01238.txt.bz2 Hi Carl, On Fri, Jun 16, 2017 at 09:23:06AM -0700, Carl Love wrote: > * config/rs6000/rs6000-c.c (altivec_overloaded_builtins[]): Add > definitions for vec_float, vec_float2, vec_floato, > vec_floate built-ins. No [], just the name. > * config/rs6000/rs6000-builtin.def (FLOAT2_V2DI, FLOATE_V2D*, > FLOATO_V2D*, XVCVSXWSP_V4SF, UNS_FLOATO_V2DI, UNS_FLOATE_V2DI): Add > definitions. Please spell out FLOATE_V2DF, FLOATE_V2DI -- it's only two of-em, and it makes things easier to find. > * config/altivec.md (define_insn "p8_vmrgew_", > define_mode_attr VF_sxddp):Add V4SF type to p8_vmrgew. Space after colon. > * gcc.target/powerpc/builtins-3-runnable.c (test_result_sp(), > main()): Add runnable tests and test checker for vec_float, > vec_float2, vec_floate and vec_floato builtins. No () please. > +(define_insn "vsx_xvcvsxwsp" > + [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa") > + (unspec:V4SF [(match_operand:V4SI 1 "vsx_register_operand" "wa")] > + UNSPEC_VSX_CVSXWSP))] > + "VECTOR_UNIT_VSX_P (V4SFmode)" > + "xvcvsxwsp %x0,%x1" > + [(set_attr "type" "vecdouble")]) Hrm, is that the best type? Maybe vecfloat is better. > +;; Generate floate > +;; convert double or long long signed to float > +;;(Only even words are valid, BE numbering) Single space before double; space before (. > +(define_expand "floato" > + [(use (match_operand:V4SF 0 "register_operand" "=wa")) > + (use (match_operand:VSX_D 1 "register_operand" "wa"))] > + "VECTOR_UNIT_VSX_P (V4SFmode)" These last three lines should be indented one more space. > +{ > + if (VECTOR_ELT_ORDER_BIG) > + emit_insn (gen_vsx_xvcvsp (operands[0], operands[1])); > + else > + { > + /* Shift left one word to put odd word correct location */ > + rtx rtx_tmp; > + rtx rtx_val = GEN_INT (4); > + > + rtx_tmp = gen_reg_rtx (V4SFmode); > + emit_insn (gen_vsx_xvcvsp (rtx_tmp, operands[1])); > + emit_insn (gen_altivec_vsldoi_v4sf (operands[0], > + rtx_tmp, rtx_tmp, rtx_val)); This indent should use tabs. There are more like this. Okay with those last trivialities fixed. Thanks! Segher