1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00

[dev.power64] cmd/9g: correct floating point comparison

LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/129210043
This commit is contained in:
Russ Cox 2014-08-14 14:34:37 -04:00
parent ecbe6b9f7f
commit aa739b8d03

View File

@ -1267,9 +1267,9 @@ bgen(Node *n, int true, int likely, Prog *to)
l = &n1;
r = &n2;
gins(optoas(OCMP, nr->type), l, r);
if(isfloat[nr->type->etype] && (n->op == OLE || n->op == OGE)) {
if(isfloat[nr->type->etype] && (a == OLE || a == OGE)) {
// To get NaN right, must rewrite x <= y into separate x < y or x = y.
switch(n->op) {
switch(a) {
case OLE:
a = OLT;
break;