Displaying 2 results from an estimated 2 matches for "getvec3".
Did you mean:
_getvec3
2015 May 04
2
[LLVMdev] Incorrect code generated for arm64
Hi all,
I’ve narrowed down a problem in my code to the following test case:
- - - -
typedef struct {float v[2];} vec2;
typedef struct {float v[3];} vec3;
vec2 getVec2();
vec3 getVec3()
{
vec2 myVec = getVec2();
vec3 res;
res.v[0] = myVec.v[0];
res.v[1] = myVec.v[1];
res.v[2] = 1;
return res;
}
- - - -
Compiling this with any level of optimization for arm64 gives incorrect code, unless my test case above is triggering some undefined behaviour that I’m not aware of...
2015 May 04
2
[LLVMdev] Incorrect code generated for arm64
...be inlined an optimized well - but I’d definitely like to understand the root cause of this one so I can be on the lookout for any other similar failures.
Simon
>
> typedef struct {float v0, v1;} vec2;
> typedef struct {float v0, v1, v2;} vec3;
>
> vec2 getVec2();
>
> vec3 getVec3()
> {
> vec2 myVec = getVec2();
>
> vec3 res;
> res.v0 = myVec.v0;
> res.v1 = myVec.v1;
> res.v2 = 1;
> return res;
> }
>
> .section __TEXT,__text,regular,pure_instructions
> .globl _getVec3
> .align 2
> _getVec3:...