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

Unified Diff: src/a64/lithium-a64.cc

Issue 148263012: A64: Rejig truncating and non double to i/smi (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/a64/lithium-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/lithium-a64.cc
diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc
index ce36c02925c262e92bc83a6fb039a08fe6ba129a..efc35f83e73f7ccccd8d3fa4d5eb6b0bedab60d7 100644
--- a/src/a64/lithium-a64.cc
+++ b/src/a64/lithium-a64.cc
@@ -1132,21 +1132,20 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2);
return AssignPointerMap(DefineAsRegister(result));
- } else if (to.IsSmi()) {
- // TODO(all): Split LDoubleToSmi into two instructions.
- LOperand* value = UseRegister(instr->value());
- LOperand* temp1 = instr->CanTruncateToInt32() ? TempRegister() : NULL;
- LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() : NULL;
- LDoubleToSmi* result = new(zone()) LDoubleToSmi(value, temp1, temp2);
- return AssignEnvironment(DefineAsRegister(result));
} else {
- // TODO(all): Split LDoubleToI into two instructions, truncating and not.
- ASSERT(to.IsInteger32());
+ ASSERT(to.IsSmi() || to.IsInteger32());
LOperand* value = UseRegister(instr->value());
- LOperand* temp1 = instr->CanTruncateToInt32() ? TempRegister() : NULL;
- LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() : NULL;
- LDoubleToI* result = new(zone()) LDoubleToI(value, temp1, temp2);
- return AssignEnvironment(DefineAsRegister(result));
+
+ if (instr->CanTruncateToInt32()) {
+ LOperand* temp1 = TempRegister();
+ LOperand* temp2 = TempRegister();
+ LTruncateDoubleToIntOrSmi* result =
+ new(zone()) LTruncateDoubleToIntOrSmi(value, temp1, temp2);
+ return DefineAsRegister(result);
+ } else {
+ LDoubleToIntOrSmi* result = new(zone()) LDoubleToIntOrSmi(value);
+ return AssignEnvironment(DefineAsRegister(result));
+ }
}
} else if (from.IsInteger32()) {
info()->MarkAsDeferredCalling();
« no previous file with comments | « src/a64/lithium-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698