changeset 3755:e2961d14584b

7169934: pow(x,y) or x64 computes incorrect result when x<0 and y is an odd integer Summary: bad test for parity of y in pow(x,y) (c1, interpreter) Reviewed-by: kvn, twisti
author roland
date Mon, 21 May 2012 09:46:02 +0200
parents cdd249497b34
children 7089278210e2
files src/cpu/x86/vm/assembler_x86.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/x86/vm/assembler_x86.cpp	Fri May 18 12:20:24 2012 -0700
+++ b/src/cpu/x86/vm/assembler_x86.cpp	Mon May 21 09:46:02 2012 +0200
@@ -6954,7 +6954,7 @@
     tmp = rdx;
   }
   Register tmp2 = rax;
-  NOT_LP64(Register tmp3 = rcx;)
+  Register tmp3 = rcx;
 
   if (is_exp) {
     // Stack: X
@@ -7081,7 +7081,8 @@
 #else
     {
       Label integer;
-      shlq(tmp2, 1);
+      mov(tmp3, tmp2); // preserve tmp2 for parity check below
+      shlq(tmp3, 1);
       jcc(Assembler::carryClear, integer);
       jcc(Assembler::notZero, integer);
       stop("integer indefinite value shouldn't be seen here");