Hello,

gcc can be configured with an "e500v2" cpu target
name, conveying SPE with double precision floats.

config.gcc already has a provision for a good default
cpu selection for SPE with double precision floats
when the latter is explicitly requested with an explicit
--enable command line option. This is:

  # If there is no $with_cpu option, try to infer one from ${target}.
  # This block sets nothing except for with_cpu.
  ...
  case ${target} in
  ...
    powerpc*-*-*spe*)
      if test x$enable_e500_double = xyes; then
         with_cpu=8548
      else
         with_cpu=8540
      fi       
      ;;

The attached patch is a proposal to refine this to select 8548 also
when we were configured for an e500v2 target cpu (canonicalized to
match powerpc-*spe), regardless of enable_e500_double.

We have been using something like this in production for a few
years in-house, lately with gcc-6 based toolchains for VxWorks or
bareboard configurations.

I also checked that
- e500v2-wrs-vxworks builds work with gcc-7, that the default cpu is
  indeed properly set to 8548, and that the built toolchains pass Ada
  ACATS tests for a couple of runtime library variants (kernel and rtp).

- a mainline build for powerpc-eabispe without --enable-e500-double
  defaults to 8540

- a mainline build for powerpc-eabispe with --enable-e500-double
  defaults to 8548

- a mainline build for e500v2-wrs-vxworks without --enable-e500-double
  defaults to 8548

OK to commit ?

Thanks in advance

2017-08-31  Olivier Hainque  <hain...@adacore.com>

        * gcc/config.gcc (powerpc*-*-*spe*): Pick 8548 as the
        default with_cpu for an e500v2 target cpu name, in addition
        to --enable-e500-double.

Attachment: spe-default-cpu.diff
Description: Binary data






Reply via email to