SVE types are defined to be opaque built-in types that by default
can only be used via intrinsics. One consequence of this is that
the types provide no built-in versions of the unary and binary
Instead, we'd like to allow users to define non-member operators
for SVE types, in much the same way as for enumeration types.
This specifically means:
* replacing "enumeration" in sections [over.match.oper] and [over.oper]
of the C++ standard with wording that includes both enumerations and
* extending the enumeration handling of operator= in [over.built]
to include SVE types.
This feature is defined by a to-be-published update to the SVE ACLE spec.
The feature is optional and its availability can be tested by the
An alternative would be to build the operators into the compiler.
However, we didn't want to do that for several reasons:
* Some of the operators would not be performance-portable.
(E.g. %, and the 8-bit and 16-bit integer versions of /.)
The SVE ACLE is supposed to be a low-level, almost asm-level
interface to the architecture, so synthesising this kind of
operation seems out-of-place.
* SVE types cannot be used in structures, so unlike with normal vector
types, the user doesn't have the option of using a wrapper class to
opt out of the standard handling.
* If in future we do want to provide a core group of operators in a
standard header file/module, we could use this extension to write it.
The patch triggers a duplicate warning for:
ref_int8 = ref_int8;
but it seemed better to fix that separately.