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 10:29, Richard Guenther
<richard.guenther@gmail.com> wrote:
> 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.
>

Could you point me to which file implements these fallbacks?  I cannot
find it with grep.

An alternative to this patch would be to define the _mm_popcnt_u32 and
_mm_popcnt_u64 intrinsics in abmintrin.h.  Would that be acceptable?

Thanks,
Sebastian


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