| author | |
| committer | |
| log | 7f49dae284805a46098f07844b68a03a780e6ff2 |
| tree | fa6c7b9525f1080a4703c5347c01e9407502b9f6 |
| parent | 5bf52a6f50a9fa0380499dd38a9826fc39c43f11 |
Clang fails to compile the CBE translation of this code ("non-ASM
statement in naked function"). Similar to the implementations of
`restore_rt` on x86 and ARM, when the CBE is in use, this commit employs
alternative inline assembly that avoids using non-immediate input
operands.2 files changed, 26 insertions(+), 10 deletions(-)
lib/std/os/linux/powerpc.zig+13-5| ... | @@ -247,11 +247,19 @@ pub fn clone() callconv(.naked) usize { | ... | @@ -247,11 +247,19 @@ pub fn clone() callconv(.naked) usize { |
| 247 | pub const restore = restore_rt; | 247 | pub const restore = restore_rt; |
| 248 | 248 | ||
| 249 | pub fn restore_rt() callconv(.naked) noreturn { | 249 | pub fn restore_rt() callconv(.naked) noreturn { |
| 250 | asm volatile ( | 250 | switch (@import("builtin").zig_backend) { |
| 251 | \\ sc | 251 | .stage2_c => asm volatile ( |
| 252 | : | 252 | \\ li 0, %[number] |
| 253 | : [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)), | 253 | \\ sc |
| 254 | : .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }); | 254 | : |
| 255 | : [number] "i" (@intFromEnum(SYS.rt_sigreturn)), | ||
| 256 | : .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }), | ||
| 257 | else => _ = asm volatile ( | ||
| 258 | \\ sc | ||
| 259 | : | ||
| 260 | : [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)), | ||
| 261 | : .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }), | ||
| 262 | } | ||
| 255 | } | 263 | } |
| 256 | 264 | ||
| 257 | pub const F = struct { | 265 | pub const F = struct { |
lib/std/os/linux/powerpc64.zig+13-5| ... | @@ -232,11 +232,19 @@ pub fn clone() callconv(.naked) usize { | ... | @@ -232,11 +232,19 @@ pub fn clone() callconv(.naked) usize { |
| 232 | pub const restore = restore_rt; | 232 | pub const restore = restore_rt; |
| 233 | 233 | ||
| 234 | pub fn restore_rt() callconv(.naked) noreturn { | 234 | pub fn restore_rt() callconv(.naked) noreturn { |
| 235 | asm volatile ( | 235 | switch (@import("builtin").zig_backend) { |
| 236 | \\ sc | 236 | .stage2_c => asm volatile ( |
| 237 | : | 237 | \\ li 0, %[number] |
| 238 | : [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)), | 238 | \\ sc |
| 239 | : .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }); | 239 | : |
| 240 | : [number] "i" (@intFromEnum(SYS.rt_sigreturn)), | ||
| 241 | : .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }), | ||
| 242 | else => _ = asm volatile ( | ||
| 243 | \\ sc | ||
| 244 | : | ||
| 245 | : [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)), | ||
| 246 | : .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }), | ||
| 247 | } | ||
| 240 | } | 248 | } |
| 241 | 249 | ||
| 242 | pub const F = struct { | 250 | pub const F = struct { |