diff options
author | weiliang.lin@intel.com <weiliang.lin@intel.com> | 2014-11-05 10:01:22 +0000 |
---|---|---|
committer | weiliang.lin@intel.com <weiliang.lin@intel.com> | 2014-11-05 10:01:51 +0000 |
commit | 79390123903f4a8b6e973f2d4e3743948b97aeb8 (patch) | |
tree | cffa3cb99ada678156d19d5b5fef3ed2141326f3 | |
parent | 144d97d24909783cb4f72356da27b1b815446053 (diff) | |
download | v8-79390123903f4a8b6e973f2d4e3743948b97aeb8.tar.gz |
Version 3.29.88.16 (merged r25125)
x87: Set the FPU precision control to double-precision.
R=jkummerow@chromium.org
BUG=
Review URL: https://codereview.chromium.org/700943004
Cr-Commit-Position: refs/branch-heads/3.29@{#25137}
git-svn-id: https://v8.googlecode.com/svn/branches/3.29@25137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
-rw-r--r-- | src/version.cc | 2 | ||||
-rw-r--r-- | src/x87/lithium-codegen-x87.cc | 10 | ||||
-rw-r--r-- | src/x87/macro-assembler-x87.cc | 7 | ||||
-rw-r--r-- | src/x87/macro-assembler-x87.h | 1 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/version.cc b/src/version.cc index 75846224d..461a65362 100644 --- a/src/version.cc +++ b/src/version.cc @@ -35,7 +35,7 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 29 #define BUILD_NUMBER 88 -#define PATCH_LEVEL 15 +#define PATCH_LEVEL 16 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) #define IS_CANDIDATE_VERSION 0 diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc index 00bbe5e72..75bf0a9e0 100644 --- a/src/x87/lithium-codegen-x87.cc +++ b/src/x87/lithium-codegen-x87.cc @@ -2272,6 +2272,8 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { if (instr->op() != Token::MOD) { X87PrepareBinaryOp(left, right, result); } + // Set the precision control to double-precision. + __ X87SetFPUCW(0x027F); switch (instr->op()) { case Token::ADD: __ fadd_i(1); @@ -2306,12 +2308,8 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { break; } - // Only always explicitly storing to memory to force the round-down for double - // arithmetic. - __ lea(esp, Operand(esp, -kDoubleSize)); - __ fstp_d(Operand(esp, 0)); - __ fld_d(Operand(esp, 0)); - __ lea(esp, Operand(esp, kDoubleSize)); + // Restore the default value of control word. + __ X87SetFPUCW(0x037F); } diff --git a/src/x87/macro-assembler-x87.cc b/src/x87/macro-assembler-x87.cc index 47a46d4e3..a1fa3317d 100644 --- a/src/x87/macro-assembler-x87.cc +++ b/src/x87/macro-assembler-x87.cc @@ -767,6 +767,13 @@ void MacroAssembler::X87SetRC(int rc) { } +void MacroAssembler::X87SetFPUCW(int cw) { + push(Immediate(cw)); + fldcw(MemOperand(esp, 0)); + add(esp, Immediate(kPointerSize)); +} + + void MacroAssembler::AssertNumber(Register object) { if (emit_debug_code()) { Label ok; diff --git a/src/x87/macro-assembler-x87.h b/src/x87/macro-assembler-x87.h index ed0b7c174..c9e9087f9 100644 --- a/src/x87/macro-assembler-x87.h +++ b/src/x87/macro-assembler-x87.h @@ -425,6 +425,7 @@ class MacroAssembler: public Assembler { void FXamSign(); void X87CheckIA(); void X87SetRC(int rc); + void X87SetFPUCW(int cw); void ClampUint8(Register reg); void ClampTOSToUint8(Register result_reg); |