mirror of https://github.com/golang/go.git
fixed unary ^ opcode (bug082)
R=r DELTA=11 (10 added, 1 deleted, 0 changed) OCL=14047 CL=14047
This commit is contained in:
parent
091047f36c
commit
b89c538473
|
|
@ -101,8 +101,17 @@ cgen(Node *n, Node *res)
|
|||
goto ret;
|
||||
|
||||
// unary
|
||||
case OMINUS:
|
||||
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);
|
||||
goto uop;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue