Closed KristofferC closed 1 year ago
The stuff in https://github.com/JuliaRandom/Random123.jl/blob/195d1eeaf948280dbad1a86a9d64d92d2206ae06/src/aesni_common.jl#L7-L16 is type piracy and changes how basic Julia types behave.
You should in general do something like
struct __m128i data:: NTuple{2, VecElement{UInt64}} end
and define functions on that (similar as to how e.g. SIMD.jl does it, https://github.com/eschnett/SIMD.jl/blob/863e12ffd3fc36c4d9257f5332525948d55c9a70/src/simdvec.jl#L1-L3)
Yes you are right and thanks for pointing it out. I realized this problem once but forgot to fix it. 😢
The stuff in https://github.com/JuliaRandom/Random123.jl/blob/195d1eeaf948280dbad1a86a9d64d92d2206ae06/src/aesni_common.jl#L7-L16 is type piracy and changes how basic Julia types behave.
You should in general do something like
and define functions on that (similar as to how e.g. SIMD.jl does it, https://github.com/eschnett/SIMD.jl/blob/863e12ffd3fc36c4d9257f5332525948d55c9a70/src/simdvec.jl#L1-L3)