summaryrefslogtreecommitdiff
path: root/sys/src/cmd/5c/cgen.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-09-20 14:58:43 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-09-20 14:58:43 +0200
commit539fe6990fecc38bd3b634be5857da3ee59bafee (patch)
tree79bbca17cf6af0c3e34869eba2e128732e06c8c1 /sys/src/cmd/5c/cgen.c
parent171aafcc229b0b2d1fb058d09eb4170008f91eb6 (diff)
5c: apply richard millers 5c-nan-cmp patch (from sources)
On ARM, it turns out that comparisons with NaN can be made to do the right thing with no code penalty, by a more careful selection of condition code values in the subsequent conditional branch. The meaning of the CC bits in the PSR is subtly different when they've been copied from the floating point status register. Suggested patch is 5c-nan-cmp (works on both vfp and emulated arm7500).
Diffstat (limited to 'sys/src/cmd/5c/cgen.c')
-rw-r--r--sys/src/cmd/5c/cgen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/cmd/5c/cgen.c b/sys/src/cmd/5c/cgen.c
index c639b180f..18971103b 100644
--- a/sys/src/cmd/5c/cgen.c
+++ b/sys/src/cmd/5c/cgen.c
@@ -701,7 +701,7 @@ boolgen(Node *n, int true, Node *nn)
if(true)
o = comrel[relindex(o)];
if(typefd[n->type->etype]) {
- gopcode(o, nodfconst(0), &nod, Z);
+ gopcode(true ? o | BTRUE : o, nodfconst(0), &nod, Z);
} else
gopcode(o, nodconst(0), &nod, Z);
regfree(&nod);
@@ -800,14 +800,14 @@ boolgen(Node *n, int true, Node *nn)
regalloc(&nod, r, nn);
cgenrel(r, &nod, 1);
o = invrel[relindex(o)];
- gopcode(o, l, &nod, Z);
+ gopcode(true ? o | BTRUE : o, l, &nod, Z);
regfree(&nod);
goto com;
}
if(sconst(r)) {
regalloc(&nod, l, nn);
cgenrel(l, &nod, 1);
- gopcode(o, r, &nod, Z);
+ gopcode(true ? o | BTRUE : o, r, &nod, Z);
regfree(&nod);
goto com;
}
@@ -822,7 +822,7 @@ boolgen(Node *n, int true, Node *nn)
regalloc(&nod1, l, Z);
cgenrel(l, &nod1, 1);
}
- gopcode(o, &nod, &nod1, Z);
+ gopcode(true ? o | BTRUE : o, &nod, &nod1, Z);
regfree(&nod);
regfree(&nod1);