From 46100d9cef5a2165f03b40b4f4076658efeb2446 Mon Sep 17 00:00:00 2001 From: "ricow@chromium.org" Date: Mon, 30 May 2011 07:53:21 +0000 Subject: [PATCH] Allocate normal register for LDoubleToI in DoToInt32 (fixes no-sse3 issue) Review URL: http://codereview.chromium.org/7083021 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ia32/lithium-ia32.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index ea4bd6f..401da7a 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -1797,18 +1797,13 @@ LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { LInstruction* LChunkBuilder::DoToInt32(HToInt32* instr) { HValue* value = instr->value(); Representation input_rep = value->representation(); - // Register allocator doesn't (yet) support allocation of double - // temps. Reserve xmm1 explicitly. - LOperand* xmm_temp = - CpuFeatures::IsSupported(SSE3) - ? NULL - : FixedTemp(xmm1); + LInstruction* result; if (input_rep.IsDouble()) { LOperand* reg = UseRegister(value); - // Register allocator doesn't (yet) support allocation of double - // temps. Reserve xmm1 explicitly. - result = DefineAsRegister(new LDoubleToI(reg, xmm_temp)); + LOperand* temp_reg = + CpuFeatures::IsSupported(SSE3) ? NULL : TempRegister(); + result = DefineAsRegister(new LDoubleToI(reg, temp_reg)); } else if (input_rep.IsInteger32()) { // Canonicalization should already have removed the hydrogen instruction in // this case, since it is a noop. @@ -1817,6 +1812,10 @@ LInstruction* LChunkBuilder::DoToInt32(HToInt32* instr) { } else { ASSERT(input_rep.IsTagged()); LOperand* reg = UseRegister(value); + // Register allocator doesn't (yet) support allocation of double + // temps. Reserve xmm1 explicitly. + LOperand* xmm_temp = + CpuFeatures::IsSupported(SSE3) ? NULL : FixedTemp(xmm1); result = DefineSameAsFirst(new LTaggedToI(reg, xmm_temp)); } return AssignEnvironment(result); -- 2.7.4