In normal C++ we can dynamically allocate an array of floats using either the standard library function malloc
or the new
keyword.
When we think of SIMD vectors, that come as compiler extensions like float32x4_t
(for ARM neon), is it safe to dynamically allocate an array of such SIMD vectors like this:
uint32_t number_req = 32;
float32x4_t *simd_arr = (float32x4_t *)malloc(sizeof(float32x4_t) * number_req);
I'm trying to limit the amount of load store instructions in my code. If the above is not a legit method, then what is the proper way to implement it? Every help will be greatly appreciated! Thankyou very much in advance!