1.1 --- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp Thu Jul 18 09:35:02 2013 -0700 1.2 +++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp Fri Jul 19 13:59:25 2013 -0700 1.3 @@ -279,7 +279,7 @@ 1.4 __ stmxcsr(mxcsr_save); 1.5 __ movl(rax, mxcsr_save); 1.6 __ andl(rax, MXCSR_MASK); // Only check control and mask bits 1.7 - ExternalAddress mxcsr_std(StubRoutines::x86::mxcsr_std()); 1.8 + ExternalAddress mxcsr_std(StubRoutines::addr_mxcsr_std()); 1.9 __ cmp32(rax, mxcsr_std); 1.10 __ jcc(Assembler::equal, skip_ldmx); 1.11 __ ldmxcsr(mxcsr_std); 1.12 @@ -729,17 +729,18 @@ 1.13 1.14 if (CheckJNICalls) { 1.15 Label ok_ret; 1.16 + ExternalAddress mxcsr_std(StubRoutines::addr_mxcsr_std()); 1.17 __ push(rax); 1.18 __ subptr(rsp, wordSize); // allocate a temp location 1.19 __ stmxcsr(mxcsr_save); 1.20 __ movl(rax, mxcsr_save); 1.21 __ andl(rax, MXCSR_MASK); // Only check control and mask bits 1.22 - __ cmpl(rax, *(int *)(StubRoutines::x86::mxcsr_std())); 1.23 + __ cmp32(rax, mxcsr_std); 1.24 __ jcc(Assembler::equal, ok_ret); 1.25 1.26 __ warn("MXCSR changed by native JNI code, use -XX:+RestoreMXCSROnJNICall"); 1.27 1.28 - __ ldmxcsr(ExternalAddress(StubRoutines::x86::mxcsr_std())); 1.29 + __ ldmxcsr(mxcsr_std); 1.30 1.31 __ bind(ok_ret); 1.32 __ addptr(rsp, wordSize); 1.33 @@ -3767,12 +3768,35 @@ 1.34 return stub->entry_point(); 1.35 } 1.36 1.37 + void create_control_words() { 1.38 + // Round to nearest, 53-bit mode, exceptions masked 1.39 + StubRoutines::_fpu_cntrl_wrd_std = 0x027F; 1.40 + // Round to zero, 53-bit mode, exception mased 1.41 + StubRoutines::_fpu_cntrl_wrd_trunc = 0x0D7F; 1.42 + // Round to nearest, 24-bit mode, exceptions masked 1.43 + StubRoutines::_fpu_cntrl_wrd_24 = 0x007F; 1.44 + // Round to nearest, 64-bit mode, exceptions masked 1.45 + StubRoutines::_fpu_cntrl_wrd_64 = 0x037F; 1.46 + // Round to nearest, 64-bit mode, exceptions masked 1.47 + StubRoutines::_mxcsr_std = 0x1F80; 1.48 + // Note: the following two constants are 80-bit values 1.49 + // layout is critical for correct loading by FPU. 1.50 + // Bias for strict fp multiply/divide 1.51 + StubRoutines::_fpu_subnormal_bias1[0]= 0x00000000; // 2^(-15360) == 0x03ff 8000 0000 0000 0000 1.52 + StubRoutines::_fpu_subnormal_bias1[1]= 0x80000000; 1.53 + StubRoutines::_fpu_subnormal_bias1[2]= 0x03ff; 1.54 + // Un-Bias for strict fp multiply/divide 1.55 + StubRoutines::_fpu_subnormal_bias2[0]= 0x00000000; // 2^(+15360) == 0x7bff 8000 0000 0000 0000 1.56 + StubRoutines::_fpu_subnormal_bias2[1]= 0x80000000; 1.57 + StubRoutines::_fpu_subnormal_bias2[2]= 0x7bff; 1.58 + } 1.59 + 1.60 // Initialization 1.61 void generate_initial() { 1.62 // Generates all stubs and initializes the entry points 1.63 1.64 - // This platform-specific stub is needed by generate_call_stub() 1.65 - StubRoutines::x86::_mxcsr_std = generate_fp_mask("mxcsr_std", 0x0000000000001F80); 1.66 + // This platform-specific settings are needed by generate_call_stub() 1.67 + create_control_words(); 1.68 1.69 // entry points that exist in all platforms Note: This is code 1.70 // that could be shared among different platforms - however the