@@ -2048,23 +2048,6 @@ void MacroAssembler::cmp_klass(Register oop, Register trial_klass, Register tmp1
20482048 beq (trial_klass, tmp1, L);
20492049}
20502050
2051- // Multiply and multiply-accumulate unsigned 64-bit registers.
2052- void MacroAssembler::wide_mul (Register prod_lo, Register prod_hi, Register n, Register m) {
2053- assert_different_registers (prod_lo, prod_hi);
2054-
2055- mul (prod_lo, n, m);
2056- mulhu (prod_hi, n, m);
2057- }
2058- void MacroAssembler::wide_madd (Register sum_lo, Register sum_hi, Register n,
2059- Register m, Register tmp1, Register tmp2) {
2060- assert_different_registers (sum_lo, sum_hi);
2061- assert_different_registers (sum_hi, tmp2);
2062-
2063- wide_mul (tmp1, tmp2, n, m);
2064- cad (sum_lo, sum_lo, tmp1, tmp1); // Add tmp1 to sum_lo with carry output to tmp1
2065- adc (sum_hi, sum_hi, tmp2, tmp1); // Add tmp2 with carry to sum_hi
2066- }
2067-
20682051// Move an oop into a register.
20692052void MacroAssembler::movoop (Register dst, jobject obj) {
20702053 int oop_index;
@@ -3576,6 +3559,24 @@ void MacroAssembler::mul_add(Register out, Register in, Register offset,
35763559 bind (L_end);
35773560}
35783561
3562+ // Multiply and multiply-accumulate unsigned 64-bit registers.
3563+ void MacroAssembler::wide_mul (Register prod_lo, Register prod_hi, Register n, Register m) {
3564+ assert_different_registers (prod_lo, prod_hi);
3565+
3566+ mul (prod_lo, n, m);
3567+ mulhu (prod_hi, n, m);
3568+ }
3569+
3570+ void MacroAssembler::wide_madd (Register sum_lo, Register sum_hi, Register n,
3571+ Register m, Register tmp1, Register tmp2) {
3572+ assert_different_registers (sum_lo, sum_hi);
3573+ assert_different_registers (sum_hi, tmp2);
3574+
3575+ wide_mul (tmp1, tmp2, n, m);
3576+ cad (sum_lo, sum_lo, tmp1, tmp1); // Add tmp1 to sum_lo with carry output to tmp1
3577+ adc (sum_hi, sum_hi, tmp2, tmp1); // Add tmp2 with carry to sum_hi
3578+ }
3579+
35793580// add two unsigned input and output carry
35803581void MacroAssembler::cad (Register dst, Register src1, Register src2, Register carry)
35813582{
0 commit comments