Hello,

This is a followup on a discussion we had a while ago, starting with

  http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01543.html

The original issue was the vxworks port unduly clobbering explicit
SPE related options on powerpc, which it still does. The proposed patch
at the time was to prevent the clobbering locally, adding guards in the
vxworks.h code as there are in a few other targets already.

Joseph and David suggested to address this in a more general fashion,
along lines proposed in

  http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01667.html

The attached patch is a first shot in this direction. Only lightly tested
at this point, posted to get a first round of comments to validate that this
corresponds to what was suggested.

This indeed allows significant simplifications - cleaner configuration
model, defaults control factorized, no need for e500-double.h any more.
I'll be happy to do what I can to help in getting this in eventually.

One piece that for sure needs updating is 

The TARGET_NO_LWSYNC change suggests that maybe keeping a TARGET_E500 macro
would make sense after all, to convey "cpu features an E500 core" which happens
to imply SPE support and no LWSYNC. We could have a TARGET_E500MC as well to
make it clear that the latter family differs from the former. That's
actually a detail in the set of changes at hand.

In addition to what I understood of the suggestions made in the
aforementioned thread, this patch includes a change on the choice of
rs6000_cpu in options_override, so that it treats a --with-cpu passed
at configure time as an implicit -mcpu in absence of an explicit one.

This sounds reasonable and is useful for the more general change we're
discussing. 

This patch allowed me to build a few configurations with as-expected
results on gcc 4.7 base. The patch applies as-is on mainline. My first
attempt at building there failed, with

  --target=powerpc-eabispe --with-cpu=8548 --enable-languages=c 
--disable-libada 

(internal compiler error on unwind-dw2.c) This failure reproduces with
an unpatched tree as well, so there's something already broken in this area.

I suppose I can can look into this one first. I'd appreciate feedback on the
more general patch nevetheless :)   (whether that's the right direction, things
that you think should be done differently, indications as to how you'd like to
proceed further (testing etc), ...)

Thanks much in advance,

Olivier

2012-05-07  Olivier Hainque  <hain...@adacore.com>

        config/rs6000:

        * rs6000-opts.h (enum processor_type): Add PROCESSOR_PPC8548.
        * rs6000-cpus.def: Reference it for cpu="8548".
        * rs6000.md (cpu attribute definition): Add ppc8548.
        * 8540.md: indicate that the units/patterns apply to ppc8548 as well.

        * rs6000.c (rs6000_option_override_internal): Rename default_cpu into
        implicit_cpu, conveying what --with-cpu was passed at configure time.
        Treat implicit_cpu as have_cpu. Pick defaults for SPE related flags,
        check that what is queried is supported by the selected configuration.
        Rework the single/double_float and MASK_STRING resets to hit for all
        the E500 cores (854x + E500MC variants). Select the ppc8540 costs for
        PROCESSOR_PPC8548 as well.
        (rs6000_issue_rate): case CPU_PPC8548 together with CPU_PPC8540.
        (rs6000_use_sched_lookahead): Likewise, rewriting function as a case
        statement instead of a sequence of ifs.

        * rs6000.h (TARGET_E500): Remove.
        (TARGET_NO_LWSYNC): Adjust accordingly.
        * e500.h (TARGET_E500): Remove.
        (CHECK_E500_OPTIONS): Adjust accordingly.
        * eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Remove.
        (TARGET_DEFAULT): Reformat definition to match the one in linuxspe.h.
        * linuxspe.h: Likewise.
        * vxworks.h: Remove bogus TARGET_E500 overrides and superfluous 
comments.
        * e500-double.h: Remove.

        gcc:

        * config.gcc (pick a default with_cpu): For powerpc*-*-*spe*,
        default to with_cpu=8548 if --enable-e500-double, and to 8540
        otherwise.
        (set misc flags section): For powerpc*|rs6000*, remove inclusion
        of e500-double.h for --enable-e500-double.

Attachment: e500.dif
Description: video/dv

Reply via email to