public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Cary Coutant <ccoutant@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Cary Coutant via Binutils <binutils@sourceware.org>,
	Vladislav Khmelevsky <och95@yandex.ru>
Subject: Re: [PATCH] gold/aarch64: Fix adrp distance check
Date: Fri, 29 Jul 2022 15:14:25 -0700	[thread overview]
Message-ID: <CAJimCsE=EYscn5hGT43=VGk=6GFWm=STqCXvbj-iggcQQMpJNQ@mail.gmail.com> (raw)
In-Reply-To: <87a68r8x9l.fsf@igel.home>

> > The cast is unnecessary here for assignment to an int64_t. Once the
> > result is in a signed int, I don't think you need to go to all that
> > extra trouble to shift it.
>
> Note that right shifting a negative value is fully defined only in C++20
> and later.

Yes, you're right, thanks. I was tempted to say that every compiler we
care about does that as an arithmetic shift, but of course that's
careless. Then I saw that the arm-gcc compiler translates that ?:
idiom into a single "asr" instruction. Kinda suggests we should have
an ASR macro somewhere common.

Still, the static cast is unnecessary, and I see no need to introduce
the temporary "offset" instead of "adrp_imm".

-cary

  reply	other threads:[~2022-07-29 22:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25 17:52 Vladislav Khmelevsky
2022-07-29 20:14 ` Cary Coutant
2022-07-29 20:44   ` Andreas Schwab
2022-07-29 22:14     ` Cary Coutant [this message]
2022-08-08 19:18       ` Vladislav Khmelevsky
2022-11-07 11:28 Vladislav Khmelevsky
2022-11-11  0:49 ` Cary Coutant

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='CAJimCsE=EYscn5hGT43=VGk=6GFWm=STqCXvbj-iggcQQMpJNQ@mail.gmail.com' \
    --to=ccoutant@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=och95@yandex.ru \
    --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).