Your ABI is most likely incorrect

The ABI, or Application Binary Interface, defines how binaries interact with each other on a particular platform and includes a calling convention. Most ABIs have one design flaw that slows down performance.





Let's start by looking at the System V ABI for the x86 processor line. The ABI classifies function arguments into a number of different categories; we will only consider two:





INTEGER: , .





MEMORY: , .





; , :





  1. , INTEGER .





  2. , MEMORY .





  3. , , , .





, , .





? , , , . , ; , , .





:





void foo(int*);
void bar(void);

int x = 5;
foo(&x);   //   , foo   &x   
x = 7;
bar();       //  , bar   x
return x;   //  ,       ;       

	     // (   ,   x    , ,   ,       .)

      
      



restrict



! foo



restrict



, foo (C11Β§6.7.3.1p4,11). , . , restrict



C , , , ABI C .





, ABI . void foo



(struct bla



) , void foo



(const struct bla *restrict



), , .





, System V. ABI? Microsoft , : 





[ ] , .





( , , ), . Β«, Β», , , - .





ABI! ARM (, AAA arch 64):





, 16 , , , .





RISC-V:





2Γ—XLEN [: ?] .





[...]





, , .





PowerPC:





[] (GPR), , .





MIPS n32:





(structs), (unions), (doublewords), , , , , .





.






ABI immutable , . , , , , . , .





, ABI!






:





  • SysV ABI





  • Microsoft ABI





  • ARM ABI





  • RISC-V ABI





  • PowerPC ABI





  • MIPS n32 ABI





  • C11






"C++ Developer. Professional". , , , .





- DEMO DAY








All Articles