src/cpu/x86/vm/macroAssembler_x86.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/cpu/x86/vm/macroAssembler_x86.cpp
src/cpu/x86/vm/macroAssembler_x86.cpp
Print this page
rev 7609 : 8063086: Math.pow yields different results upon repeated calls
Summary: C2 treats x^2 as a special case and computes x * x while the interpreter and c1 don't have special case code for X^2.
Reviewed-by:
*** 3182,3192 ****
ffree(1);
}
jmp(done);
} else {
// Stack: X Y
! Label x_negative, y_odd;
fldz(); // Stack: 0 X Y
fcmp(tmp, 1, true, false); // Stack: X Y
jcc(Assembler::above, x_negative);
--- 3182,3207 ----
ffree(1);
}
jmp(done);
} else {
// Stack: X Y
! Label x_negative, y_not_2;
!
! static double two = 2.0;
! ExternalAddress two_addr((address)&two);
!
! fld_d(two_addr); // Stack: 2 X Y
! fcmp(tmp, 2, true, false); // Stack: X Y
! jcc(Assembler::parity, y_not_2);
! jcc(Assembler::notEqual, y_not_2);
!
! fxch(); fpop(); // Stack: X
! fmul(0); // Stack: X*X
!
! jmp(done);
!
! bind(y_not_2);
fldz(); // Stack: 0 X Y
fcmp(tmp, 1, true, false); // Stack: X Y
jcc(Assembler::above, x_negative);
src/cpu/x86/vm/macroAssembler_x86.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File