From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100697 invoked by alias); 28 Mar 2018 18:35:29 -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 99702 invoked by uid 89); 28 Mar 2018 18:35:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Mar 2018 18:35:27 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57B5F406802D for ; Wed, 28 Mar 2018 18:35:23 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.36.118.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD2D0215CDC5 for ; Wed, 28 Mar 2018 18:35:19 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w2SGasJR011812; Wed, 28 Mar 2018 18:36:54 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w2SGaqbc011811; Wed, 28 Mar 2018 18:36:52 +0200 Date: Wed, 28 Mar 2018 18:35:00 -0000 From: Jakub Jelinek To: Martin =?utf-8?B?TGnFoWth?= Cc: Richard Biener , Uros Bizjak , gcc-patches@gcc.gnu.org, Marc Glisse , "H.J. Lu" Subject: Re: [PATCH] Prefer mempcpy to memcpy on x86_64 target (PR middle-end/81657). Message-ID: <20180328163652.GL8577@tucnak> Reply-To: Jakub Jelinek References: <20180313083212.GX8577@tucnak> <45ff50a3-71ac-6028-02dd-d4384ec425ec@suse.cz> <20180313152359.GB8577@tucnak> <2cc467cb-569a-88be-0f91-b6f389415ffd@suse.cz> <20180314130754.GH8577@tucnak> <4ca9c192-84f2-95ba-ffd7-1c9aa9be1dfd@suse.cz> <20180321103425.GJ8577@tucnak> <20180328143114.GK8577@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg01512.txt.bz2 On Wed, Mar 28, 2018 at 06:30:21PM +0200, Martin Liška wrote: > --- a/gcc/config/linux.c > +++ b/gcc/config/linux.c > @@ -37,3 +37,24 @@ linux_libc_has_function (enum function_class fn_class) > > return false; > } > + > +/* This hook determines whether a function from libc has a fast implementation > + FN is present at the runtime. We override it for i386 and glibc C library > + as this combination provides fast implementation of mempcpy function. */ > + > +enum libc_speed > +ix86_linux_libc_func_speed (int fn) Putting a ix86_ function into config/linux.c used by most linux targets is weird. Either we multiple linux targets with mempcpy fast, then name it somehow cpu neutral and let all those CPUs pick it up in config/*/linux.h. And yes, we do care about i?86-linux. Or it is for x86 only, and then it shouldn't be in config/linux.c, but either e.g. static inline in config/i386/linux.h, or we need config/i386/linux.c if we don't have it already. Jakub