summaryrefslogtreecommitdiff
path: root/sys/src/cmd/7l/asmout.c
diff options
context:
space:
mode:
authorSigrid Solveig Haflínudóttir <sigrid@ftrv.se>2023-05-16 15:39:00 +0000
committerSigrid Solveig Haflínudóttir <sigrid@ftrv.se>2023-05-16 15:39:00 +0000
commitd4ce962fe33f3eca8da0b4ab2b5a81cc5359b71f (patch)
tree07d7ec1e80533b83d78dbd1838f701a8a56779c8 /sys/src/cmd/7l/asmout.c
parent5e4b3a7490d301a7547a021bf1cf1e2d0f25de21 (diff)
7l: use floating point immediates where possible
Diffstat (limited to 'sys/src/cmd/7l/asmout.c')
-rw-r--r--sys/src/cmd/7l/asmout.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/src/cmd/7l/asmout.c b/sys/src/cmd/7l/asmout.c
index 9d29c30e3..342c35687 100644
--- a/sys/src/cmd/7l/asmout.c
+++ b/sys/src/cmd/7l/asmout.c
@@ -742,12 +742,11 @@ asmout(Prog *p, Optab *o)
o1 = oprrr(p->as);
if(p->from.type == D_FCONST) {
rf = chipfloat(p->from.ieee);
- if(rf < 0 || 1){
+ if(rf < 0)
diag("invalid floating-point immediate\n%P", p);
- rf = 0;
- }
- rf |= (1<<3);
- } else
+ rf = rf<<(13-5) | 1<<(12-5);
+ o1 &= ~(0x10<<10);
+ }else
rf = p->from.reg;
rt = p->to.reg;
r = p->reg;
@@ -756,7 +755,7 @@ asmout(Prog *p, Optab *o)
rf = 0;
}else if(r == NREG)
r = rt;
- o1 |= (rf << 16) | (r<<5) | rt;
+ o1 |= rf<<16 | r<<5 | rt;
break;
case 56: /* floating point compare */