#include <immintrin.h>
#include <stdio.h>
#include <stdint.h>
int main() {
__m256i a = _mm256_set_epi16((short)0x1f1e,(short)0x1d1c,(short)0x1b1a,(short)0x1918,(short)0x1716,(short)0x1514,(short)0x1312,(short)0x1110,(short)0x0f0e,(short)0x0d0c,(short)0x0b0a,(short)0x0908,(short)0x0706,(short)0x0504,(short)0x0302,(short)0x0100);
__m256i b = _mm256_set_epi16((short)0x3f3e,(short)0x3d3c,(short)0x3b3a,(short)0x3938,(short)0x3736,(short)0x3534,(short)0x3332,(short)0x3130,(short)0x2f2e,(short)0x2d2c,(short)0x2b2a,(short)0x2928,(short)0x2726,(short)0x2524,(short)0x2322,(short)0x2120);
__m256i ret = _mm256_div_epi16(a, b);
return 0;
}
Trying to compile the above code, but kept getting this error:
error: initializing '__m256i' (vector of 4 'long long' values) with an expression of incompatible type 'int'
__m256i ret = _mm256_div_epi16(a, b);
On further inspection, the _mm256_div_epi16
intrinsic is from the SVML library which only ships with the Intel Compiler and does not really work with Clang. The above code does compile with ICC.
Is anyone aware of a way one can use Intel’s SVML functions with Clang? I am aware of efforts like SLEEF but it is not suitable for our use case.