This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Move the popcnt intrinsics to a separate file


On Mon, Nov 30, 2009 at 5:23 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> Hi,
>
> The attached patch moves __popcntd, __popcntq, _popcnt64, _popcnt32,
> _mm_popcnt_u32, and _mm_popcnt_u64 to a separate file popcount.h.
> popcount.h is then included in abmintrin.h and smmintrin.h.
>
> The rationale behind this change is that ia32intrin.h is included by
> default in x86intrin.h without any architecture checks, and so
> ia32intrin.h is too general for the popcnt instructions: e.g., k8 does
> not have popcnt instructions, and currently we would have these
> intrinsics defined even for k8.

But GCC has fallback implementations in libgcc.

Richard.

> 2009-11-19 ?Sebastian Pop ?<sebastian.pop@amd.com>
>
> ? ? ? ?* config.gcc (extra_headers): Add abmintrin.h and popcount.h for
> ? ? ? ?i[34567]86-*-* and x86_64-*-*.
> ? ? ? ?* config/i386/abmintrin.h: New.
> ? ? ? ?* config/i386/i386-c.c (ix86_target_macros_internal): Defined __ABM__.
> ? ? ? ?* config/i386/ia32intrin.h (__popcntd, __popcntq, _popcnt64,
> ? ? ? ?_popcnt32): Moved...
> ? ? ? ?* config/i386/popcount.h: ...here. ?New file.
> ? ? ? ?* config/i386/smmintrin.h: Include popcount.h.
> ? ? ? ?(_mm_popcnt_u32, _mm_popcnt_u64): Moved to popcount.h.
> ? ? ? ?* config/i386/x86intrin.h: Include abmintrin.h when __ABM__ is defined.
>
> Bootstrapped and tested on amd64-linux. ?Ok for trunk?
>
> Thanks,
> Sebastian Pop
> --
> AMD / Open Source Compiler Engineering / GNU Tools
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]