* [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences
2017-11-27 10:04 [PATCH 0/2] [SPARC] Fixes for UT699 errata workaround Daniel Cederman
@ 2017-11-27 10:04 ` Daniel Cederman
2017-11-28 10:24 ` Eric Botcazou
2017-12-05 11:20 ` Eric Botcazou
2017-11-27 10:31 ` [PATCH 2/2] [SPARC] Recognize the load when accessing the GOT Daniel Cederman
1 sibling, 2 replies; 8+ messages in thread
From: Daniel Cederman @ 2017-11-27 10:04 UTC (permalink / raw)
To: gcc-patches; +Cc: ebotcazou, sebastian.huber, daniel
The sequence
st
fdivd / fsqrtd
std
was generated in some cases with -mfix-ut699 when there was
a st before the div/sqrt. This sequence could trigger the b2bst errata.
Now the following safe sequence is generated instead:
st
nop
fdivd / fsqrtd
std
gcc/ChangeLog:
2017-11-27 Martin Aberg <maberg@gaisler.com>
* config/sparc/sparc.md (divdf3_fix): Add NOP and adjust length
to prevent b2bst errata sequence.
(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 0e45509..18d77bb 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -6221,10 +6221,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]\n\tnop"
+ "fdivd\t%1, %2, %0\n\tnop\n\tstd\t%0, [%%sp-8]\n\tnop"
[(set_attr "type" "fpdivd")
(set_attr "fptype" "double")
- (set_attr "length" "3")])
+ (set_attr "length" "4")])
(define_insn "divsf3"
[(set (match_operand:SF 0 "register_operand" "=f")
@@ -6473,10 +6473,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]\n\tnop"
+ "fsqrtd\t%1, %0\n\tnop\n\tstd\t%0, [%%sp-8]\n\tnop"
[(set_attr "type" "fpsqrtd")
(set_attr "fptype" "double")
- (set_attr "length" "3")])
+ (set_attr "length" "4")])
(define_insn "sqrtsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/2] [SPARC] Fixes for UT699 errata workaround
@ 2017-11-27 10:04 Daniel Cederman
2017-11-27 10:04 ` [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences Daniel Cederman
2017-11-27 10:31 ` [PATCH 2/2] [SPARC] Recognize the load when accessing the GOT Daniel Cederman
0 siblings, 2 replies; 8+ messages in thread
From: Daniel Cederman @ 2017-11-27 10:04 UTC (permalink / raw)
To: gcc-patches; +Cc: ebotcazou, sebastian.huber, daniel
Hello,
This patch series adds two fixes for the UT699 errata workaround.
Daniel Cederman (2):
[SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences
[SPARC] Recognize the load when accessing the GOT
gcc/config/sparc/sparc.c | 8 +++++++-
gcc/config/sparc/sparc.md | 8 ++++----
2 files changed, 11 insertions(+), 5 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] [SPARC] Recognize the load when accessing the GOT
2017-11-27 10:04 [PATCH 0/2] [SPARC] Fixes for UT699 errata workaround Daniel Cederman
2017-11-27 10:04 ` [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences Daniel Cederman
@ 2017-11-27 10:31 ` Daniel Cederman
2017-11-28 10:40 ` Eric Botcazou
1 sibling, 1 reply; 8+ messages in thread
From: Daniel Cederman @ 2017-11-27 10:31 UTC (permalink / raw)
To: gcc-patches; +Cc: ebotcazou, sebastian.huber, daniel
Needed for the UT699 errata workaround to function correctly when
compiling with -fPIC.
gcc/ChangeLog:
2017-11-27 Daniel Cederman <cederman@gaisler.com>
* config/sparc/sparc.c (sparc_do_work_around_errata): Treat the
movsi_pic_gotdata_op instruction as a load for the UT699 errata
workaround.
---
gcc/config/sparc/sparc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 6e91114..8b11c1a 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -1321,7 +1321,8 @@ sparc_do_work_around_errata (void)
&& NONJUMP_INSN_P (insn)
&& (set = single_set (insn)) != NULL_RTX
&& GET_MODE_SIZE (GET_MODE (SET_SRC (set))) <= 4
- && mem_ref (SET_SRC (set)) != NULL_RTX
+ && (mem_ref (SET_SRC (set)) != NULL_RTX
+ || INSN_CODE (insn) == CODE_FOR_movsi_pic_gotdata_op)
&& REG_P (SET_DEST (set))
&& REGNO (SET_DEST (set)) < 32)
{
@@ -1359,6 +1360,11 @@ sparc_do_work_around_errata (void)
&& REGNO (src) != REGNO (x)))
&& !reg_mentioned_p (x, XEXP (dest, 0)))
insert_nop = true;
+
+ /* GOT accesses uses LD. */
+ else if (INSN_CODE (next) == CODE_FOR_movsi_pic_gotdata_op
+ && !reg_mentioned_p (x, XEXP (XEXP (src, 0), 1)))
+ insert_nop = true;
}
}
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences
2017-11-27 10:04 ` [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences Daniel Cederman
@ 2017-11-28 10:24 ` Eric Botcazou
2017-12-05 11:20 ` Eric Botcazou
1 sibling, 0 replies; 8+ messages in thread
From: Eric Botcazou @ 2017-11-28 10:24 UTC (permalink / raw)
To: Daniel Cederman; +Cc: gcc-patches, sebastian.huber, daniel
> 2017-11-27 Martin Aberg <maberg@gaisler.com>
>
> * config/sparc/sparc.md (divdf3_fix): Add NOP and adjust length
> to prevent b2bst errata sequence.
> (sqrtdf2_fix): Likewise.
OK for mainline and 7 branch, thanks.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] [SPARC] Recognize the load when accessing the GOT
2017-11-27 10:31 ` [PATCH 2/2] [SPARC] Recognize the load when accessing the GOT Daniel Cederman
@ 2017-11-28 10:40 ` Eric Botcazou
0 siblings, 0 replies; 8+ messages in thread
From: Eric Botcazou @ 2017-11-28 10:40 UTC (permalink / raw)
To: Daniel Cederman; +Cc: gcc-patches, sebastian.huber, daniel
> 2017-11-27 Daniel Cederman <cederman@gaisler.com>
>
> * config/sparc/sparc.c (sparc_do_work_around_errata): Treat the
> movsi_pic_gotdata_op instruction as a load for the UT699 errata
> workaround.
OK for mainline, 7 and 6 branches, thanks.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences
2017-11-27 10:04 ` [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences Daniel Cederman
2017-11-28 10:24 ` Eric Botcazou
@ 2017-12-05 11:20 ` Eric Botcazou
2017-12-05 12:26 ` Daniel Cederman
1 sibling, 1 reply; 8+ messages in thread
From: Eric Botcazou @ 2017-12-05 11:20 UTC (permalink / raw)
To: Daniel Cederman; +Cc: gcc-patches, sebastian.huber, daniel
> The sequence
> st
> fdivd / fsqrtd
> std
> was generated in some cases with -mfix-ut699 when there was
> a st before the div/sqrt. This sequence could trigger the b2bst errata.
>
> Now the following safe sequence is generated instead:
> st
> nop
> fdivd / fsqrtd
> std
>
> gcc/ChangeLog:
>
> 2017-11-27 Martin Aberg <maberg@gaisler.com>
>
> * config/sparc/sparc.md (divdf3_fix): Add NOP and adjust length
> to prevent b2bst errata sequence.
> (sqrtdf2_fix): Likewise.
But isn't that the change I already rejected back in July?
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00496.html
If so, what has changed since then? If nothing, then please revert.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences
2017-12-05 11:20 ` Eric Botcazou
@ 2017-12-05 12:26 ` Daniel Cederman
2017-12-06 8:38 ` Eric Botcazou
0 siblings, 1 reply; 8+ messages in thread
From: Daniel Cederman @ 2017-12-05 12:26 UTC (permalink / raw)
To: Eric Botcazou; +Cc: gcc-patches, sebastian.huber, daniel
> But isn't that the change I already rejected back in July?
You are right, that was a mistake from our side to submit it again. We
had rediscovered the sequence using our scanning script and I forgot
that the sequence was harmless in this case. We will update our scripts
and revert the patch.
The person here with write access, danielh, is currently traveling, so
we wont be able to revert it until next week. If it is urgent, could I
ask you to revert it for us?
Thanks for checking the patches in detail and for improving the formating.
/Daniel C
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences
2017-12-05 12:26 ` Daniel Cederman
@ 2017-12-06 8:38 ` Eric Botcazou
0 siblings, 0 replies; 8+ messages in thread
From: Eric Botcazou @ 2017-12-06 8:38 UTC (permalink / raw)
To: Daniel Cederman; +Cc: gcc-patches, sebastian.huber, daniel
> You are right, that was a mistake from our side to submit it again. We
> had rediscovered the sequence using our scanning script and I forgot
> that the sequence was harmless in this case. We will update our scripts
> and revert the patch.
OK, thanks in advance.
> The person here with write access, danielh, is currently traveling, so
> we wont be able to revert it until next week. If it is urgent, could I
> ask you to revert it for us?
It's not that urgent of course but I've reverted it.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-12-06 8:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 10:04 [PATCH 0/2] [SPARC] Fixes for UT699 errata workaround Daniel Cederman
2017-11-27 10:04 ` [PATCH 1/2] [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences Daniel Cederman
2017-11-28 10:24 ` Eric Botcazou
2017-12-05 11:20 ` Eric Botcazou
2017-12-05 12:26 ` Daniel Cederman
2017-12-06 8:38 ` Eric Botcazou
2017-11-27 10:31 ` [PATCH 2/2] [SPARC] Recognize the load when accessing the GOT Daniel Cederman
2017-11-28 10:40 ` 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).