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

Add Vector<int32_t, 64> Support #2

Open
JoshuaWierenga opened this issue Aug 22, 2021 · 0 comments
Open

Add Vector<int32_t, 64> Support #2

JoshuaWierenga opened this issue Aug 22, 2021 · 0 comments

Comments

@JoshuaWierenga
Copy link
Owner

The current plan is to take the existing structure and totally redo supported operations for initially just Vector<int32_t, 64> but in such a way that supporting both other types and vector sizes is easier than it is currently. Ideally, some effort will be taken to ensure that whatever is done don't rule out floating-point types at a later point.

Below is a list of simd functions I have I looked at and how they map to relevant c++ operators, there are lots of gaps currently.

Functions already supported but of course modified to match new vector size:
// Constructors
Vector(int32_t) => _mm_set1_pi32
Vector(int32_t, int32_t) => _mm_setr_pi32

static Blend => ? Actual blendv was added in sse4.1

// "Bitwise" Operators
operator<< => insert into stream

// (Compound) Assignment Operators
operator+= => _mm_add_pi32 / _m_paddd + Assignment

// Comparision/Relational Operators
operator> => _mm_cmpgt_pi32 / _m_pcmpgtd

New Functions:
// Arithmetic Operators
operator+ => _mm_add_pi32 / _m_paddd
operator- => _mm_sub_pi32 / _m_psubd
operator* =>
operator/ =>
operator% =>

// Bitwise Operators
operator^ =>
operator| =>
operator& =>
operator~ =>
operator<< =>
operator>> =>

// "Bitwise" Operators
operator>> => extract from stream

// (Compound) Assignment Operators
operator= => Assignment Operator
operator-= => _mm_sub_pi32 / _m_psubd + Assignment
operator*= =>
operator/= =>
operator%= =>
operator&= =>
operator|= =>
operator^= =>
operator<<= => either _mm_sll_pi32 / _m_pslld or _mm_slli_pi32 / _m_pslldi
operator>>= => one of _mm_sra_pi32 / _m_psrad, _mm_srai_pi32 / _m_psradi, _mm_srl_pi32 / _m_psrld and _mm_srli_pi32 / _m_psrldi

// Variation Operators
operator++ =>
operator++(int) =>
operator-- =>
operator--(int) =>

// Comparision/Relational Operators
operator== => _mm_cmpeq_pi32 / _m_pcmpeqd
operator!= =>
operator< =>
operator>= =>
operator<= =>

// Logical Operators
operator! =>
operator&& =>
operator|| =>

// Conversion Operators
operator std::array => Array Cast++

Currently unsupported/not considered functions:
_mm_set_pi32
_mm_cvtsi32_si64
_m_from_int
_mm_packs_pi32
_m_packssdw
_m_punpckhdq
_m_punpckldq
int _m_to_int
_mm_unpackhi_pi32
_mm_unpacklo_pi32

@JoshuaWierenga JoshuaWierenga transferred this issue from JoshuaWierenga/VariableSizedVectors Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant