Skip to content

Commit de3b22d

Browse files
committed
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 parent 9cd37a0 commit de3b22d

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

lib/std/debug/cpu_context.zig

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {
10291028
pub 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

0 commit comments

Comments
 (0)