Skip to content

Partially specialize simd for scoped enumerations #78

@mattkretz

Description

@mattkretz

Given simd<T, A> where T is an scoped enum (U is a shorthand for std::underlying_type_t<T>):

  • mask_type is simd<U, A>::mask_type
  • implicit broadcast ctor from T
  • explicit cvt ctor from simd<U, A> (enables explicit broadcast from U and int)
  • P????: explicit cvt ctor from simd<T1, A1>, requires simd_size_v<T, A> == simd_size_v<T1, A1>
  • generator ctor, where generator return type must be T
  • explicit load ctor and member function from const T* and const U*
  • store member function to T* and U*
  • subscript access to elements of T
  • explicit conversion operator to simd<U, A>
  • comparison operators ==, !=, <, <=, >, and >= returning mask_type
    • one of the operands has to be simd<T, A>, the other operand has to be convertible to simd<U, A> (which includes simd<T, A>)
    • program-defined non-member overloads of these operators take precedence
  • operator?:(mask_type, const simd<T, A>&, const simd<T, A>&)
    • blends two objects of type simd<T, A> (one operand can be T, because of the implicit conversion)
    • program-defined non-member overloads of the mask_type conditional operator take precedence
  • all constructors and member functions are constexpr except loads and stores
  • not defined: (can be provided by program-defined overloads)
    • compound assignment
    • increment and decrement
    • unary and binary (except comparison) operators

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions