905 |
905 |
906 // compute pow(x,y) and exp(x) with x86 instructions. Don't cover |
906 // compute pow(x,y) and exp(x) with x86 instructions. Don't cover |
907 // all corner cases and may result in NaN and require fallback to a |
907 // all corner cases and may result in NaN and require fallback to a |
908 // runtime call. |
908 // runtime call. |
909 void fast_pow(); |
909 void fast_pow(); |
910 void fast_exp(); |
910 void fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, |
|
911 XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, |
|
912 Register rax, Register rcx, Register rdx, Register tmp); |
911 void increase_precision(); |
913 void increase_precision(); |
912 void restore_precision(); |
914 void restore_precision(); |
913 |
915 |
914 // computes exp(x). Fallback to runtime call included. |
|
915 void exp_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(true, num_fpu_regs_in_use); } |
|
916 // computes pow(x,y). Fallback to runtime call included. |
916 // computes pow(x,y). Fallback to runtime call included. |
917 void pow_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(false, num_fpu_regs_in_use); } |
917 void pow_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(num_fpu_regs_in_use); } |
918 |
918 |
919 private: |
919 private: |
920 |
920 |
921 // call runtime as a fallback for trig functions and pow/exp. |
921 // call runtime as a fallback for trig functions and pow/exp. |
922 void fp_runtime_fallback(address runtime_entry, int nb_args, int num_fpu_regs_in_use); |
922 void fp_runtime_fallback(address runtime_entry, int nb_args, int num_fpu_regs_in_use); |
923 |
923 |
924 // computes 2^(Ylog2X); Ylog2X in ST(0) |
924 // computes 2^(Ylog2X); Ylog2X in ST(0) |
925 void pow_exp_core_encoding(); |
925 void pow_exp_core_encoding(); |
926 |
926 |
927 // computes pow(x,y) or exp(x). Fallback to runtime call included. |
927 // computes pow(x,y) or exp(x). Fallback to runtime call included. |
928 void pow_or_exp(bool is_exp, int num_fpu_regs_in_use); |
928 void pow_or_exp(int num_fpu_regs_in_use); |
929 |
929 |
930 // these are private because users should be doing movflt/movdbl |
930 // these are private because users should be doing movflt/movdbl |
931 |
931 |
932 void movss(Address dst, XMMRegister src) { Assembler::movss(dst, src); } |
932 void movss(Address dst, XMMRegister src) { Assembler::movss(dst, src); } |
933 void movss(XMMRegister dst, XMMRegister src) { Assembler::movss(dst, src); } |
933 void movss(XMMRegister dst, XMMRegister src) { Assembler::movss(dst, src); } |
968 |
968 |
969 void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); } |
969 void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); } |
970 void movsd(Address dst, XMMRegister src) { Assembler::movsd(dst, src); } |
970 void movsd(Address dst, XMMRegister src) { Assembler::movsd(dst, src); } |
971 void movsd(XMMRegister dst, Address src) { Assembler::movsd(dst, src); } |
971 void movsd(XMMRegister dst, Address src) { Assembler::movsd(dst, src); } |
972 void movsd(XMMRegister dst, AddressLiteral src); |
972 void movsd(XMMRegister dst, AddressLiteral src); |
|
973 |
|
974 void mulpd(XMMRegister dst, XMMRegister src) { Assembler::mulpd(dst, src); } |
|
975 void mulpd(XMMRegister dst, Address src) { Assembler::mulpd(dst, src); } |
|
976 void mulpd(XMMRegister dst, AddressLiteral src); |
973 |
977 |
974 void mulsd(XMMRegister dst, XMMRegister src) { Assembler::mulsd(dst, src); } |
978 void mulsd(XMMRegister dst, XMMRegister src) { Assembler::mulsd(dst, src); } |
975 void mulsd(XMMRegister dst, Address src) { Assembler::mulsd(dst, src); } |
979 void mulsd(XMMRegister dst, Address src) { Assembler::mulsd(dst, src); } |
976 void mulsd(XMMRegister dst, AddressLiteral src); |
980 void mulsd(XMMRegister dst, AddressLiteral src); |
977 |
981 |