public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <yunqiang.su@cipunited.com>
To: binutils@sourceware.org
Cc: syq@debian.org, macro@orcam.me.uk, xry111@xry111.site,
	richard.sandiford@arm.com, jiaxun.yang@flygoat.com,
	amodra@gmail.com, YunQiang Su <yunqiang.su@cipunited.com>
Subject: [PATCH] MIPS: fix loongson3 llsc workaround
Date: Thu, 23 Mar 2023 18:59:59 +0800	[thread overview]
Message-ID: <20230323105959.1449936-1-yunqiang.su@cipunited.com> (raw)

-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.
---
 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;
 		}
 
-- 
2.30.2


             reply	other threads:[~2023-03-23 11:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 10:59 YunQiang Su [this message]
2023-04-10  6:37 ` YunQiang Su
2023-05-11  0:00 ` Maciej W. Rozycki
2023-05-11  0:15   ` YunQiang Su

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230323105959.1449936-1-yunqiang.su@cipunited.com \
    --to=yunqiang.su@cipunited.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=macro@orcam.me.uk \
    --cc=richard.sandiford@arm.com \
    --cc=syq@debian.org \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).