Files
Upsilon/ion/src/simulator/shared/collect_registers_arm64.s
Martin 59db12e78e [simulator/macos] Add universal binary support for x86_64 and ARM64
Build universal macOS simulator binaries that work on both Intel and Apple Silicon Macs by default. The build system now:
- Defaults to building for both x86_64 and ARM64 architectures
- Uses lipo to create universal binaries
- Allows single-architecture builds via ARCHS=arm64 or ARCHS=x86_64
- Conditionally includes the appropriate assembly files for each architecture
2025-10-08 11:15:37 +00:00

21 lines
569 B
ArmAsm

.text
.global _collect_registers
_collect_registers:
// Save callee-saved registers to the buffer pointed by x0
// ARM64 callee-saved registers: x19-x28, x29 (fp), x30 (lr), sp
stp x19, x20, [x0, #0]
stp x21, x22, [x0, #16]
stp x23, x24, [x0, #32]
stp x25, x26, [x0, #48]
stp x27, x28, [x0, #64]
stp x29, x30, [x0, #80]
// Save stack pointer
mov x1, sp
str x1, [x0, #96]
// Return current stack pointer
mov x0, sp
ret