Runtime: Question: Equivalent for Avx2.CompareLessThan

Created on 11 Jan 2020  路  2Comments  路  Source: dotnet/runtime

There is no Avx2.CompareLessThan(Vector256, Vector256). I am able to get the opposite mask and would only need to reverse it but there is also no instruction to do that(?). Is there a way to achieve an equivalent to ComparelessThan or a way to reverse a mask I have?

var v1 = Vector256<sbyte>.Create(...)
var v2 = Vector256<sbyte>.Create(...)

var mask = Avx2.Or(Avx2.CompareGreaterThan(v1, v2),
            Avx2.CompareEqual(v1, v2));
mask = // reverse mask?
untriaged

Most helpful comment

um... isn't Avx2.CompareGreaterThan(v2, v1) what you need?

even in C they have:

#define _mm256_cmplt_epi8(a, b) _mm256_cmpgt_epi8(b, a)

All 2 comments

um... isn't Avx2.CompareGreaterThan(v2, v1) what you need?

even in C they have:

#define _mm256_cmplt_epi8(a, b) _mm256_cmpgt_epi8(b, a)

um.... 馃ぃ => Closed, oh and thank you

Was this page helpful?
0 / 5 - 0 ratings