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

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

Issue 152133003: A64: Add support for SMI representation to MulConstI. Also add a test. (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 | « no previous file | src/a64/lithium-codegen-a64.cc » ('j') | src/a64/lithium-codegen-a64.cc » ('J')
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 e85059243bd0c344486426d97e7ac1b672d4f7a2..26bb2ab5b21f8eb343069ad146468e66d6ee0c1b 100644
--- a/src/a64/lithium-a64.cc
+++ b/src/a64/lithium-a64.cc
@@ -1853,23 +1853,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* hmod) {
LInstruction* LChunkBuilder::DoMul(HMul* instr) {
- if (instr->representation().IsSmi()) {
- // TODO(jbramley): Implement LMulConstS, then merge this into the Integer32
- // case.
- ASSERT(instr->left()->representation().Equals(instr->representation()));
- ASSERT(instr->right()->representation().Equals(instr->representation()));
-
- bool can_overflow = instr->CheckFlag(HValue::kCanOverflow);
- bool bailout_on_minus_zero = instr->CheckFlag(HValue::kBailoutOnMinusZero);
- bool needs_environment = can_overflow || bailout_on_minus_zero;
-
- LOperand* left = UseRegister(instr->BetterLeftOperand());
- LOperand* right = UseRegister(instr->BetterRightOperand());
-
- LMulS* mul = new(zone()) LMulS(left, right);
- if (needs_environment) AssignEnvironment(mul);
- return DefineAsRegister(mul);
- } else if (instr->representation().IsSmiOrInteger32()) {
+ if (instr->representation().IsSmiOrInteger32()) {
ASSERT(instr->left()->representation().Equals(instr->representation()));
ASSERT(instr->right()->representation().Equals(instr->representation()));
@@ -1903,12 +1887,19 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) {
}
}
- // LMulI can handle all cases, but it requires that a register is allocated
- // for the second operand.
- LOperand* right = UseRegisterAtStart(most_const);
- LMulI* mul = new(zone()) LMulI(left, right);
- if (needs_environment) AssignEnvironment(mul);
- return DefineAsRegister(mul);
+ // LMulI/S can handle all cases, but it requires that a register is
+ // allocated for the second operand.
+ LInstruction* result;
+ if (instr->representation().IsSmi()) {
+ // TODO(jbramley/rmcilroy): Fix LMulS so we can UseRegisterAtStart here.
+ LOperand* right = UseRegister(most_const);
+ result = DefineAsRegister(new(zone()) LMulS(left, right));
+ } else {
+ LOperand* right = UseRegisterAtStart(most_const);
+ result = DefineAsRegister(new(zone()) LMulI(left, right));
+ }
+ if (needs_environment) AssignEnvironment(result);
+ return result;
} else if (instr->representation().IsDouble()) {
return DoArithmeticD(Token::MUL, instr);
} else {
« no previous file with comments | « no previous file | src/a64/lithium-codegen-a64.cc » ('j') | src/a64/lithium-codegen-a64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698