So I am using c2go to link C code with Go. The C code requires certain arguments of a function called from Go to be 256 bit aligned (the function arguments are all pointers to Go variables). Is there a way to achieve this is Go (i.e. to specify 256 alignment for a variable in Go)?
In Go, "unsafe.Alignof(f)" shows as 8 bytes aligned (for "var f [8]float32") i.e. the f is guaranteed by Go to be only 8 bytes aligned. I need it to be 32 bytes aligned somehow.
For the curious: The C code is using SIMD instructions (AVX to be specific). I was using "vmovaps" instruction which requires 256 bit alignment of operands. I can get away with using "vmovups" which doesn't require alignment, but I suspect that has a performance penalty.