How to use simd operation PMOVMSKB in Odin

Hello everybody,

I would like to use the simd instruction PMOVMSKB in Odin.
I see predefined simd instructions in packages “base:intrinsics” or “core:simd”, but I don’t know how which simd proc in Odin corresponds to which x64 assembly instruction. Is there a source file where it is explicit, or should I call assembly from Odin myself ?

Sorry if the question is approximative, I’m new to simd/low level programming, and thanks in advance !

Context: porting json parser library ‘simdjson’ to Odin (simdjson/include/simdjson/haswell/simd.h at master · simdjson/simdjson · GitHub, line 73: ‘_mm256_movemask_epi8’ corresponds to ‘PMOVMSKB’ in x64 assembly)

This would correspond to the extract_msbs intrinsic, which has just been merged recently. It’s not in an official release, but it’s in master and should be in dev-2025-03 (whenever it releases). It returns a bit_set[0..<N], where each element refers to the corresponding element of the vector.

There’s also core:simd/x86, which has intrinsics for a number of the x86 instructions, but while it includes intrinsics for SSE instructions, the bindings to the AVX intrinsics haven’t been written yet (and the one you’re asking about is an AVX intrinsic).

1 Like

Thanks a million Barinzaya !