public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fwd: [PATCH, ARM] Use a MULTILIB_REQUIRED approach for aprofile multilib
       [not found] <7a028fc9-af84-5214-5eb3-87d87f29dd49@foss.arm.com>
@ 2016-08-10 15:51 ` Thomas Preudhomme
  2016-08-17  9:57 ` [PATCH, ARM, ping] " Thomas Preudhomme
  1 sibling, 0 replies; 2+ messages in thread
From: Thomas Preudhomme @ 2016-08-10 15:51 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 55 bytes --]

Forwarding to gcc-patches which I forgot past patch #1

[-- Attachment #2: [PATCH, ARM] Use a MULTILIB_REQUIRED approach for aprofile multilib.eml --]
[-- Type: message/rfc822, Size: 5670 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 2162 bytes --]

Hi,

Currently, the Makefile fragment for ARM aprofile multilib is using a 
substractive approach. It specifies a set of options to be combined (eg. 
-march=armv7-a,armv7ve,armv8-a, with 
-mfpu=vfpv3-d16,neon,vfpv4-d16,neon-fpv4,neon-fp-armv8) using MULTILIB_OPTIONS 
and then specifies which combination should *not* be built with MULTILIB_EXCEPTIONS.

This patch replaces that approach by an additive one: using MULTILIB_REQUIRED to 
specify the combinations we *do* want. This approach is more scalable and 
maintainable:

1) Scalability

The substractive approach (MULTILIB_EXCEPTIONS) is doable today because there is 
only 3 -march and 5 -mfpu options in t-aprofile. Yet it needs already 22 
MULTILIB_EXCEPTIONS to define the set of multilib to be built. Adding new 
architecture or new mfpu would make that worse. Since we only care about a small 
number of combinations (each mfpu is used with only one march), it makes more 
sense to specify what we want. The new approach only needs 9 MULTILIB_REQUIRED 
lines.

2) Maintainability

Adding one new architecture or vfp option means adding exceptions for all 
combinations which does not make sense with that option (eg. if we add mfpu=foo 
we'll have to exclude all the march we don't want to mix with foo). It forces us 
to think about all combinations involved with this new option and thinking about 
the combinations in it that we do not want. Basically we have to do the work of 
genmultilib in our mind. MULTILIB_REQUIRED on the other hand would allow us to 
just specify the combination involving that new option that we care about which 
is likely to be more obvious IMHO.

Patch is in attachment. ChangeLog entry is as follows:


*** gcc/ChangeLog ***

2016-08-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>

         * config/arm/t-aprofile (MULTILIB_EXCEPTIONS): Rewrite into ...
         (MULTILIB_REQUIRED): This by specifying multilib needing to be built
         rather than those that should not be built.


The output of "tree lib/gcc/arm-none-eabi/7.0.0" before and after the patch 
shows that the same set of multilib is being built.

Is this ok for trunk?

Best regards,

Thomas

[-- Attachment #2.1.2: multilib_required_aprofile.patch --]
[-- Type: text/x-patch, Size: 2507 bytes --]

diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile
index 0d91006d4ef51a765e849079fd43679175466a71..90305e1206e3964e08a673e385d3198747bdffa1 100644
--- a/gcc/config/arm/t-aprofile
+++ b/gcc/config/arm/t-aprofile
@@ -49,33 +49,27 @@ MULTILIB_DIRNAMES      += fpv3 simdv1 fpv4 simdvfpv4 simdv8
 MULTILIB_OPTIONS       += mfloat-abi=softfp/mfloat-abi=hard
 MULTILIB_DIRNAMES      += softfp hard
 
-# We don't build no-float libraries with an FPU.
-MULTILIB_EXCEPTIONS    += *mfpu=vfpv3-d16
-MULTILIB_EXCEPTIONS    += *mfpu=neon
-MULTILIB_EXCEPTIONS    += *mfpu=vfpv4-d16
-MULTILIB_EXCEPTIONS    += *mfpu=neon-vfpv4
-MULTILIB_EXCEPTIONS    += *mfpu=neon-fp-armv8
-
-# We don't build libraries requiring an FPU at the CPU/Arch/ISA level.
-MULTILIB_EXCEPTIONS    += mfloat-abi=*
-MULTILIB_EXCEPTIONS    += mfpu=*
-MULTILIB_EXCEPTIONS    += mthumb/mfloat-abi=*
-MULTILIB_EXCEPTIONS    += mthumb/mfpu=*
-MULTILIB_EXCEPTIONS    += *march=armv7-a/mfloat-abi=*
-MULTILIB_EXCEPTIONS    += *march=armv7ve/mfloat-abi=*
-MULTILIB_EXCEPTIONS    += *march=armv8-a/mfloat-abi=*
-
-# Ensure the correct FPU variants apply to the correct base architectures.
-MULTILIB_EXCEPTIONS    += *march=armv7ve/*mfpu=vfpv3-d16*
-MULTILIB_EXCEPTIONS    += *march=armv7ve/*mfpu=neon/*
-MULTILIB_EXCEPTIONS    += *march=armv8-a/*mfpu=vfpv3-d16*
-MULTILIB_EXCEPTIONS    += *march=armv8-a/*mfpu=neon/*
-MULTILIB_EXCEPTIONS    += *march=armv7-a/*mfpu=vfpv4-d16*
-MULTILIB_EXCEPTIONS    += *march=armv7-a/*mfpu=neon-vfpv4*
-MULTILIB_EXCEPTIONS    += *march=armv8-a/*mfpu=vfpv4-d16*
-MULTILIB_EXCEPTIONS    += *march=armv8-a/*mfpu=neon-vfpv4*
-MULTILIB_EXCEPTIONS    += *march=armv7-a/*mfpu=neon-fp-armv8*
-MULTILIB_EXCEPTIONS    += *march=armv7ve/*mfpu=neon-fp-armv8*
+
+# Option combinations to build library with
+
+# Default CPU/Arch (ARM is implicitly included because it uses the default
+# multilib)
+MULTILIB_REQUIRED      += mthumb
+
+# ARMv7-A
+MULTILIB_REQUIRED      += *march=armv7-a
+MULTILIB_REQUIRED      += *march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=*
+MULTILIB_REQUIRED      += *march=armv7-a/mfpu=neon/mfloat-abi=*
+
+# ARMv7VE
+MULTILIB_REQUIRED      += *march=armv7ve
+MULTILIB_REQUIRED      += *march=armv7ve/mfpu=vfpv4-d16/mfloat-abi=*
+MULTILIB_REQUIRED      += *march=armv7ve/mfpu=neon-vfpv4/mfloat-abi=*
+
+# ARMv8-A
+MULTILIB_REQUIRED      += *march=armv8-a
+MULTILIB_REQUIRED      += *march=armv8-a/mfpu=neon-fp-armv8/mfloat-abi=*
+
 
 # CPU Matches
 MULTILIB_MATCHES       += march?armv7-a=mcpu?cortex-a8

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, ARM, ping] Use a MULTILIB_REQUIRED approach for aprofile multilib
       [not found] <7a028fc9-af84-5214-5eb3-87d87f29dd49@foss.arm.com>
  2016-08-10 15:51 ` Fwd: [PATCH, ARM] Use a MULTILIB_REQUIRED approach for aprofile multilib Thomas Preudhomme
@ 2016-08-17  9:57 ` Thomas Preudhomme
  1 sibling, 0 replies; 2+ messages in thread
From: Thomas Preudhomme @ 2016-08-17  9:57 UTC (permalink / raw)
  To: kyrylo.tkachov, ramana.radhakrishnan, richard.earnshaw, gcc-patches

Ping?

Best regards,

Thomas

On 10/08/16 14:51, Thomas Preudhomme wrote:
> Hi,
>
> Currently, the Makefile fragment for ARM aprofile multilib is using a
> substractive approach. It specifies a set of options to be combined (eg.
> -march=armv7-a,armv7ve,armv8-a, with
> -mfpu=vfpv3-d16,neon,vfpv4-d16,neon-fpv4,neon-fp-armv8) using MULTILIB_OPTIONS
> and then specifies which combination should *not* be built with
> MULTILIB_EXCEPTIONS.
>
> This patch replaces that approach by an additive one: using MULTILIB_REQUIRED to
> specify the combinations we *do* want. This approach is more scalable and
> maintainable:
>
> 1) Scalability
>
> The substractive approach (MULTILIB_EXCEPTIONS) is doable today because there is
> only 3 -march and 5 -mfpu options in t-aprofile. Yet it needs already 22
> MULTILIB_EXCEPTIONS to define the set of multilib to be built. Adding new
> architecture or new mfpu would make that worse. Since we only care about a small
> number of combinations (each mfpu is used with only one march), it makes more
> sense to specify what we want. The new approach only needs 9 MULTILIB_REQUIRED
> lines.
>
> 2) Maintainability
>
> Adding one new architecture or vfp option means adding exceptions for all
> combinations which does not make sense with that option (eg. if we add mfpu=foo
> we'll have to exclude all the march we don't want to mix with foo). It forces us
> to think about all combinations involved with this new option and thinking about
> the combinations in it that we do not want. Basically we have to do the work of
> genmultilib in our mind. MULTILIB_REQUIRED on the other hand would allow us to
> just specify the combination involving that new option that we care about which
> is likely to be more obvious IMHO.
>
> Patch is in attachment. ChangeLog entry is as follows:
>
>
> *** gcc/ChangeLog ***
>
> 2016-08-01  Thomas Preud'homme  <thomas.preudhomme@arm.com>
>
>         * config/arm/t-aprofile (MULTILIB_EXCEPTIONS): Rewrite into ...
>         (MULTILIB_REQUIRED): This by specifying multilib needing to be built
>         rather than those that should not be built.
>
>
> The output of "tree lib/gcc/arm-none-eabi/7.0.0" before and after the patch
> shows that the same set of multilib is being built.
>
> Is this ok for trunk?
>
> Best regards,
>
> Thomas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-17  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <7a028fc9-af84-5214-5eb3-87d87f29dd49@foss.arm.com>
2016-08-10 15:51 ` Fwd: [PATCH, ARM] Use a MULTILIB_REQUIRED approach for aprofile multilib Thomas Preudhomme
2016-08-17  9:57 ` [PATCH, ARM, ping] " Thomas Preudhomme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).