All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 2/2] arm64: fix fls()
Date: Thu, 22 Jan 2015 15:29:07 +0100	[thread overview]
Message-ID: <20150122142907.GG97314@deinos.phlegethon.org> (raw)
In-Reply-To: <54C111A802000078000582E3@mail.emea.novell.com>

At 14:05 +0000 on 22 Jan (1421931912), Jan Beulich wrote:
> >>> On 22.01.15 at 15:01, <tim@xen.org> wrote:
> > At 13:38 +0000 on 22 Jan (1421930334), Jan Beulich wrote:
> >> It using CLZ on a 64-bit register while specifying the input operand as
> >> only 32 bits wide is wrong: An operand intentionally shrunk down to 32
> >> bits at the source level doesn't imply respective zero extension also
> >> happens at the machine instruction level, and hence the wrong result
> >> could get returned.
> >> 
> >> Add suitable inline assembly abstraction so that the function can
> >> remain shared between arm32 and arm64.
> > 
> > Would casting the asm arguments to unsigned long DTRT withuot
> > needing #ifdefs?
> 
> The input one - yes, I think so. But it wouldn't be me to introduce
> such (suspicious) casts, and I also think it is better to use 32-bit
> instruction variants where possible (which quite certainly won't
> perform worse than the 64-bit ones, but may perform better).

Ah, I had misunderstood - I thought the new runes were just enforcing
correct extension of the arguments.  Using a 32-bit instruction does
indeed sound better.

Tim.

  reply	other threads:[~2015-01-22 14:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 13:26 [PATCH 0/2] fls() / ffs() adjustments Jan Beulich
2015-01-22 13:38 ` [PATCH 1/2] make fls() and ffs() consistent across architectures Jan Beulich
2015-01-23 14:38   ` Andrew Cooper
2015-01-23 14:53     ` Jan Beulich
2015-01-22 13:38 ` [PATCH 2/2] arm64: fix fls() Jan Beulich
2015-01-22 14:01   ` Tim Deegan
2015-01-22 14:05     ` Jan Beulich
2015-01-22 14:29       ` Tim Deegan [this message]
2015-01-22 14:59 ` [PATCH 0/2] fls() / ffs() adjustments Ian Campbell

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=20150122142907.GG97314@deinos.phlegethon.org \
    --to=tim@xen.org \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.