c++ - What is the Windows RT on ARM native code calling convention? -


i couldn't find documentation on windows rt on arm calling convention used visual studio c++. microsoft using arm's aapcs?

if microsoft using aapcs/eabi windows rt on arm, using arm's c++ abi (which derived itanium c++ abi)? maybe arm exception handling abi?

does calling convention used windows rt on arm differ used other (embedded) arm windows variants?

is there reliable way detect windows rt on arm through predefined compiler macros?

update: added question regarding c++ abi.

unlike windows ce (which uses original apcs aka old abi), windows rt on arm uses eabi. more specifically, variant uses floating-point registers pass floating-point data , 8-byte stack/argument alignment.

if take following function:

int g(float x) {   return x; } 

and compile vs2012's arm compiler, following assembly:

|g| proc     vcvt.s32.f32 s0,s0     vmov        r0,s0     bx          lr     endp  ; |g| 

you can see it's using s0 , not r0 argument.

the 1 vs2008 (which can used target older windows ce versions) produces this:

str     lr, [sp,#-4]! ldr     r3, =__imp___stoi ldr     r3, [r3] mov     lr, pc bx      r3 ldr     pc, [sp],#4 

this code calling helper function perform conversion.

the windows ce compiler shipped windows compact 7 supports both old calling convention (called "cdecl" ms) , eabi. see what's new in platform builder 7.

edit: noticed added question c++. microsoft not use itanium-style c++ abi, since implementation predates it. can read microsoft's implementation in openrce articles (1, 2) , follow-up recon presentation. see original description designer jan gray: pdf.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -