[patch] Move the popcnt intrinsics to a separate file

Sebastian Pop sebpop@gmail.com
Mon Dec 7 18:58:00 GMT 2009


On Fri, Dec 4, 2009 at 14:41, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Dec 04, 2009 at 11:47:33AM -0600, Sebastian Pop wrote:
>> In my opinion the _mm_popcnt_u* intrinsics should be removed from the
>> smmintrin.h, as they do not deal with XMM registers, and they should
>> be put separately in a popcount.h file, as I originally proposed, and
>> then include that file in abmintrin.h and somewhere else than smmintrin.h
>> for Intel processors.
>
> BTW, isn't popcount.h too generic header name (and likely to clash with
> other package's headers)?  Wouldn't popcntintrin.h or something similar be
> better?

Ok.

In the manuals from both Intel and AMD, an identification bit is set
by cpuid on processors containing the popcnt insn.  I would like to
propose the attached fixes that define __POPCNT__, include the
popcntintrin.h both in smmintrin.h and x86intrin.h, and add the cpuid
checks for ABM and LWP.

The patch set passes make -k check RUNTESTFLAGS=i386.exp
Ok for trunk after it passes bootstrap and regtest?

Thanks,
Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-_mm_popcnt-intrinsics.patch
Type: text/x-patch
Size: 6148 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091207/f78c55c2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-ABM.patch
Type: text/x-patch
Size: 5010 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091207/f78c55c2/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Check-cpuid-ABM-bit.patch
Type: text/x-patch
Size: 2104 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091207/f78c55c2/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Check-cpuid-LWP-bit.patch
Type: text/x-patch
Size: 1594 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091207/f78c55c2/attachment-0003.bin>


More information about the Gcc-patches mailing list