Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 6049008: SSE2 truncating double-to-i. (Closed)
Patch Set: Update exponent limit description Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 if (to.IsTagged()) { 1732 if (to.IsTagged()) {
1733 LOperand* value = UseRegister(instr->value()); 1733 LOperand* value = UseRegister(instr->value());
1734 LOperand* temp = TempRegister(); 1734 LOperand* temp = TempRegister();
1735 1735
1736 // Make sure that temp and result_temp are different registers. 1736 // Make sure that temp and result_temp are different registers.
1737 LUnallocated* result_temp = TempRegister(); 1737 LUnallocated* result_temp = TempRegister();
1738 LInstruction* result = new LNumberTagD(value, temp); 1738 LInstruction* result = new LNumberTagD(value, temp);
1739 return AssignPointerMap(Define(result, result_temp)); 1739 return AssignPointerMap(Define(result, result_temp));
1740 } else { 1740 } else {
1741 ASSERT(to.IsInteger32()); 1741 ASSERT(to.IsInteger32());
1742 LOperand* value = UseRegister(instr->value()); 1742 bool needs_temp = instr->CanTruncateToInt32() &&
1743 return AssignEnvironment(DefineAsRegister(new LDoubleToI(value))); 1743 !CpuFeatures::IsSupported(SSE3);
1744 LOperand* value = needs_temp ?
1745 UseTempRegister(instr->value()) : UseRegister(instr->value());
1746 LOperand* temp = needs_temp ? TempRegister() : NULL;
1747 return AssignEnvironment(DefineAsRegister(new LDoubleToI(value, temp)));
1744 } 1748 }
1745 } else if (from.IsInteger32()) { 1749 } else if (from.IsInteger32()) {
1746 if (to.IsTagged()) { 1750 if (to.IsTagged()) {
1747 HValue* val = instr->value(); 1751 HValue* val = instr->value();
1748 LOperand* value = UseRegister(val); 1752 LOperand* value = UseRegister(val);
1749 if (val->HasRange() && val->range()->IsInSmiRange()) { 1753 if (val->HasRange() && val->range()->IsInSmiRange()) {
1750 return DefineSameAsFirst(new LSmiTag(value)); 1754 return DefineSameAsFirst(new LSmiTag(value));
1751 } else { 1755 } else {
1752 LInstruction* result = new LNumberTagI(value); 1756 LInstruction* result = new LNumberTagI(value);
1753 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); 1757 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 void LPointerMap::PrintTo(StringStream* stream) const { 2117 void LPointerMap::PrintTo(StringStream* stream) const {
2114 stream->Add("{"); 2118 stream->Add("{");
2115 for (int i = 0; i < pointer_operands_.length(); ++i) { 2119 for (int i = 0; i < pointer_operands_.length(); ++i) {
2116 if (i != 0) stream->Add(";"); 2120 if (i != 0) stream->Add(";");
2117 pointer_operands_[i]->PrintTo(stream); 2121 pointer_operands_[i]->PrintTo(stream);
2118 } 2122 }
2119 stream->Add("} @%d", position()); 2123 stream->Add("} @%d", position());
2120 } 2124 }
2121 2125
2122 } } // namespace v8::internal 2126 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698