Carry-less multiplication in Odin - PCLMULQDQ

Hello all,

I would like to use a ‘carry-less’ multiplication (corresponding to ‘PCLMULQDQ’ in x64 assembly).

Odin version is ‘dev-2025-03’. I couldn’t find it in ‘simd’/‘builtin’/‘intrinsics’.
Is it already available, or a WIP, or shouldn’t be available from the language ?

Tanks in advance for your help !

Context: porting ‘simdjson’ to Odin (simdjson/include/simdjson/haswell/bitmask.h at master · simdjson/simdjson · GitHub intel intrinsic ‘_mm_clmulepi64_si128’ corresponds to x64 assembly ‘PCLMULQDQ’)

There appears to be an x86/amd64-specific one in core:simd/x86.
https://github.com/odin-lang/Odin/blob/master/core/simd/x86/pclmulqdq.odin
Other than that, it doesn’t look like LLVM has a generalized intrinsic for it, so I’m not sure there’s a platform-independent way of doing this.

2 Likes

I should have checked more carfully, sorry.
And thanks again for your help !