mattkretz / wg21-papers

my papers to WG21 — the C++ committee
5 stars 7 forks source link

Add aliases for native, compatible, and fixed_size datapar & mask #24

Closed mattkretz closed 7 years ago

mattkretz commented 7 years ago

Since the native and compatible ABI aliases require a T parameter and fixed_size requires the N parameter, the non-default types spell out rather longish. I like to use the following aliases:

template <class T> using native_datapar = datapar<T, datapar_abi::native<T>>;
template <class T> using compatible_datapar = datapar<T, datapar_abi::compatible<T>>;
template <class T, size_t N> using fixed_size_datapar = datapar<T, datapar_abi::fixed_size<N>>;
mattkretz commented 7 years ago

@jensmaurer Any objection to adding this?

jensmaurer commented 7 years ago

I don't see a need why the native and compatible ABI tags have to take the "T". After all, they're just tags. All fancy dispatching can be done within the definition of datapar or mask.

That said, no objection to adding the aliases.

mattkretz commented 7 years ago

Because native might mean avx for floating point and sse for integers. And actually scalar for long double (also for compatible). native and compatible are not meant as tags on their own. They are aliases for implementation-defined ABI tags.

jensmaurer commented 7 years ago

Ah, right, we want binary ABI compatibility across subarchitectures.