C - How to access elements of vector using GCC SSE vector extension

前端 未结 3 379
鱼传尺愫
鱼传尺愫 2020-12-15 11:36

Usually I work with 3D vectors using following types:

typedef vec3_t float[3];

initializing vectors using smth. like:

vec3_         


        
3条回答
  •  长情又很酷
    2020-12-15 11:51

    Note that gcc 4.6 now supports subscripted vectors:

    In C vectors can be subscripted as if the vector were an array with the same number of elements and base type. Out of bound accesses invoke undefined behavior at runtime. Warnings for out of bound accesses for vector subscription can be enabled with -Warray-bounds.

提交回复
热议问题