public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Michal Moskal <malekith@pld.org.pl>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gcc-3.1 ffs problem, kernel 2.4.18
Date: Tue, 2 Apr 2002 14:59:55 -0800	[thread overview]
Message-ID: <20020402145955.A12932@twiddle.net> (raw)
In-Reply-To: <20020320174238.GA13533@ep09.kernel.pl> <20020328211025.A30037@twiddle.net> <20020329115731.GA3227@ep09.kernel.pl> <20020329144232.A495@twiddle.net> <20020402114848.GA9004@ep09.kernel.pl>

On Tue, Apr 02, 2002 at 01:48:48PM +0200, Michal Moskal wrote:
> Could you please check if it compiles for you?

Ah, I see the bug.  I was looking at ffz (which is correct),
not ffs (which isn't).

> 	__asm__("bsfl %1,%0\n\t"
> 		"jnz 1f\n\t"
> 		"movl $-1,%0\n"
> 		"1:" : "=r" (r) : "g" (x));

The problem is                    ^^^

That sez any of register, memory, or immediate is ok.
It should be "r" instead, just like in ffz.

That said, we should probably be using __builtin_ffs
instead.  The compiler knows how to do bsfl plus the
adjustment.  Plus, it knows how to evaluate it at
compile-time for constants.


r~

  parent reply	other threads:[~2002-04-02 23:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-20 17:42 [PATCH] gcc-3.1 ffs problem, kernel 2.4.18 Michal Moskal
2002-03-29  5:10 ` Richard Henderson
     [not found]   ` <20020329115731.GA3227@ep09.kernel.pl>
     [not found]     ` <20020329144232.A495@twiddle.net>
     [not found]       ` <20020402114848.GA9004@ep09.kernel.pl>
2002-04-02 22:59         ` Richard Henderson [this message]
2002-04-03  0:04           ` Linus Torvalds
2002-04-03 11:00             ` Richard Henderson

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=20020402145955.A12932@twiddle.net \
    --to=rth@twiddle.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malekith@pld.org.pl \
    --cc=torvalds@transmeta.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