public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [SPARC] Avoid b2bst errata when using -mfix-ut699
@ 2017-07-11  9:00 Daniel Cederman
  2017-07-16 10:44 ` Eric Botcazou
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Cederman @ 2017-07-11  9:00 UTC (permalink / raw)
  To: ebotcazou; +Cc: gcc-patches, sebastian.huber, davem, daniel

The errata fix for the UT699 fdivd and fsqrtd might cause a sequence
that can trigger the b2bst errata. Adding a NOP prevents this.

gcc/ChangeLog:

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

	* config/sparc/sparc.md (divdf3_fix): Add NOP to prevent back
	to back store errata sensitive sequence from being generated.
	(sqrtdf2_fix): Likewise.
---
 gcc/config/sparc/sparc.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index afdc7d1..b154003 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -6171,10 +6171,10 @@ visl")
 	(div:DF (match_operand:DF 1 "register_operand" "e")
 		(match_operand:DF 2 "register_operand" "e")))]
   "TARGET_FPU && sparc_fix_ut699"
-  "fdivd\t%1, %2, %0\n\tstd\t%0, [%%sp-8]"
+  "fdivd\t%1, %2, %0\n\tstd\t%0, [%%sp-8]\n\tnop"
   [(set_attr "type" "fpdivd")
    (set_attr "fptype" "double")
-   (set_attr "length" "2")])
+   (set_attr "length" "3")])
 
 (define_insn "divsf3"
   [(set (match_operand:SF 0 "register_operand" "=f")
@@ -6423,10 +6423,10 @@ visl")
   [(set (match_operand:DF 0 "register_operand" "=e")
 	(sqrt:DF (match_operand:DF 1 "register_operand" "e")))]
   "TARGET_FPU && sparc_fix_ut699"
-  "fsqrtd\t%1, %0\n\tstd\t%0, [%%sp-8]"
+  "fsqrtd\t%1, %0\n\tstd\t%0, [%%sp-8]\n\tnop"
   [(set_attr "type" "fpsqrtd")
    (set_attr "fptype" "double")
-   (set_attr "length" "2")])
+   (set_attr "length" "3")])
 
 (define_insn "sqrtsf2"
   [(set (match_operand:SF 0 "register_operand" "=f")
-- 
2.9.3

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

* Re: [PATCH] [SPARC] Avoid b2bst errata when using -mfix-ut699
  2017-07-11  9:00 [PATCH] [SPARC] Avoid b2bst errata when using -mfix-ut699 Daniel Cederman
@ 2017-07-16 10:44 ` Eric Botcazou
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Botcazou @ 2017-07-16 10:44 UTC (permalink / raw)
  To: Daniel Cederman; +Cc: gcc-patches, sebastian.huber, davem, daniel

> 2017-07-11  Daniel Cederman  <cederman@gaisler.com>
> 
> 	* config/sparc/sparc.md (divdf3_fix): Add NOP to prevent back
> 	to back store errata sensitive sequence from being generated.
> 	(sqrtdf2_fix): Likewise.

Thanks, applied to mainline and 7 branch.

-- 
Eric Botcazou

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

end of thread, other threads:[~2017-07-16 10:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-11  9:00 [PATCH] [SPARC] Avoid b2bst errata when using -mfix-ut699 Daniel Cederman
2017-07-16 10:44 ` Eric Botcazou

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).