]> Cypherpunks repositories - gostls13.git/commitdiff
5g: complex "regalloc"
authorRuss Cox <rsc@golang.org>
Mon, 25 Oct 2010 23:26:33 +0000 (01:26 +0200)
committerRuss Cox <rsc@golang.org>
Mon, 25 Oct 2010 23:26:33 +0000 (01:26 +0200)
R=ken2
CC=golang-dev
https://golang.org/cl/2727041

src/cmd/5g/gsubr.c

index 3b68ac1bc277918edf31f3cd9cd6f942de0348ab..7089b71850d2970fc86519d562a4b3f12d4784c1 100644 (file)
@@ -305,6 +305,11 @@ regalloc(Node *n, Type *t, Node *o)
                                goto out;
                yyerror("out of floating point registers");
                goto err;
+
+       case TCOMPLEX64:
+       case TCOMPLEX128:
+               tempname(n, t);
+               return;
        }
        yyerror("regalloc: unknown type %T", t);
 
@@ -334,6 +339,8 @@ regfree(Node *n)
                print("regalloc fix %d float %d\n", fixfree, floatfree);
        }
 
+       if(n->op == ONAME && iscomplex[n->type->etype])
+               return;
        if(n->op != OREGISTER && n->op != OINDREG)
                fatal("regfree: not a register");
        i = n->val.u.reg;