"Hi
Is there any possibility to modify AS calling stubs to allow proper handling of '__m128 / float32x4_t / float vector' return argument ?
Example:
(x86)
__m128 SomeFoo() { __m128 r; return r; }
AS_REG_OBJECT2("__m128", __m128, sizeof(__m128), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA)
as->RegisterObjectBehaviour("__m128", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(__m128_DefaultConstructor), asCALL_CDECL_OBJLAST);
as->RegisterObjectBehaviour("__m128", asBEHAVE_CONSTRUCT, "void f(const __m128 &in)", asFUNCTION(__m128_CopyConstructor), asCALL_CDECL_OBJLAST);
and now I have two functions registered to as
__m128 foo();
void bar(__m128 v);
and call:
bar(foo());
but at bar i get total crap -- bar expects arg0 in xmm0 but gets it on the stack (foo returns arg by stack not in xmm0 - so this part is ok on x86)
on ARM (float32x4_t maps to NEON registers)
there is a crap with both returning and setting as arg.
For now I didnt tested this for PPC (ps3 cell, xbox360 xenos) but probably there will be also crap.
I have a bunch of functions that i need to register to AS but they all return float vector types, and i want to avoid production of tons of stubs just to convert return types to structs."