1
0
mirror of https://github.com/golang/go synced 2024-11-26 01:37:58 -07:00

use cc provided xlog2 instead of system log2.

(on plan 9 cc calls it log2, but that conflicts here.)
the difference is that xlog2 returns -1 on non powers of 2.
8c was rewriting /10 into /8.

R=ken
OCL=29968
CL=29968
This commit is contained in:
Russ Cox 2009-06-05 23:12:07 -07:00
parent 01fe6a9c58
commit 8720b4721f

View File

@ -346,7 +346,7 @@ cgen(Node *n, Node *nn)
c = r->vconst;
if(c < 0)
c = -c;
v = log2(c);
v = xlog2(c);
if(v < 0)
break;
/* fall thru */
@ -609,7 +609,7 @@ cgen(Node *n, Node *nn)
c = r->vconst;
if(c < 0)
c = -c;
v = log2(c);
v = xlog2(c);
if(v < 0)
break;
/* fall thru */