Open sbergen opened 10 years ago
This is not an x86/SSE exclusive issue. I've also seen this with an ARM NEON processor calling the function through Java code. The problem is that the "in" and "out" arrays passed to ffts_execute are expected to be memory aligned because both the SSE and NEON extensions use 128bit wide registers. Your code can be made to work by declaring "in" as "std::array<float, size> in attribute((aligned(16)));". The same thing should be done for "out". I added a check in d70b38d for logging this as a problem.
I ran into a segfault when using data in a c++ std::array as the input and output of a 1d real transform. Here's a test case:
After noticing that it only happens with clang, and does not happen with a regular array (e.g. float in[size]), I had a chat with Chandler Carruth on the llvm IRC channel, the conclusion being: