This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] x86: emit tzcnt unconditionally
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 30 Apr 2012 10:09:33 +0200
- Subject: Re: [PATCH] x86: emit tzcnt unconditionally
- References: <1335533422-11066-1-git-send-email-bonzini@gnu.org>
On Fri, Apr 27, 2012 at 3:30 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> tzcnt is encoded as "rep;bsf" and unlike lzcnt is a drop-in replacement
> if we don't care about the flags (it has the same semantics for non-zero
> values).
>
> Since bsf is usually slower, just emit tzcnt unconditionally. ?However,
> write it as rep;bsf unless -mbmi is in use, to cater for old assemblers.
Please emit "rep;bsf" when optimize_insn_for_speed_p () is true.
> Bootstrapped on a non-BMI x86_64-linux host, regtest in progress.
> Ok for mainline?
OK with the optimize_insn_for_speed_p conditional.
Thanks,
Uros.