-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
- Endianness support for integers.
- Custom alignment feature.
- Bits (Packed Structs)
- Stack Layout
- Target Triple & Data Layout
- Linkage & Visibility
- Symbol Visibility Attributes: (e.g., default, hidden, protected for ELF). These affect how the linker processes symbols and if they can be overridden.
- C ABI Compatibility
- Exception Handling
- DWARF unwinding tables, Windows SEH, or other OS-specific mechanisms.
- Tracing features.
β Calling Convention Support (Planned / In Progress)
Support for various calling conventions in the Cyrus Language compiler:
π§© General Conventions
-
"C"
β Standard C ABI (platform-specific) -
"system"
β Platform-default ABI ("C"
on Unix,"stdcall"
on Win32)
πͺ Windows-specific Conventions (x86 / x64)
-
"stdcall"
β Windows API (callee cleans up stack) -
"fastcall"
β Pass first args in registers (ECX, EDX) -
"vectorcall"
β Optimized for SIMD-heavy code (XMM/AVX regs) -
"thiscall"
β Used for instance methods in C++ (ECX holdsthis
) -
"win64"
β Official Windows x64 calling convention
π§ Unix-like (Linux/macOS)
-
"sysv64"
β System V x86_64 ABI
π§ Cross-Target ABIs
-
"ms_abi"
β Microsoft x64 ABI on non-Windows -
"sysv_abi"
β SysV ABI on Windows (e.g. mingw interop)
π¦Ύ ARM / Embedded
-
"aapcs"
β ARM EABI (32-bit) -
"aapcs-vfp"
β ARM EABI + floating point registers
βοΈ Special / Platform-specific
-
"ccc"
β LLVM's internal C calling convention -
"spir_function"
β SPIR-V for OpenCL -
"kernel"
β GPU kernel launch ABI
- Packed structs
If you manually pack a struct, LLVM may lower the alignment to 1 unless you override.
You might want to enforce natural alignment for a field to match a C ABI.
-
SIMD types (e.g., v4f32) often need 16-byte alignment.
-
Interfacing with external code (*)
If youβre generating globals or structs that will be accessed by C libraries, the alignment must match the ABI expected by the other code.
Example: passing a struct to printf or a library function. Misalignment can cause crashes or undefined behavior on some platforms.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo