Original Post
as_callfunc_x64_gcc.cpp does not compile correctly.
The following output is produced using "angelscript/projects/gnuc macosx/makefile":
Which seems to correspond to the following lines in as_callfunc_x64_gcc.cpp
Moving from a general purpose register to an xmm register doesn't seem to be supported, only xmm to xmm, memory to xmm and xmm to memory. According to this
I'm by no means an assembly programmer but wouldn't it be possible to just use movq using the stack pointer to reference memory and then pop into rax after the move?
Maybe something like this?
The following output is produced using "angelscript/projects/gnuc macosx/makefile":
mkdir obj
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_atomic.o -c ../../source/as_atomic.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_builder.o -c ../../source/as_builder.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_bytecode.o -c ../../source/as_bytecode.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_callfunc.o -c ../../source/as_callfunc.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_callfunc_arm.o -c ../../source/as_callfunc_arm.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_callfunc_mips.o -c ../../source/as_callfunc_mips.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_callfunc_ppc.o -c ../../source/as_callfunc_ppc.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_callfunc_ppc_64.o -c ../../source/as_callfunc_ppc_64.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_callfunc_sh4.o -c ../../source/as_callfunc_sh4.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_callfunc_x86.o -c ../../source/as_callfunc_x86.cpp
c++ -g -Wall -fPIC -arch i386 -arch x86_64 -o obj/as_callfunc_x64_gcc.o -c ../../source/as_callfunc_x64_gcc.cpp
/var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccQb3SXj.s:170:suffix or operands invalid for `movq'
/var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccQb3SXj.s:173:suffix or operands invalid for `movq'
/var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccQb3SXj.s:176:suffix or operands invalid for `movq'
/var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccQb3SXj.s:179:suffix or operands invalid for `movq'
/var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccQb3SXj.s:182:suffix or operands invalid for `movq'
/var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccQb3SXj.s:185:suffix or operands invalid for `movq'
/var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccQb3SXj.s:188:suffix or operands invalid for `movq'
/var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccQb3SXj.s:191:suffix or operands invalid for `movq'
lipo: can't open input file: /var/folders/iG/iGgRv-pOHVq8lMdjYzTz0E+++TI/-Tmp-//ccDlZLXb.out (No such file or directory)
make: *** [obj/as_callfunc_x64_gcc.o] Error 1Which seems to correspond to the following lines in as_callfunc_x64_gcc.cpp
POP_LONG( "%xmm7" );
POP_LONG( "%xmm6" );
POP_LONG( "%xmm5" );
POP_LONG( "%xmm4" );
POP_LONG( "%xmm3" );
POP_LONG( "%xmm2" );
POP_LONG( "%xmm1" );
POP_LONG( "%xmm0" );Moving from a general purpose register to an xmm register doesn't seem to be supported, only xmm to xmm, memory to xmm and xmm to memory. According to this
I'm by no means an assembly programmer but wouldn't it be possible to just use movq using the stack pointer to reference memory and then pop into rax after the move?
Maybe something like this?
#define POP_LONG( reg ) \
__asm__ __volatile__ ( \
"add %%rsp, 8\n" \
"movq (%%rsp), %" reg \
: \
: \
: reg \
)