From: Russ Cox Date: Sat, 6 Jun 2009 06:12:07 +0000 (-0700) Subject: use cc provided xlog2 instead of system log2. X-Git-Tag: weekly.2009-11-06~1447 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8720b4721f76c852c237fad28ce252dad07d785f;p=gostls13.git 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 --- diff --git a/src/cmd/8c/cgen.c b/src/cmd/8c/cgen.c index 8c5bf7b155..1df03ef50c 100644 --- a/src/cmd/8c/cgen.c +++ b/src/cmd/8c/cgen.c @@ -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 */