Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partially specialize simd for unscoped enumerations #77

Open
8 of 15 tasks
mattkretz opened this issue Mar 4, 2020 · 0 comments
Open
8 of 15 tasks

Partially specialize simd for unscoped enumerations #77

mattkretz opened this issue Mar 4, 2020 · 0 comments
Labels
needs discussion Needs discussion in the paper

Comments

@mattkretz
Copy link
Owner

mattkretz commented Mar 4, 2020

Given simd<T, A> where T is an unscoped 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
  • unary operators !, +, and -, defined in such a way that program-defined non-member overloads of those operators take precedence. ! returns mask_type, + and - return simd<U, A>.
  • implicit conversion operator to simd<U, A>
  • binary operators +, -, *, /, %, &, |, ^, <<, >>, ==, !=, <, <=, >, and >=
    • all comparison operators return mask_type, the remaining binary operators return simd<U, A>
    • 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
  • additional overloads for << and >> where the type of the second operand is int
  • operator?: overloads for bool and mask_type
    • the bool overload is short-circuiting and defines simd<U, A> as the common type for simd<T, A> and any type convertible to simd<U, A>
    • the mask_type overload blends two objects of type simd<T, A>.
    • 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
@mattkretz mattkretz added the needs discussion Needs discussion in the paper label Mar 4, 2020
@mattkretz mattkretz added this to the pre-Varna Mailing milestone Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Needs discussion in the paper
Projects
None yet
Development

No branches or pull requests

1 participant