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<int8_t, 64> Support #4

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

Add Vector<int8_t, 64> Support #4

JoshuaWierenga opened this issue Aug 22, 2021 · 0 comments

Comments

@JoshuaWierenga
Copy link
Owner

JoshuaWierenga commented Aug 22, 2021

See #2 for info.

Constructors

Vector(int32_t) => _mm_set1_pi8
Vector(int32_t, int32_t) => _mm_setr_pi8

Arithmetic Operators

operator+ => _mm_add_pi8/_m_paddb
operator- => _mm_sub_pi8/_m_psubb
operator* => convert to 2 x 16 bit vectors to access mullo?
operator/ =>
operator% =>

Bitwise Operators

operator^ => _mm_xor_si64/_m_pxor
operator| => _mm_or_si64/_m_por
operator& => _mm_and_si64/_m_pand
operator~ => _mm_andnot_si64/_m_pandn with all ones as second argument
operator<< =>
operator>> =>

"Bitwise" Operators

operator<< => insert into stream
operator>> => extract from stream

(Compound) Assignment Operators

operator= => Assignment Operator
operator+= => _mm_add_pi8/_m_paddb + Assignment
operator-= => _mm_sub_pi8/_m_psubb + Assignment
operator*= =>
operator/= =>
operator%= =>
operator&= => _mm_and_si64/_m_pand + Assignment
operator|= => _mm_or_si64/_m_por + Assignment
operator^= => _mm_xor_si64/_m_pxor + Assignment
operator<<= => convert to 2 x 16 bit vectors and use _mm_sll_pi16?
operator>>= => convert to 2 x 16 bit vectors and use _mm_srl_pi16/_mm_sra_pi16?

Comparision/Relational Operators

operator== => _mm_cmpeq_pi8/_m_pcmpeqb
operator!= => not(equal)
operator> => _mm_cmpgt_pi8/_m_pcmpgtb
operator< => and(not(equal), not(greater)) or and(not(and(equal, greater))) depends which is quicker
operator>= => and(equal, greater)
operator<= => not(greater)

Logical Operators

operator! =>
operator&& =>
operator|| =>

Variation Operators

operator++ => _mm_add_pi8/_m_paddb?
operator++(int) => _mm_add_pi8/_m_paddb?
operator-- => _mm_sub_pi8/_m_psubb?
operator--(int) => _mm_sub_pi8/_m_psubb?

Conversion Operators

operator std::array => Array Cast

static Blend => ? Actual blendv was added in sse4.1, repeated use of the unpack instructions might work.
Nope, just use or(and(a, c), andnot(b, c))

Currently unsupported/not considered functions:

_mm_adds_pi8/_m_paddsb
_mm_adds_pu8/_m_paddusb
_mm_subs_pi8/_m_psubsb
_mm_subs_pu8/_m_psubusb
_mm_set_pi8
_mm_unpackhi_pi8/_m_punpckhbw
_mm_unpacklo_pi8/_m_punpcklbw

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