On amd64
benchmark old ns/op new ns/op delta
BenchmarkHashStringSpeed 91 74 -18.49%
BenchmarkHashInt32Speed 54 45 -17.88%
BenchmarkHashInt64Speed 76 58 -23.53%
BenchmarkHashStringArraySpeed 231 188 -18.61%
Fixes #5367.
R=golang-dev, iant, dave, daniel.morsing, ality, rsc
CC=golang-dev
https://golang.org/cl/
9040043
}
}
- 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)) {
gopcode(OMUL, n->type, r, &nod); /* addressible */
gmove(&nod, nn);
regfree(&nod);
+ reg[D_DX]--;
break;
}
}
}
- 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) {
gopcode(OMUL, n->type, r, &nod); /* addressible */
gmove(&nod, nn);
regfree(&nod);
+ reg[D_DX]--;
break;
}