From 79390123903f4a8b6e973f2d4e3743948b97aeb8 Mon Sep 17 00:00:00 2001 From: "weiliang.lin@intel.com" Date: Wed, 5 Nov 2014 10:01:22 +0000 Subject: 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 --- src/version.cc | 2 +- src/x87/lithium-codegen-x87.cc | 10 ++++------ src/x87/macro-assembler-x87.cc | 7 +++++++ 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); -- cgit v1.2.3 From ae4728945755838c8d6450f0a344eb4b583c4dd5 Mon Sep 17 00:00:00 2001 From: "weiliang.lin@intel.com" Date: Mon, 10 Nov 2014 09:08:28 +0000 Subject: Version 3.29.88.17 (merged r25226) X87: fix one GC issue caused by x87 crankshaft. R=jkummerow@chromium.org BUG= Review URL: https://codereview.chromium.org/712933002 Cr-Commit-Position: refs/branch-heads/3.29@{#25232} git-svn-id: https://v8.googlecode.com/svn/branches/3.29@25232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/version.cc | 2 +- src/x87/lithium-codegen-x87.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/version.cc b/src/version.cc index 461a65362..a6c529e36 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 16 +#define PATCH_LEVEL 17 // 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 75bf0a9e0..a5bc5eae0 100644 --- a/src/x87/lithium-codegen-x87.cc +++ b/src/x87/lithium-codegen-x87.cc @@ -4060,8 +4060,8 @@ void LCodeGen::DoMathSqrt(LMathSqrt* instr) { __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); __ push(temp_result); __ CallRuntimeSaveDoubles(Runtime::kMathSqrtRT); - RecordSafepointWithRegisters( - instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); + RecordSafepointWithRegisters(instr->pointer_map(), 1, + Safepoint::kNoLazyDeopt); __ StoreToSafepointRegisterSlot(temp_result, eax); } X87PrepareToWrite(result_reg); @@ -4275,7 +4275,7 @@ void LCodeGen::DoMathExp(LMathExp* instr) { __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); __ push(temp_result); __ CallRuntimeSaveDoubles(Runtime::kMathExpRT); - RecordSafepointWithRegisters(instr->pointer_map(), 0, + RecordSafepointWithRegisters(instr->pointer_map(), 1, Safepoint::kNoLazyDeopt); __ StoreToSafepointRegisterSlot(temp_result, eax); } -- cgit v1.2.3