src/cpu/x86/vm/assembler_x86.hpp

Print this page
rev 3362 : 7174532: jdk/test/java/lang/Math/WorstCaseTests.java failing on x86
Summary: increase precision on x86 for the steps of the computation of exp and pow.
Reviewed-by:


2378   void fld_s(Address src) { Assembler::fld_s(src); }
2379   void fld_s(AddressLiteral src);
2380 
2381   void fld_d(Address src) { Assembler::fld_d(src); }
2382   void fld_d(AddressLiteral src);
2383 
2384   void fld_x(Address src) { Assembler::fld_x(src); }
2385   void fld_x(AddressLiteral src);
2386 
2387   void fmul_s(Address src)        { Assembler::fmul_s(src); }
2388   void fmul_s(AddressLiteral src) { Assembler::fmul_s(as_Address(src)); }
2389 
2390   void ldmxcsr(Address src) { Assembler::ldmxcsr(src); }
2391   void ldmxcsr(AddressLiteral src);
2392 
2393   // compute pow(x,y) and exp(x) with x86 instructions. Don't cover
2394   // all corner cases and may result in NaN and require fallback to a
2395   // runtime call.
2396   void fast_pow();
2397   void fast_exp();


2398 
2399   // computes exp(x). Fallback to runtime call included.
2400   void exp_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(true, num_fpu_regs_in_use); }
2401   // computes pow(x,y). Fallback to runtime call included.
2402   void pow_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(false, num_fpu_regs_in_use); }
2403 
2404 private:
2405 
2406   // call runtime as a fallback for trig functions and pow/exp.
2407   void fp_runtime_fallback(address runtime_entry, int nb_args, int num_fpu_regs_in_use);
2408 
2409   // computes 2^(Ylog2X); Ylog2X in ST(0)
2410   void pow_exp_core_encoding();
2411 
2412   // computes pow(x,y) or exp(x). Fallback to runtime call included.
2413   void pow_or_exp(bool is_exp, int num_fpu_regs_in_use);
2414 
2415   // these are private because users should be doing movflt/movdbl
2416 
2417   void movss(Address dst, XMMRegister src)     { Assembler::movss(dst, src); }




2378   void fld_s(Address src) { Assembler::fld_s(src); }
2379   void fld_s(AddressLiteral src);
2380 
2381   void fld_d(Address src) { Assembler::fld_d(src); }
2382   void fld_d(AddressLiteral src);
2383 
2384   void fld_x(Address src) { Assembler::fld_x(src); }
2385   void fld_x(AddressLiteral src);
2386 
2387   void fmul_s(Address src)        { Assembler::fmul_s(src); }
2388   void fmul_s(AddressLiteral src) { Assembler::fmul_s(as_Address(src)); }
2389 
2390   void ldmxcsr(Address src) { Assembler::ldmxcsr(src); }
2391   void ldmxcsr(AddressLiteral src);
2392 
2393   // compute pow(x,y) and exp(x) with x86 instructions. Don't cover
2394   // all corner cases and may result in NaN and require fallback to a
2395   // runtime call.
2396   void fast_pow();
2397   void fast_exp();
2398   void increase_precision();
2399   void restore_precision();
2400 
2401   // computes exp(x). Fallback to runtime call included.
2402   void exp_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(true, num_fpu_regs_in_use); }
2403   // computes pow(x,y). Fallback to runtime call included.
2404   void pow_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(false, num_fpu_regs_in_use); }
2405 
2406 private:
2407 
2408   // call runtime as a fallback for trig functions and pow/exp.
2409   void fp_runtime_fallback(address runtime_entry, int nb_args, int num_fpu_regs_in_use);
2410 
2411   // computes 2^(Ylog2X); Ylog2X in ST(0)
2412   void pow_exp_core_encoding();
2413 
2414   // computes pow(x,y) or exp(x). Fallback to runtime call included.
2415   void pow_or_exp(bool is_exp, int num_fpu_regs_in_use);
2416 
2417   // these are private because users should be doing movflt/movdbl
2418 
2419   void movss(Address dst, XMMRegister src)     { Assembler::movss(dst, src); }