public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: "Carlos O'Donell" <carlos@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	Andreas Schwab <schwab@linux-m68k.org>,
	"Carlos O'Donell via Libc-alpha" <libc-alpha@sourceware.org>
Subject: [PATCH v6] x86_64: Correct THREAD_SETMEM/THREAD_SETMEM_NC for movq [BZ #27591]
Date: Tue, 16 Mar 2021 09:50:58 -0700	[thread overview]
Message-ID: <CAMe9rOpf9F4cfGFfe_Sn1KWzykdUyJAWHVMkdZtcWEgvBgaJuQ@mail.gmail.com> (raw)
In-Reply-To: <c0f01ddb-4538-d223-fceb-7975974a53d5@redhat.com>

On Tue, Mar 16, 2021 at 9:34 AM Carlos O'Donell <carlos@redhat.com> wrote:
>
> On 3/16/21 12:10 PM, Florian Weimer via Libc-alpha wrote:
> > * Andreas Schwab:
> >
> >> I don't think this will work in general.  Wouldn't it be possible that
> >> an operands optimizes to a 64-bit constant in later passes?  What you
> >> really need is a constraint that only matches a 32-bit immediate or a
> >> register.  Like "rWf"?

config/i386/constraints.md in GCC has

(define_constraint "e"
  "32-bit signed integer constant, or a symbolic reference known
   to fit that range (for immediate operands in sign-extending x86-64
   instructions)."
  (match_operand 0 "x86_64_immediate_operand"))

"er" is the correct constraint for movq.

> > Maybe we should to the __seg_fs namespace instead?  Wouldn't that avoid
> > these issues?
>
> It might.
>
> HJ, Does it work to rewrite this using __seg_fs?

I tried it.  GCC generates worse code.

> Otherwise I'll review v5, which I think is better than it was before and
> makes forward progress.

Here is the v6 patch to use the "er" constraint.   OK for master?

Thanks.


-- 
H.J.

  reply	other threads:[~2021-03-16 16:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 19:12 [PATCH] x86_64: Update THREAD_SETMEM/THREAD_SETMEM_NC for IMM64 H.J. Lu
2021-03-01 13:30 ` Carlos O'Donell
2021-03-02 14:21   ` [PATCH v2] " H.J. Lu
2021-03-08 22:28     ` Carlos O'Donell
2021-03-09  0:09       ` [PATCH v3] " H.J. Lu
2021-03-15 12:49         ` Carlos O'Donell
2021-03-15 13:29           ` [PATCH v4] " H.J. Lu
2021-03-16  3:01             ` Carlos O'Donell
2021-03-16  9:04               ` Andreas Schwab
2021-03-16 15:45                 ` [PATCH v5] x86_64: Update THREAD_SETMEM/THREAD_SETMEM_NC for IMM64 [BZ #27591] H.J. Lu
2021-03-16 16:02                   ` Andreas Schwab
2021-03-16 16:10                     ` Florian Weimer
2021-03-16 16:34                       ` Carlos O'Donell
2021-03-16 16:50                         ` H.J. Lu [this message]
2021-03-16 16:52                           ` [PATCH v6] x86_64: Correct THREAD_SETMEM/THREAD_SETMEM_NC for movq " H.J. Lu
2021-03-19 18:35 H.J. Lu
2021-04-01 13:51 ` Carlos O'Donell

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=CAMe9rOpf9F4cfGFfe_Sn1KWzykdUyJAWHVMkdZtcWEgvBgaJuQ@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /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).