Commit 8720b472 authored by Russ Cox's avatar Russ Cox

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
parent 01fe6a9c
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment