In order to produce EVM-specific instructions, a set of intrinsics must be specified for the frontend to emit so that the EVM backend understands to generate the corresponding instruction. Many of these instructions, in Solidity, are represented by built-in functions. NOTE: The argument ordering in these intrinsics may not fully match the order on which they must be pushed onto the EVM stack. Someone should double check. TODO: Double-check argument and return types as well.
llvm.evm_builtin_sha3data: u256be: byte pointer to buffer to hashlen: u256be: length of bufferhash: bytes32: resulting hash0x20llvm.evm_builtin_addressaddress: bytes20: Currently executing account0x30llvm.evm_builtin_balanceaddress: bytes20: Account to check balance ofbalance: u256be: Balance of given account0x31llvm.evm_builtin_originaddress: bytes20: Address of TX origin0x32llvm.evm_builtin_calleraddress: bytes20: Address of caller0x33llvm.evm_builtin_callvaluevalue: u256be: TX value sent0x34llvm.evm_builtin_calldataloadoffset: u256be: Offset within call data buffer to loaddata: bytes32: 32 bytes of calldata beginning at offset0x35llvm.evm_builtin_calldatasizesize: u256be: Length of call data buffer0x36 llvm.evm_builtin_calldatacopydst: u256be: Pointer to destination bufferoffset: u256be: Offset within call data to copylen: u256be: Number of bytes to copy beginning at offset0x37llvm.evm_builtin_codesizesize: u256be: Size of code at currently executing account0x38llvm.evm_builtin_codecopydst: u256be: Pointer to destination bufferoffset: u256be: Offset within code to copylen: u256be: Number of bytes to copy beginning at offset0x39llvm.evm_builtin_gaspriceprice: u256: Cost of gas in current environment0x3allvm.evm_builtin_extcodesizeaddress: bytes20: Address whose code size to check size: u256be: Size of code at given account0x3bllvm.evm_builtin_extcodecopyaddress: bytes20 Address whose code to copydst: u256be: Pointer to destination bufferoffset: u256be: Offset within code to copylen: u256be: Number of bytes to copy beginning at offset0x3Cllvm.evm_builtin_returndatasizesize: u256be: Size of return data buffer from last call0x3dllvm.evm_builtin_returndatacopydst: u256be: Pointer to destination bufferoffset: u256be: Offset within return buffer to copylen: u256be: Number of bytes to copy beginning at offset0x3ellvm.evm_builtin_blockhashage: u256be: The age of the block, between 0 and 256 blocks oldhash: bytes32: The hash of the requested block0x40llvm.evm_builtin_coinbasebeneficiary: bytes20: Current mining beneficiary0x41llvm.evm_builtin_timestampstamp: u256be: Timestamp of last block0x42llvm.evm_builtin_blocknumberblknum: u256be: Current block number0x43llvm.evm_builtin_difficultydifficulty: u256be: Current block difficulty0x44llvm.evm_builtin_gaslimitlimit: u256be: Block gas limit //NOTE: check type again0x45llvm.evm_builtin_sloadkey: u256be: Storage key to accessvalue: u256be: Storage value at key0x54llvm.evm_builtin_sstorekey: u256be: Storage key to write valuevalue: u256be: Value to write0x55llvm.evm_builtin_msizesize: u256be: Size of active memory in bytes0x59llvm.evm_builtin_gasgasleft: u256be: Amount of gas left in current executionllvm.evm_builtin_log0data: u256be: Pointer to log data bufferlen: u256be: Size of log data buffer in bytes0xa0llvm.evm_builtin_log0data: u256be: Pointer to log data bufferlen: u256be: Size of log data buffer in bytestopic1: u256be: Log topic 10xa1llvm.evm_builtin_log2data: u256be: Pointer to log data bufferlen: u256be: Size of log data buffer in bytestopic1: u256be: Log topic 1topic2: u256be: Log topic 20xa2llvm.evm_builtin_log3data: u256be: Pointer to log data bufferlen: u256be: Size of log data buffer in bytestopic1: u256be: Log topic 1topic2: u256be: Log topic 2topic3: u256be: Log topic 30xa3llvm.evm_builtin_log4data: u256be: Pointer to log data bufferlen: u256be: Size of log data buffer in bytestopic1: u256be: Log topic 1topic2: u256be: Log topic 2topic3: u256be: Log topic 3topic4: u256be: Log topic 40xa4llvm.evm_builtin_createvalue: u256be: Value in wei sent to new contractcode: u256be: Pointer to code buffer for new contractlen: u256be: Code buffer lengthaddr: bytes20: Address of newly created contract0xf0llvm.evm_builtin_create2value: u256be: Value in wei sent to new contractcode: u256be: Pointer to code buffer for new contractlen: u256be: Code buffer lengthsalt: bytes32: Salt for address creationaddr: bytes20: Address of newly created contract0xf5llvm.evm_builtin_callgas: u256be: Gas allowance for calladdress: bytes20: Call destination addressvalue: u256be: Wei value sent with callinput: u256be: Input data pointerinputlen: u256be: Input data buffer sizeoutput: u256be: Output buffer pointeroutputlen: u256be: Output data buffer sizereturn: u256be: Exit code0xf1llvm.evm_builtin_callcodegas: u256be: Gas allowance for calladdress: bytes20: Address of code to usevalue: u256be: Wei value sent with callinput: u256be: Input data pointerinputlen: u256be: Input data buffer sizeoutput: u256be: Output buffer pointeroutputlen: u256be: Output data buffer sizereturn: u256be: Exit code0xf2llvm.evm_builtin_calldelegategas: u256be: Gas allowance for calladdress: bytes20: Address of code to useinput: u256be: Input data pointerinputlen: u256be: Input data buffer sizeoutput: u256be: Output buffer pointeroutputlen: u256be: Output data buffer sizereturn: u256be: Exit code0xf4llvm.evm_builtin_staticcallgas: u256be: Gas allowance for calladdress: bytes20: Call destination addressinput: u256be: Input data pointerinputlen: u256be: Input data buffer sizeoutput: u256be: Output buffer pointeroutputlen: u256be: Output data buffer size0xfallvm.evm_builtin_returndata: u256be: Return data pointerlen: u256be: Return buffer size0xf3llvm.evm_builtin_revertdata: u256be: Return data pointerlen: u256be: Return buffer size0xfdllvm.evm_builtin_selfdestructbeneficiary: bytes20: Address to send funds to0xff