AsmJit Project
Machine Code Generation for C++
Function calling convention.
Function calling convention is a scheme that defines how function parameters are passed and how function returns its result. AsmJit defines a variety of architecture and OS specific calling conventions and also provides a compile time detection to make the code-generation easier.
Internal limits of AsmJit's CallConv.
Calling convention id.
Calling conventions can be divided into the following groups:
Strategy used to assign registers to function arguments.
This is AsmJit specific. It basically describes how AsmJit should convert the function arguments defined by FuncSignature
into register IDs and stack offsets. The default strategy kStrategyDefault
assigns registers and then stack whereas kStrategyWin64
strategy does register shadowing as defined by WIN64 calling convention - it applies to 64-bit calling conventions only.
Calling convention flags.
Initializes this calling convention to the given ccId
based on the environment
.
See Id and Environment for more details.
Resets this CallConv struct into a defined state.
It's recommended to reset the CallConv struct in case you would like create a custom calling convention as it prevents from using an uninitialized data (CallConv doesn't have a constructor that would initialize it, it's just a struct).
Returns the calling convention id, see Id
.
Sets the calling convention id, see Id
.
Returns the calling function architecture id.
Sets the calling function architecture id.
Returns the strategy used to assign registers to arguments, see Strategy
.
Sets the strategy used to assign registers to arguments, see Strategy
.
Tests whether the calling convention has the given flag
set.
Returns the calling convention flags, see Flags
.
Adds the calling convention flags, see Flags
.
Adds the calling convention flags, see Flags
.
Tests whether this calling convention specifies 'RedZone'.
Tests whether this calling convention specifies 'SpillZone'.
Returns size of 'RedZone'.
Returns size of 'SpillZone'.
Sets size of 'RedZone'.
Sets size of 'SpillZone'.
Returns a natural stack alignment.
Sets a natural stack alignment.
This function can be used to override the default stack alignment in case that you know that it's alignment is different. For example it allows to implement custom calling conventions that guarantee higher stack alignment.
Returns the size of a register (or its part) to be saved and restored of the given group
.
Sets the size of a vector register (or its part) to be saved and restored.
Returns the alignment of a save-restore area of the given group
.
Sets the alignment of a save-restore area of the given group
.
Returns the order of passed registers of the given group
, see BaseReg::RegGroup.
Returns the mask of passed registers of the given group
, see BaseReg::RegGroup.
Resets the order and mask of passed registers.
0xFF
, uint32_t a2 = 0xFF
, uint32_t a3 = 0xFF
, uint32_t a4 = 0xFF
, uint32_t a5 = 0xFF
, uint32_t a6 = 0xFF
, uint32_t a7 = 0xFF
)noexcept¶Sets the order and mask of passed registers.
Returns preserved register mask of the given group
, see BaseReg::RegGroup.
Sets preserved register mask of the given group
, see BaseReg::RegGroup.
Calling convention id, see Id.
Architecture identifier, see Environment::Arch.
Register assignment strategy, see Strategy.
Red zone size (AMD64 == 128 bytes).
Spill zone size (WIN-X64 == 32 bytes).
Natural stack alignment as defined by OS/ABI.
Flags.
Size to save/restore per register group.
Alignment of save/restore groups.
Mask of all passed registers, per group.
Mask of all preserved registers, per group.
Passed registers' order, per register group.