[PATCH] AArch64 Neon Scalar Integer Compare Instructions
mcrosier at codeaurora.org
mcrosier at codeaurora.org
Tue Oct 8 10:21:53 PDT 2013
> Hi Chad,
>
> +def int_aarch64_neon_vceqz :
> + Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
>
> Isn't this just an int_aarch64_neon_vceq with the second argument a
> constant 0?
Entirely too reasonable.. :) Let me see if I can explain where I may have
gone off course, so you can point me in the right direction.
The API documentation states there are two intrinsics for compare equal to
zero, vceqzd_<su>64, and are defined in arm_neon.h.
I made the assumption the zero operand was implicit and thus the following
is generated in arm_neon.h:
----------------------------------------------------------------------
__ai int64_t vceqzd_s64(int64_t __a) {
return (int64_t)__builtin_neon_vceqzd_s64(__a); }
__ai uint64_t vceqzd_u64(uint64_t __a) {
return (uint64_t)__builtin_neon_vceqzd_u64(__a); }
----------------------------------------------------------------------
Then in the patterns for AArch64InstrNEON.td I just add the implicit zero,
but this does require int_aarch64_neon_vceqz to be defined in
InstrinsicsAArch64.td.
Alternatively, I could add the implicit zero to Ops[] in CGBuiltin.cpp,
but for some reason that doesn't feel right either. Maybe it's fine.
The final alternative I can think of would be to add a second argument to
the builtin, which must be set to zero to match properly.
Let me know what you think.
> Possibly modelled as a NEON_VDUP for selection?
I'm not sure I follow. I'm rather new to this area.
Chad
> Cheers.
>
> Tim.
>
More information about the llvm-commits
mailing list