sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Larsson <andreas@gaisler.com>
To: Koakuma <koachan@protonmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH v2] sparc/vdso: Add helper function for 64-bit right shift on 32-bit target
Date: Mon, 18 Nov 2024 09:56:44 +0100	[thread overview]
Message-ID: <0963a508-6014-43e4-b64c-89b09538b68e@gaisler.com> (raw)
In-Reply-To: <gecz9pMRccdD2v_dImhonTGStG4FmiUko8IM2fkc9Rh2thw_QuSOvlsYTspZSf9bjtidQOD2uVL2aSaQ29-neWABRm1cpyXQr6xV0wELTU0=@protonmail.com>

On 2024-11-17 00:44, Koakuma wrote:
> Andreas Larsson <andreas@gaisler.com> wrote:
>> Koakuma via B4 Relay wrote:
>>> +notrace static __always_inline u64 __shr64(u64 val, int amt)
>>> +{
>>> + u64 ret;
>>> +
>>> + asm volatile("sllx %H1, 32, %%g1\n\t"
>>> + "srl %L1, 0, %L1\n\t"
>>> + "or %%g1, %L1, %%g1\n\t"
>>> + "srlx %%g1, %2, %L0\n\t"
>>> + "srlx %L0, 32, %H0"
>>> + : "=r" (ret)
>>> + : "r" (val), "r" (amt)
>>> + : "g1");
>>> + return ret;
>>> +}
>>
>> Can not residual in bits 63:32 of %L0 potentially pose a problem?
> 
> It shouldn't be a problem, upon returning the caller should treat
> the upper bits of %L0 as an unspecified value and not depend on/use
> its contents.

Yes, of course. Lapse of logic on my part.

Reviewed-by: Andreas Larsson <andreas@gaisler.com>

Picking this up to my for-next.

Thanks,
Andreas

      reply	other threads:[~2024-11-18  8:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08  2:05 [PATCH v2] sparc/vdso: Add helper function for 64-bit right shift on 32-bit target Koakuma via B4 Relay
2024-10-21  6:54 ` Koakuma
2024-11-16  8:50 ` Andreas Larsson
2024-11-16 23:44   ` Koakuma
2024-11-18  8:56     ` Andreas Larsson [this message]

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=0963a508-6014-43e4-b64c-89b09538b68e@gaisler.com \
    --to=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=justinstitt@google.com \
    --cc=koachan@protonmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=luto@kernel.org \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    /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 NNTP newsgroup(s).