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

Unified Diff: src/a64/lithium-codegen-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: Rename LMulConstI to LMulConstIS 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.cc ('k') | test/mjsunit/smi-mul-const.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/lithium-codegen-a64.cc
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
index 9386db39514b692332400ac1093d20cf51332c16..11dbbb9c5551f5a2bbfcd694a76bed506233d3bc 100644
--- a/src/a64/lithium-codegen-a64.cc
+++ b/src/a64/lithium-codegen-a64.cc
@@ -4118,11 +4118,13 @@ void LCodeGen::DoModI(LModI* instr) {
}
-void LCodeGen::DoMulConstI(LMulConstI* instr) {
- // TODO(jbramley): Support smi operations (or make a separate DoMulConstS).
-
- Register result = ToRegister32(instr->result());
- Register left = ToRegister32(instr->left());
+void LCodeGen::DoMulConstIS(LMulConstIS* instr) {
+ ASSERT(instr->hydrogen()->representation().IsSmiOrInteger32());
+ bool is_smi = instr->hydrogen()->representation().IsSmi();
+ Register result =
+ is_smi ? ToRegister(instr->result()) : ToRegister32(instr->result());
+ Register left =
+ is_smi ? ToRegister(instr->left()) : ToRegister32(instr->left()) ;
int32_t right = ToInteger32(instr->right());
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | test/mjsunit/smi-mul-const.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698