Template support several multiplication modes.