Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SIMD (AVX) compare

Tags:

c

gcc

simd

sse

What is the name of gcc's intrinsic for comparing __m256 and __m256i (AVX instruction set)?

like image 780
Cartesius00 Avatar asked Feb 17 '12 19:02

Cartesius00


People also ask

What is AVX in SIMD?

AVX uses sixteen YMM registers to perform a single instruction on multiple pieces of data (see SIMD). Each YMM register can hold and do simultaneous operations (math) on: eight 32-bit single-precision floating point numbers or. four 64-bit double-precision floating point numbers.

What is SSE AVX?

SSE (streaming SIMD extensions) and AVX (advanced vector extensions) are SIMD (single instruction multiple data streams) instruction sets supported by recent CPUs manufactured in Intel and AMD.


1 Answers

As said in the Intel AVX documentation

_mm256_cmp_ps, _mm256_cmp_pd 

etc

Note that instead of having multiple comparison instructions, you have to pass an enum indicating the comparison done. E.g :

res = _mm256_cmp_ps(a,b, _CMP_LT_OQ); // AVX res = a < b
like image 146
Joel Falcou Avatar answered Sep 23 '22 19:09

Joel Falcou