public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] MIPS: fix loongson3 llsc workaround
@ 2023-04-23  6:53 YunQiang Su
  0 siblings, 0 replies; only message in thread
From: YunQiang Su @ 2023-04-23  6:53 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=af989297316ec7628f1ddffc621932805a464b1d

commit af989297316ec7628f1ddffc621932805a464b1d
Author: YunQiang Su <yunqiang.su@cipunited.com>
Date:   Thu Mar 23 18:49:23 2023 +0800

    MIPS: fix loongson3 llsc workaround
    
    -mfix-looongson3-llsc may add sync instructions not needed on some
    asm code with lots of debug info.
    
            PR: 30153
            * gas/config/tc-mips.c(fix_loongson3_llsc): clear logistic.

Diff:
---
 gas/config/tc-mips.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index e911aaa904a..8a970ceada2 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -6942,10 +6942,6 @@ fix_loongson3_llsc (struct mips_cl_insn * ip)
       unsigned long lookback = ARRAY_SIZE (history);
       for (i = 0; i < lookback; i++)
 	{
-	  if (streq (history[i].insn_mo->name, "ll")
-	      || streq (history[i].insn_mo->name, "lld"))
-	    break;
-
 	  if (streq (history[i].insn_mo->name, "sc")
 	      || streq (history[i].insn_mo->name, "scd"))
 	    {
@@ -6953,8 +6949,8 @@ fix_loongson3_llsc (struct mips_cl_insn * ip)
 
 	      for (j = i + 1; j < lookback; j++)
 		{
-		  if (streq (history[i].insn_mo->name, "ll")
-		      || streq (history[i].insn_mo->name, "lld"))
+		  if (streq (history[j].insn_mo->name, "ll")
+		      || streq (history[j].insn_mo->name, "lld"))
 		    break;
 
 		  if (delayed_branch_p (&history[j]))
@@ -6993,7 +6989,7 @@ fix_loongson3_llsc (struct mips_cl_insn * ip)
 	      for (j = i + 1; j < lookback; j++)
 		{
 		  if (streq (history[j].insn_mo->name, "ll")
-		      || streq (history[i].insn_mo->name, "lld"))
+		      || streq (history[j].insn_mo->name, "lld"))
 		    break;
 		}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-23  6:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-23  6:53 [binutils-gdb] MIPS: fix loongson3 llsc workaround YunQiang Su

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