https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64893

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can we change the arguments for __builtin_aarch64_im_lane_boundsi to take three
arguments, the two sizeof's and the idx?  And do the division inside the
compiler?  Also change the argument types of __builtin_aarch64_im_lane_boundsi
to be size_type_node instead.

Something like:

#define __AARCH64_NUM_LANES(__v) (sizeof (__v) / sizeof (__v[0]))
#define __AARCH64_LANE_CHECK(__vec, __idx)      \
        __builtin_aarch64_im_lane_boundsi (__AARCH64_NUM_LANES (__vec), __idx)

Into:
#define __AARCH64_NUM_LANES(__v) (sizeof (__v) / sizeof (__v[0]))
#define __AARCH64_LANE_CHECK(__vec, __idx)      \
        __builtin_aarch64_im_lane_boundsi (sizeof (__v), sizeof(__v[0]), __idx)


Both of these things should allow C++ to work without much work.

Reply via email to