shithub: riscv

Download patch

ref: 0b268440b9d557f64cba6f7db644a6536fa2b158
parent: 029a8087a35bf8fcc3f6e5418af6ae996d640364
author: cinap_lenrek <[email protected]>
date: Thu Jan 31 19:15:02 EST 2013

6l: eleminate NOP X0 instructions (from eriks 6l-nop-x0 patch)

erik found that -N left NOPs in that 6l couldn't ignore.
add Xn to the NOP table.

bonanza; cat > fp.c
#include <u.h>
#include <libc.h>
#include <stdio.h>

void
main(void)
{
        double g;

        g = -0.;

        print("%g\n", g);
        printf("%g\n", g);
        exits("");
}
bonanza; 6c -N -FVTw fp.c
bonanza; 6l -o 6.fp fp.6
main: doasm: notfound from=6f to=34 (939)       NOP     ,X0
main: doasm: notfound from=6f to=34 (939)       NOP     ,X0
main: doasm: notfound from=6f to=34 (939)       NOP     ,X0

--- a/sys/src/cmd/6l/optab.c
+++ b/sys/src/cmd/6l/optab.c
@@ -15,8 +15,10 @@
 	Ynone,	Ynone,	Zpseudo,1,
 	Ynone,	Yml,	Zpseudo,1,
 	Ynone,	Yrf,	Zpseudo,1,
+	Ynone,	Yxr,	Zpseudo,1,
 	Yml,	Ynone,	Zpseudo,1,
 	Yrf,	Ynone,	Zpseudo,1,
+	Yxr,	Ynone,	Zpseudo,1,
 	0
 };
 uchar	yxorb[] =