mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
std.os.linux.tls: Add s390x support.
This commit is contained in:
parent
9db992bd9b
commit
d2b21d5823
@ -84,6 +84,7 @@ const current_variant: Variant = switch (native_arch) {
|
||||
.riscv32,
|
||||
.riscv64,
|
||||
=> .I_modified,
|
||||
.s390x,
|
||||
.sparc64,
|
||||
.x86,
|
||||
.x86_64,
|
||||
@ -277,6 +278,17 @@ pub fn setThreadPointer(addr: usize) void {
|
||||
: [addr] "r" (addr),
|
||||
);
|
||||
},
|
||||
.s390x => {
|
||||
asm volatile (
|
||||
\\ lgr %%r0, %[addr]
|
||||
\\ sar %%a1, %%r0
|
||||
\\ srlg %%r0, %%r0, 32
|
||||
\\ sar %%a0, %%r0
|
||||
:
|
||||
: [addr] "r" (addr),
|
||||
: "r0"
|
||||
);
|
||||
},
|
||||
.sparc64 => {
|
||||
asm volatile (
|
||||
\\ mov %[addr], %%g7
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user