From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-40135.protonmail.ch (mail-40135.protonmail.ch [185.70.40.135]) by sourceware.org (Postfix) with ESMTPS id BF71C3857032 for ; Mon, 10 Aug 2020 17:30:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BF71C3857032 Date: Mon, 10 Aug 2020 17:29:49 +0000 To: Jakub Jelinek From: GT Cc: "gcc-patches@gcc.gnu.org" , "segher@kernel.crashing.org" , "dje.gcc@gmail.com" , "wschmidt@linux.ibm.com" , "tuliom@linux.ibm.com" , Bert Tenjy Reply-To: GT Subject: Re: [RFC PATCH v1 1/1] PPC64: Implement POWER Architecture Vector Function ABI. Message-ID: In-Reply-To: <20200807205905.GD2363@tucnak> References: <1596832552-111518-1-git-send-email-tnggil@protonmail.com> <20200807205905.GD2363@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 17:30:05 -0000 =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Friday, August 7, 2020 4:59 PM, Jakub Jelinek wrote: > On Fri, Aug 07, 2020 at 08:35:52PM +0000, Bert Tenjy via Gcc-patches wrot= e: > > > The document describing POWER Architecture Vector Function interface is > > tentatively at: https://sourceware.org/glibc/wiki/Homepage?action=3DAtt= achFile&do=3Dview&target=3Dpowerarchvectfuncabi.html > > Doesn't exist. I can't tell what the issue is with the link as given above. But the one be= low does actually open the page for me. https://sourceware.org/glibc/wiki/HomePage?action=3DAttachFile&do=3Dview&ta= rget=3Dpowerarchvectfuncabi.html > > > - if (TARGET_VSX) > > - { > > - clonei->vecsize_mangle =3D 'b'; > > > > > > - ret =3D 1; > > > > > > - } > > - clonei->mask_mode =3D VOIDmode; > > - switch (clonei->vecsize_mangle) > > - { > > - case 'b': > > - clonei->vecsize_int =3D 128; > > > > > > - clonei->vecsize_float =3D 128; > > > > > > - break; > > > > > > - case 'c': > > - clonei->vecsize_int =3D 128; > > > > > > - clonei->vecsize_float =3D 128; > > > > > > So what is this 'c' case here for? > I should have removed it. It will be deleted in the next version. > > - break; > > > > > > - default: > > - gcc_unreachable (); > > > > > > If (!TARGET_VSX), this will abort (as you only set vecsize_mangle to 'b' > if TARGET_VSX, otherwise nothing sets it (so it remains 0). > > The way this works is that the caller calls the target hook with 0 > as last argument, and the hook either returns 0 (means not supported at > all), or returns number of supported variants and provides the first one. > If more than one are supported, the caller will keep iterating on those. > E.g. on x86, we support 4 modes (b, c, d, e) for exported functions and > for non-exported ones just choose a single one based on the ISA, because = in > that case it is not a matter of ABI. > > For PowerPC, if all you want to support is b which requires VSX, then the > right thing is for !TREE_PUBLIC functions return 0 if !TARGET_VSX and > otherwise set vecsize_mangle to 'b' and in the end return 1, for exported > functions always set it to 'b' (and in the end return 1). > Then ensure that the 'b' variants of function definitions get target ("vs= x") > attribute added if !TARGET_VSX. > So setting attribute "vsx" for 'b' variants of function definitions is what should go in function rs6000_simd_clone_usable? Bert.