| author | |
| committer | |
| log | 9f2a200a3fce81d2091cba16a715acd3fdf1d70e |
| tree | 5c7f16ed4cac46550694f06a3d8ee0beb186edb4 |
| parent | a430be097be2d6ec9237d2e81d6e576c5926dc1a |
| signature |
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 | 247 | pub const restore = restore_rt; |
| 248 | 248 | |
| 249 | 249 | pub fn restore_rt() callconv(.naked) noreturn { |
| 250 | asm volatile ( | |
| 251 | \\ sc | |
| 252 | : | |
| 253 | : [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)), | |
| 254 | : .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }); | |
| 250 | switch (@import("builtin").zig_backend) { | |
| 251 | .stage2_c => asm volatile ( | |
| 252 | \\ li 0, %[number] | |
| 253 | \\ sc | |
| 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 | 265 | pub const F = struct { |
lib/std/os/linux/powerpc64.zig+13-5| ... | ... | @@ -232,11 +232,19 @@ pub fn clone() callconv(.naked) usize { |
| 232 | 232 | pub const restore = restore_rt; |
| 233 | 233 | |
| 234 | 234 | pub fn restore_rt() callconv(.naked) noreturn { |
| 235 | asm volatile ( | |
| 236 | \\ sc | |
| 237 | : | |
| 238 | : [number] "{r0}" (@intFromEnum(SYS.rt_sigreturn)), | |
| 239 | : .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true }); | |
| 235 | switch (@import("builtin").zig_backend) { | |
| 236 | .stage2_c => asm volatile ( | |
| 237 | \\ li 0, %[number] | |
| 238 | \\ sc | |
| 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 | 250 | pub const F = struct { |