authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-07 00:50:29+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-07 16:47:57+02:00
logde3b22db4db5e95d3a4a30333784e8d6c2cc3818
treea1b9b3a137ced530ef8519f8cb8db8771f4a1dfc
parent9cd37a06965f1993f6e70ca3f10008d02f77334b
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.debug.cpu_context: remove support for s390x float registers

Let's for the moment assume that compilers haven't lost the plot. Fingers crossed.

1 files changed, 3 insertions(+), 38 deletions(-)

lib/std/debug/cpu_context.zig+3-38
......@@ -239,7 +239,6 @@ pub fn fromPosixSignalContext(ctx_ptr: ?*const anyopaque) ?Native {
239239 .s390x => switch (builtin.os.tag) {
240240 .linux => .{
241241 .r = uc.mcontext.gregs,
242 .f = uc.mcontext.fregs,
243242 .psw = .{
244243 .mask = uc.mcontext.psw.mask,
245244 .addr = uc.mcontext.psw.addr,
......@@ -1029,8 +1028,6 @@ pub const Riscv = extern struct {
10291028pub const S390x = extern struct {
10301029 /// The numbered general-purpose registers r0 - r15.
10311030 r: [16]u64,
1032 /// The numbered floating-point registers f0 - f15. Yes, really - they can be used in DWARF CFI.
1033 f: [16]f64,
10341031 /// The program counter.
10351032 psw: extern struct {
10361033 mask: u64,
......@@ -1041,26 +1038,10 @@ pub const S390x = extern struct {
10411038 var ctx: S390x = undefined;
10421039 asm volatile (
10431040 \\ stmg %%r0, %%r15, 0(%%r2)
1044 \\ std %%f0, 128(%%r2)
1045 \\ std %%f1, 136(%%r2)
1046 \\ std %%f2, 144(%%r2)
1047 \\ std %%f3, 152(%%r2)
1048 \\ std %%f4, 160(%%r2)
1049 \\ std %%f5, 168(%%r2)
1050 \\ std %%f6, 176(%%r2)
1051 \\ std %%f7, 184(%%r2)
1052 \\ std %%f8, 192(%%r2)
1053 \\ std %%f9, 200(%%r2)
1054 \\ std %%f10, 208(%%r2)
1055 \\ std %%f11, 216(%%r2)
1056 \\ std %%f12, 224(%%r2)
1057 \\ std %%f13, 232(%%r2)
1058 \\ std %%f14, 240(%%r2)
1059 \\ std %%f15, 248(%%r2)
10601041 \\ epsw %%r0, %%r1
1061 \\ stm %%r0, %%r1, 256(%%r2)
1042 \\ stm %%r0, %%r1, 128(%%r2)
10621043 \\ larl %%r0, .
1063 \\ stg %%r0, 264(%%r2)
1044 \\ stg %%r0, 136(%%r2)
10641045 \\ lg %%r0, 0(%%r2)
10651046 \\ lg %%r1, 8(%%r2)
10661047 :
......@@ -1072,26 +1053,10 @@ pub const S390x = extern struct {
10721053 pub fn dwarfRegisterBytes(ctx: *S390x, register_num: u16) DwarfRegisterError![]u8 {
10731054 switch (register_num) {
10741055 0...15 => return @ptrCast(&ctx.r[register_num]),
1075 // Why???
1076 16 => return @ptrCast(&ctx.f[0]),
1077 17 => return @ptrCast(&ctx.f[2]),
1078 18 => return @ptrCast(&ctx.f[4]),
1079 19 => return @ptrCast(&ctx.f[6]),
1080 20 => return @ptrCast(&ctx.f[1]),
1081 21 => return @ptrCast(&ctx.f[3]),
1082 22 => return @ptrCast(&ctx.f[5]),
1083 23 => return @ptrCast(&ctx.f[7]),
1084 24 => return @ptrCast(&ctx.f[8]),
1085 25 => return @ptrCast(&ctx.f[10]),
1086 26 => return @ptrCast(&ctx.f[12]),
1087 27 => return @ptrCast(&ctx.f[14]),
1088 28 => return @ptrCast(&ctx.f[9]),
1089 29 => return @ptrCast(&ctx.f[11]),
1090 30 => return @ptrCast(&ctx.f[13]),
1091 31 => return @ptrCast(&ctx.f[15]),
10921056 64 => return @ptrCast(&ctx.psw.mask),
10931057 65 => return @ptrCast(&ctx.psw.addr),
10941058
1059 16...31 => return error.UnsupportedRegister, // f0 - f15
10951060 48...63 => return error.UnsupportedRegister, // a0 - a15
10961061 68...83 => return error.UnsupportedRegister, // v16 - v31
10971062