On Tue, Jun 18, 2013 at 11:51 AM, 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?
>
> Well, bmiintrin.h has been added first as an AMD ISA extension, and I think 
> for
> AMD extensions the GCC headers are the official place (the AMD docs don't
> mention the intrinsics at all), and only later on also added as Intel ISA
> extension.  So I'd say it is fine to keep the __bextr_* variants (as written
> in the PR, sometimes the two argument ones can be useful if you e.g.
> precompute the start/length pairs ahead of time) and just add the one
> underscored ones to match ICC/AVX2 documentation.

I agree with this proposal, but probably we need to review the whole
bmiintrin.h for intel additions.

Uros.

Reply via email to