]> git.ipfire.org Git - thirdparty/gcc.git/commit
[SPARC] Errata workaround for GRLIB-TN-0013
authordanielh <danielh@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Nov 2017 15:37:19 +0000 (15:37 +0000)
committerdanielh <danielh@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Nov 2017 15:37:19 +0000 (15:37 +0000)
commit32bf744c9a5e62a6957979d335d0e18e7298f5b8
tree545d06bbed1d81221f919c4d58ee659b489724b0
parent91491c8af71f05eaef53618ce52314566f11693f
[SPARC] Errata workaround for GRLIB-TN-0013

This patch provides a workaround for the errata described in GRLIB-TN-0013.

If the workaround is enabled it will:

* Prevent div and sqrt instructions in the delay slot.

* Insert NOPs to prevent the sequence (div/sqrt) -> (two or three floating
  point operations or loads) -> (div/sqrt).

* Not insert NOPs if any of the floating point operations have a dependency
  on the destination register of the first (div/sqrt).

* Not insert NOPs if one of the floating point operations is a (div/sqrt).

* Insert NOPs to prevent (div/sqrt) followed by a branch.

It is applicable to GR712RC, UT700, and UT699.

2017-11-29  Daniel Cederman  <cederman@gaisler.com>

gcc/
* config/sparc/sparc.c (fpop_reg_depend_p): New function.
(div_sqrt_insn_p): New function.
(sparc_do_work_around_errata): Insert NOP instructions to
prevent sequences that could trigger the TN-0013 errata for
certain LEON3 processors.
(pass_work_around_errata::gate): Also test sparc_fix_lost_divsqrt.
(sparc_option_override): Set sparc_fix_lost_divsqrt appropriately.
* config/sparc/sparc.md (fix_lost_divsqrt): New attribute.
(in_branch_delay): Prevent div and sqrt in delay slot if
fix_lost_divsqrt.
* config/sparc/sparc.opt (sparc_fix_lost_divsqrt): New variable.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255237 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.md
gcc/config/sparc/sparc.opt