Re: [PATCH] x86: emit tzcnt unconditionally

2012-05-07 Thread Uros Bizjak
On Mon, May 7, 2012 at 10:00 AM, Jakub Jelinek wrote: >> > Shouldn't that be done only for generic tuning?  If somebody uses >> > -mtune=native, then emitting rep; bsf is overkill, the code is intended >> > to be run on a CPU without (or with TARGET_BMI with) tzcnt insn support. >> >> Yes, this i

Re: [PATCH] x86: emit tzcnt unconditionally

2012-05-07 Thread Jakub Jelinek
On Mon, May 07, 2012 at 09:36:38AM +0200, Uros Bizjak wrote: > On Mon, May 7, 2012 at 7:43 AM, Jakub Jelinek wrote: > > >> Index: i386.md > >> === > >> --- i386.md   (revision 187217) > >> +++ i386.md   (working copy) > >> @@ -12112,

Re: [PATCH] x86: emit tzcnt unconditionally

2012-05-07 Thread Uros Bizjak
On Mon, May 7, 2012 at 7:43 AM, Jakub Jelinek wrote: >> Index: i386.md >> === >> --- i386.md   (revision 187217) >> +++ i386.md   (working copy) >> @@ -12112,9 +12112,22 @@ >>     (set (match_operand:SWI48 0 "register_operand" "=r")

Re: [PATCH] x86: emit tzcnt unconditionally

2012-05-06 Thread Jakub Jelinek
On Mon, May 07, 2012 at 01:04:33AM +0200, Uros Bizjak wrote: > Index: i386.md > === > --- i386.md (revision 187217) > +++ i386.md (working copy) > @@ -12112,9 +12112,22 @@ > (set (match_operand:SWI48 0 "register_operand" "=r")

Re: [PATCH] x86: emit tzcnt unconditionally

2012-05-06 Thread Uros Bizjak
On Mon, Apr 30, 2012 at 10:09 AM, Uros Bizjak wrote: > On Fri, Apr 27, 2012 at 3:30 PM, Paolo Bonzini 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 usuall

Re: [PATCH] x86: emit tzcnt unconditionally

2012-04-30 Thread Uros Bizjak
On Fri, Apr 27, 2012 at 3:30 PM, Paolo Bonzini 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

[PATCH] x86: emit tzcnt unconditionally

2012-04-27 Thread Paolo Bonzini
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.