use mulhwu and eliminate temporary in 64-bit multiplyRR

This commit is contained in:
Joel Dice 2009-03-04 19:50:03 -07:00
parent 77195713b8
commit 3e495b8ca5

View File

@ -681,14 +681,12 @@ void subC(Context* con, unsigned size, Const* a, Reg* b, Reg* t) {
void multiplyR(Context* con, unsigned size, Reg* a, Reg* b, Reg* t) {
if(size == 8) {
Reg tmp(getTemp(con));
issue(con, mullw(H(t), H(a), R(b)));
issue(con, mullw(R(&tmp), R(a), H(b)));
issue(con, add(H(t), H(t), R(&tmp)));
issue(con, mulhw(R(&tmp), R(a), R(b)));
issue(con, add(H(t), H(t), R(&tmp)));
issue(con, mullw(R(t), R(a), H(b)));
issue(con, add(H(t), H(t), R(t)));
issue(con, mulhwu(R(t), R(a), R(b)));
issue(con, add(H(t), H(t), R(t)));
issue(con, mullw(R(t), R(a), R(b)));
freeTemp(con, R(&tmp));
} else {
issue(con, mullw(R(t), R(a), R(b)));
}