I'm trying to implement _mm_add_epi32
in golang assembly, optionally with help of avo. But I know little about assembly and do not even know how to start it. Can you give me some hint of code? Thank you all.
Here's the equivalent slower golang version:
func add(x, y []uint32) []uint32 {
if len(x) != len(y) {
return nil
}
result := make([]uint32, len(x))
for i := 0; i < len(x); i++ {
result[i] = x[i] + y[i]
}
return result
}
I know that the struction paddq xmm, xmm
is what we need, but do not kown how to convert a slice of []byte
to the 256 bit register YMM
.