From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4430 invoked by alias); 30 Apr 2013 17:18:22 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 4405 invoked by uid 89); 30 Apr 2013 17:18:21 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,TW_CP,TW_HW autolearn=ham version=3.3.1 Received: from toast.topped-with-meat.com (HELO topped-with-meat.com) (204.197.218.159) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 30 Apr 2013 17:18:20 +0000 Received: by topped-with-meat.com (Postfix, from userid 5281) id 697972C08A; Tue, 30 Apr 2013 10:18:18 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Will Newton Cc: libc-ports@sourceware.org, patches@linaro.org Subject: Re: [PATCH, v5] ARM: Add Cortex-A15 optimized NEON and VFP memcpy routines, with IFUNC. In-Reply-To: Will Newton's message of Tuesday, 30 April 2013 17:54:22 +0100 <517FF73E.5020509@linaro.org> References: <517FF73E.5020509@linaro.org> Message-Id: <20130430171818.697972C08A@topped-with-meat.com> Date: Tue, 30 Apr 2013 17:18:00 -0000 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=LYSvtFvi c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=rglRB8kCB1QA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=_hi65yC6-YUA:10 a=_gozMB0LinAR_f1uIVsA:9 a=CjuIK1q_8ugA:10 X-SW-Source: 2013-04/txt/msg00120.txt.bz2 > +++ b/ports/sysdeps/arm/armv7/multiarch/aeabi_memcpy.c > @@ -0,0 +1,33 @@ > +/* Copyright (C) 2005-2013 Free Software Foundation, Inc. The first line of each new file should be a descriptive comment. > +void *__memcpy_arm (void *dest, const void *src, size_t n); > + > +/* Copy memory like memcpy, but no return value required. Can't alias > + to memcpy because it's not defined in the same translation > + unit. */ Why not just define the aliases in memcpy.S instead? (Then this can be an empty file just to override arm/aeabi_memcpy.c.) You should also add some comments about why it's important that the __aeabi_* functions use __memcpy_arm rather than memcpy. > +++ b/ports/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c > @@ -0,0 +1,44 @@ > +/* Enumerate available IFUNC implementations of a function. arm version. ARM in caps. > + IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_ARM_VFPv3, > + __memcpy_vfp) HWCAP_ARM_VFP. > +ENTRY(memcpy) > + .type memcpy, %gnu_indirect_function > + ldr r1, .Lmemcpy_arm > + tst r0, #HWCAP_ARM_VFP > + ldrne r1, .Lmemcpy_vfp If __SOFTFP__ is predefined by the compiler, then the compiler is presuming VFP support anyway. So you can make this: #ifdef __SOFTFP__ ldr r1, .Lmemcpy_arm tst r0, #HWCAP_ARM_VFP ldrne r1, .Lmemcpy_vfp #else ldr r1, .Lmemcpy_vfp #endif (and also conditionalize .Lmemcpy_arm, below). > +# If we are configuring for armv7 we need binutils 2.21 to ensure that > +# NEON alignments are assembled correctly. > +if test $machine = arm/armv7; then > + AC_CHECK_PROG_VER(AS, $AS, --version, > + [GNU assembler.* \([0-9]*\.[0-9.]*\)], > + [2.1[0-9][0-9]*|2.[2-9][1-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as") > +fi Just put this in sysdeps/arm/armv7/configure.in and don't test $machine. Whenever possible, it is far better to test for an actual relevant detail empirically rather than testing version numbers. If you can show an example of an instruction sequence that is misassembled by binutils 2.20 then we can help you construct a more precise configure check. Thanks, Roland