This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [ARM] architecture specific subdirectories & optimised memchr [V3]
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: "Dr. David Alan Gilbert" <david dot gilbert at linaro dot org>
- Cc: libc-ports at sourceware dot org, patches at linaro dot org
- Date: Wed, 26 Oct 2011 23:42:30 +0000 (UTC)
- Subject: Re: [ARM] architecture specific subdirectories & optimised memchr [V3]
- References: <20110715181101.GA20980@davesworkthinkpad> <Pine.LNX.4.64.1108021437200.16898@digraph.polyomino.org.uk> <CA+1XiSfT7Ceky_bi1SzkcKbVFQh8WsKRcFKp39hcDRVS3PmexQ@mail.gmail.com> <Pine.LNX.4.64.1108041949260.31451@digraph.polyomino.org.uk> <20110928175913.GA11067@davesworkthinkpad>
On Wed, 28 Sep 2011, Dr. David Alan Gilbert wrote:
> Hi,
> As previously discussed, here is a new version of my ARM optimised memchr
> and patch that picks up ARM version based on compiler flags.
Given the discussions on the newlib list, is this still the version of the
memchr code you are proposing or is there a newer one?
> + case x$archcppflag in
> + x__ARM_ARCH_7A__)
> + machine=armv7
> + echo "Found compiler is configured for $machine"
> + ;;
> +
> + x__ARM_ARCH_6T2__)
> + machine=armv6t2
> + echo "Found compiler is configured for $machine"
> + ;;
Let's assume we do detect architecture variants this way. The main
problem is that this will be suboptimal on any future architecture
variants - if the compiler defines __ARM_ARCH_8A__, for example. There
are various ways to avoid that issue:
* sysdeps/arm/memcpy.S has a conditional on all the macros for older
architecture variants not being defined. That's not a very convenient way
to do things and it's always possible there could be a new variant of
ARMv6, say.
* Hopefully in the future the compiler will define a macro directly with a
version number for the architecture, which will make this easier.
* At present, the best approach for a configure script like this is
probably to handle __ARM_ARCH_[789]* and __ARM_ARCH_1[0-9]* the same as
your patch handles __ARM_ARCH_7A__ - assume that all v7 and later
architectures can use this code.
--
Joseph S. Myers
joseph@codesourcery.com