Commit b89c5384 authored by Ken Thompson's avatar Ken Thompson

fixed unary ^ opcode (bug082)

R=r
DELTA=11  (10 added, 1 deleted, 0 changed)
OCL=14047
CL=14047
parent 091047f3
...@@ -101,8 +101,17 @@ cgen(Node *n, Node *res) ...@@ -101,8 +101,17 @@ cgen(Node *n, Node *res)
goto ret; goto ret;
// unary // unary
case OMINUS:
case OCOM: case OCOM:
a = optoas(OXOR, nl->type);
regalloc(&n1, nl->type, N);
cgen(nl, &n1);
nodconst(&n2, nl->type, -1);
gins(a, &n2, &n1);
gmove(&n1, res);
regfree(&n1);
goto ret;
case OMINUS:
a = optoas(n->op, nl->type); a = optoas(n->op, nl->type);
goto uop; goto uop;
......
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