diff --git a/src/cmd/6c/cgen.c b/src/cmd/6c/cgen.c index 95400c44535..7afacb21778 100644 --- a/src/cmd/6c/cgen.c +++ b/src/cmd/6c/cgen.c @@ -392,13 +392,13 @@ cgen(Node *n, Node *nn) } } - if(o == OMUL) { + if(o == OMUL || o == OLMUL) { if(l->addable >= INDEXED) { t = l; l = r; r = t; } - /* should favour AX */ + reg[D_DX]++; // for gopcode case OMUL regalloc(&nod, l, nn); cgen(l, &nod); if(r->addable < INDEXED || hardconst(r)) { @@ -410,6 +410,7 @@ cgen(Node *n, Node *nn) gopcode(OMUL, n->type, r, &nod); /* addressible */ gmove(&nod, nn); regfree(&nod); + reg[D_DX]--; break; } diff --git a/src/cmd/8c/cgen.c b/src/cmd/8c/cgen.c index 78eb7ecedb3..4d4ae13abee 100644 --- a/src/cmd/8c/cgen.c +++ b/src/cmd/8c/cgen.c @@ -404,13 +404,13 @@ cgen(Node *n, Node *nn) } } - if(o == OMUL) { + if(o == OMUL || o == OLMUL) { if(l->addable >= INDEXED) { t = l; l = r; r = t; } - /* should favour AX */ + reg[D_DX]++; // for gopcode case OMUL regalloc(&nod, l, nn); cgen(l, &nod); if(r->addable < INDEXED) { @@ -422,6 +422,7 @@ cgen(Node *n, Node *nn) gopcode(OMUL, n->type, r, &nod); /* addressible */ gmove(&nod, nn); regfree(&nod); + reg[D_DX]--; break; }