This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH-v3] [SPARC] Add a workaround for the LEON3FT store-store errata
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Daniel Cederman <cederman at gaisler dot com>
- Cc: gcc-patches at gcc dot gnu dot org, sebastian dot huber at embedded-brains dot de, davem at davemloft dot net, daniel at gaisler dot com
- Date: Thu, 29 Jun 2017 15:05:42 +0200
- Subject: Re: [PATCH-v3] [SPARC] Add a workaround for the LEON3FT store-store errata
- Authentication-results: sourceware.org; auth=none
- References: <20170627085530.12596-1-cederman@gaisler.com>
> This patch adds a workaround to the Sparc backend for the LEON3FT
> store-store errata. It is enabled when using the -mfix-ut699,
> -mfix-ut700, or -mfix-gr712rc flag.
Let's forget -mfix-gr712rc for now, -mfix-ut700 is enough I think.
> The workaround inserts NOP instructions to prevent the following two
> instruction sequences from being generated:
>
> std -> stb/sth/st/std
> stb/sth/st -> any single non-store/load instruction -> stb/sth/st/std
>
> The __FIX_B2BST define can be used to only enable workarounds in assembly
> code when the flag is used.
I'm not thrilled with this, it's undocumented, the other workaround don't have
it and I don't think that we really need it.
> See GRLIB-TN-0009, "LEON3FT Stale Cache Entry After Store with Data Tag
> Parity Error", for more information.
>
> gcc/ChangeLog:
>
> 2017-06-21 Daniel Cederman <cederman@gaisler.com>
>
> * config/sparc/sparc.c (sparc_do_work_around_errata): Insert NOP
> instructions to prevent sequences that can trigger the store-store
> errata for certain LEON3FT processors.
> (sparc_option_override): -mfix-ut699, -mfix-ut700, and
> -mfix-gr712rc enables the errata workaround.
> * config/sparc/sparc-c.c (sparc_target_macros): Define __FIX_B2BST
> when errata workaround is enabled.
> * config/sparc/sparc.md: Prevent stores in delay slot.
> * config/sparc/sparc.opt: Add -mfix-ut700 and -mfix-gr712rc flag.
> * doc/invoke.texi: Document -mfix-ut700 and -mfix-gr712rc flag.
OK for mainline and 7 branch modulo the above two remarks.
--
Eric Botcazou