infix
A JIT-Powered FFI Library for C
Loading...
Searching...
No Matches
abi_x64_common.h File Reference

Common register definitions for the x86-64 architecture. More...

#include <stdint.h>
Include dependency graph for abi_x64_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  x64_gpr {
  RAX_REG = 0 , RCX_REG = 1 , RDX_REG = 2 , RBX_REG = 3 ,
  RSP_REG = 4 , RBP_REG = 5 , RSI_REG = 6 , RDI_REG = 7 ,
  R8_REG = 8 , R9_REG , R10_REG , R11_REG ,
  R12_REG , R13_REG , R14_REG , R15_REG
}
 
enum  x64_xmm {
  XMM0_REG , XMM1_REG , XMM2_REG , XMM3_REG ,
  XMM4_REG , XMM5_REG , XMM6_REG , XMM7_REG ,
  XMM8_REG , XMM9_REG , XMM10_REG , XMM11_REG ,
  XMM12_REG , XMM13_REG , XMM14_REG , XMM15_REG
}
 

Detailed Description

Common register definitions for the x86-64 architecture.

Copyright (c) 2025 Sanko Robinson

This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.

SPDX-License-Identifier: (Artistic-2.0 OR MIT)

The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).

SPDX-License-Identifier: CC-BY-4.0

Enumeration Type Documentation

◆ x64_gpr

enum x64_gpr
Enumerator
RAX_REG 

Volatile (caller-saved). Primary integer/pointer return value in both ABIs.

RCX_REG 

Volatile. 1st integer argument on Windows x64; 4th on System V.

RDX_REG 

Volatile. 2nd integer argument on Windows x64; 3rd on System V.

RBX_REG 

Callee-saved. Must be preserved across function calls.

RSP_REG 

Stack Pointer. Preserved relative to the frame pointer.

RBP_REG 

Frame Pointer (Base Pointer). Callee-saved.

RSI_REG 

Volatile on System V (2nd integer arg). Callee-saved on Windows.

RDI_REG 

Volatile on System V (1st integer arg). Callee-saved on Windows.

R8_REG 

Volatile. 3rd integer argument on Windows x64; 5th on System V.

R9_REG 

Volatile. 4th integer argument on Windows x64; 6th on System V.

R10_REG 

Volatile (caller-saved) scratch register.

R11_REG 

Volatile (caller-saved) scratch register.

R12_REG 

Callee-saved.

R13_REG 

Callee-saved.

R14_REG 

Callee-saved.

R15_REG 

Callee-saved.

◆ x64_xmm

enum x64_xmm
Enumerator
XMM0_REG 

Volatile. 1st float/double argument. Also used for float/double return values.

XMM1_REG 

Volatile. 2nd float/double argument.

XMM2_REG 

Volatile. 3rd float/double argument.

XMM3_REG 

Volatile. 4th float/double argument.

XMM4_REG 

Volatile. Used for 5th (System V) float/double argument.

XMM5_REG 

Volatile. Used for 6th (System V) float/double argument.

XMM6_REG 

Volatile on System V. Callee-saved on Windows x64.

XMM7_REG 

Volatile on System V. Callee-saved on Windows x64.

XMM8_REG 

Volatile in both ABIs.

XMM9_REG 

Volatile in both ABIs.

XMM10_REG 

Volatile in both ABIs.

XMM11_REG 

Volatile in both ABIs.

XMM12_REG 

Volatile in both ABIs.

XMM13_REG 

Volatile in both ABIs.

XMM14_REG 

Volatile in both ABIs.

XMM15_REG 

Volatile in both ABIs.