| author | |
| committer | |
| log | 2a155d75ac575c9a99918569249aecdf251e94d9 |
| tree | 652a6ece86825633cb47541434b024773fda2f68 |
| parent | 3b947932abbb9f14710c64e3afa6fa88947d1ed1 |
| signature |
l.andi zero-extends its operand so this would give the wrong result. Instead,
use l.addi to materialize -4 and then l.and that.
Rather unfortunate that the assembler doesn't reject this form.2 files changed, 4 insertions(+), 2 deletions(-)
lib/std/os/linux/or1k.zig+2-1| ... | ... | @@ -124,7 +124,8 @@ pub fn clone() callconv(.naked) u32 { |
| 124 | 124 | // r11 r3, r4, r5, r6, r7 |
| 125 | 125 | asm volatile ( |
| 126 | 126 | \\ # Save function pointer and argument pointer on new thread stack |
| 127 | \\ l.andi r4, r4, -4 | |
| 127 | \\ l.addi r13, r0, -4 | |
| 128 | \\ l.and r4, r4, r13 | |
| 128 | 129 | \\ l.addi r4, r4, -8 |
| 129 | 130 | \\ l.sw 0(r4), r3 |
| 130 | 131 | \\ l.sw 4(r4), r6 |
lib/std/start.zig+2-1| ... | ... | @@ -326,7 +326,8 @@ fn _start() callconv(.naked) noreturn { |
| 326 | 326 | \\ l.ori r2, r0, 0 |
| 327 | 327 | \\ l.ori r9, r0, 0 |
| 328 | 328 | \\ l.ori r3, r1, 0 |
| 329 | \\ l.andi r1, r1, -4 | |
| 329 | \\ l.addi r13, r0, -4 | |
| 330 | \\ l.and r1, r1, r13 | |
| 330 | 331 | \\ l.j %[posixCallMainAndExit] |
| 331 | 332 | \\ l.nop |
| 332 | 333 | , |