authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-23 04:53:14+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-23 09:27:17+02:00
log252e1fd7ecc037b129490af5eb5ca8fdfa6a20bc
treeb8b0fe43be12ccc003ce0919e29db9c875591952
parent340d6ce1bf30556089bdefa60abf50f81617ceb2
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.start: add alpha support


1 files changed, 14 insertions(+), 1 deletions(-)

lib/std/start.zig+14-1
...@@ -195,9 +195,10 @@ fn _start() callconv(.naked) noreturn {...@@ -195,9 +195,10 @@ fn _start() callconv(.naked) noreturn {
195 // This is the first userspace frame. Prevent DWARF-based unwinders from unwinding further. We195 // This is the first userspace frame. Prevent DWARF-based unwinders from unwinding further. We
196 // prevent FP-based unwinders from unwinding further by zeroing the register below.196 // prevent FP-based unwinders from unwinding further by zeroing the register below.
197 if (builtin.unwind_tables != .none or !builtin.strip_debug_info) asm volatile (switch (native_arch) {197 if (builtin.unwind_tables != .none or !builtin.strip_debug_info) asm volatile (switch (native_arch) {
198 .aarch64, .aarch64_be => ".cfi_undefined lr",
199 .alpha => ".cfi_undefined $26",
198 .arc, .arceb => ".cfi_undefined blink",200 .arc, .arceb => ".cfi_undefined blink",
199 .arm, .armeb, .thumb, .thumbeb => "", // https://github.com/llvm/llvm-project/issues/115891201 .arm, .armeb, .thumb, .thumbeb => "", // https://github.com/llvm/llvm-project/issues/115891
200 .aarch64, .aarch64_be => ".cfi_undefined lr",
201 .csky => ".cfi_undefined lr",202 .csky => ".cfi_undefined lr",
202 .hexagon => ".cfi_undefined r31",203 .hexagon => ".cfi_undefined r31",
203 .loongarch32, .loongarch64 => ".cfi_undefined 1",204 .loongarch32, .loongarch64 => ".cfi_undefined 1",
...@@ -253,6 +254,18 @@ fn _start() callconv(.naked) noreturn {...@@ -253,6 +254,18 @@ fn _start() callconv(.naked) noreturn {
253 \\ and sp, x0, #-16254 \\ and sp, x0, #-16
254 \\ b %[posixCallMainAndExit]255 \\ b %[posixCallMainAndExit]
255 ,256 ,
257 .alpha =>
258 // $15 = FP, $26 = LR, $29 = GP, $30 = SP
259 \\ br $29, 1f
260 \\1:
261 \\ ldgp $29, 0($29)
262 \\ mov 0, $15
263 \\ mov 0, $26
264 \\ mov $30, $16
265 \\ ldi $1, -16
266 \\ and $30, $30, $1
267 \\ jsr $26, %[posixCallMainAndExit]
268 ,
256 .arc, .arceb =>269 .arc, .arceb =>
257 // ARC v1 and v2 had a very low stack alignment requirement of 4; v3 increased it to 16.270 // ARC v1 and v2 had a very low stack alignment requirement of 4; v3 increased it to 16.
258 \\ mov fp, 0271 \\ mov fp, 0