This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Move the popcnt intrinsics to a separate file
- From: Sebastian Pop <sebpop at gmail dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>, Uros Bizjak <ubizjak at gmail dot com>, Jan Hubicka <jh at suse dot cz>, Richard Henderson <rth at redhat dot com>, "Harle, Christophe" <christophe dot harle at amd dot com>
- Date: Mon, 30 Nov 2009 11:44:45 -0600
- Subject: Re: [patch] Move the popcnt intrinsics to a separate file
- References: <cb9d34b20911300823m113ebd5dyd67a5b3829ea6a60@mail.gmail.com> <84fc9c000911300829n625f23b1s4a2116327e123c4c@mail.gmail.com>
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