开发者

How to initialize const float32x4x4_t (ARM NEON intrinsic, GCC)?

开发者 https://www.devze.com 2022-12-29 07:28 出处:网络
I can initialize float32x4_t like this: const float32x4x4_t zero = { 0.0f, 0.0f, 0.0f, 0.0f }; But this code makes an error Incompatible types in initializer:

I can initialize float32x4_t like this:

const float32x4x4_t zero = { 0.0f, 0.0f, 0.0f, 0.0f };

But this code makes an error Incompatible types in initializer:

const float32x4x4_t one =
{
    1.0f, 1.0f, 1.0f, 1.0f,
    1.0f, 1.0f, 1.0f, 1.0f,
    1.0f开发者_运维技巧, 1.0f, 1.0f, 1.0f,
    1.0f, 1.0f, 1.0f, 1.0f,
};

float32x4x4_t is 4x4 matrix built as:

typedef struct float32x4x4_t
{
    float32x4_t val[4];
}
float32x4x4_t;

How can I initialize this const struct?


const float32x4x4_t nameOfVariableHere =
{{
    {1.0f, 1.0f, 1.0f, 1.0f},
    {1.0f, 1.0f, 1.0f, 1.0f},
    {1.0f, 1.0f, 1.0f, 1.0f},
    {1.0f, 1.0f, 1.0f, 1.0f}
}};

The 1st level of parenthesis is for the struct.
The 2nd level is for the array of float32x4_t.
The 3rd level is for float32x4_t itself.

0

精彩评论

暂无评论...
验证码 换一张
取 消