On Mon, Jun 17, 2013 at 6:11 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> This instruction has the predicates/constraints wrong, the r/m argument is > the middle-one, the value from which it should be extracted, rather than > the packed start/length argument. This got broken with PR50766, where the > patch hasn't touched just BMI2, but for unknown reasons also this BMI > instruction which was handled right in GCC 4.6. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.8/4.7? > > BTW, the AVX2 docs document _bextr_u{32,64} 3 argument intrinsics, rather > than the __bextr_u{32,64} 2 argument intrinsics we have in GCC right now. > Something to fix up (as the names are different, perhaps we can both the old > ones and the new ones implemented say as return __bextr_u32 (x, (y & 255) | > (z << 8)); or similar)? It looks to me that GCC's double-underscored version is wrong. We are looking for compatibility with official bmiintrin.h header. Kirill, can you please comment on this issue? > 2013-06-17 Jakub Jelinek <ja...@redhat.com> > > PR target/57623 > * config/i386/i386.md (bmi_bextr_<mode>): Swap predicates and > constraints of operand 1 and 2. > > * gcc.target/i386/bmi-bextr-3.c: New test. The fix itself looks good to me as far as insn is concerned, but please wait until the issue with builtins is resolved. Thanks, Uros.