在c程序的函数声明中加__fascall,如果加错位置或格式不对,arm交叉编译器将报错:
error: expected '=', ',', ';', 'asm' or '__attribute__' before
但如果位置和格式对了,编译器则报警告:
warning: '__fastcall' attribute directive ignored
在MSDN中查到以下说明:
The __fastcall
keyword is accepted and ignored by the compilers that target ARM and x64 architectures; on an x64 chip, by convention, the first four arguments are passed in registers when possible, and additional arguments are passed on the stack. For more information, see Overview of x64 Calling Conventions. On an ARM chip, up to four integer arguments and eight floating-point arguments may be passed in registers, and additional arguments are passed on the stack.