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

Unified Diff: src/full-codegen/s390/full-codegen-s390.cc

Issue 2691893002: s390: use new mul instruction (Closed)
Patch Set: fix comment Created 3 years, 10 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/crankshaft/s390/lithium-codegen-s390.cc ('k') | src/globals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/s390/full-codegen-s390.cc
diff --git a/src/full-codegen/s390/full-codegen-s390.cc b/src/full-codegen/s390/full-codegen-s390.cc
index 215a2c560136c841d95081ba6d35f158713c56a5..8d9b0cc42d1024c464678be44da4ab7d02c381fd 100644
--- a/src/full-codegen/s390/full-codegen-s390.cc
+++ b/src/full-codegen/s390/full-codegen-s390.cc
@@ -1582,34 +1582,42 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
}
case Token::MUL: {
Label mul_zero;
+ if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) {
+ __ SmiUntag(ip, right);
+ __ MulPWithCondition(scratch2, ip, left);
+ __ b(overflow, &stub_call);
+ __ beq(&mul_zero, Label::kNear);
+ __ LoadRR(right, scratch2);
+ } else {
#if V8_TARGET_ARCH_S390X
- // Remove tag from both operands.
- __ SmiUntag(ip, right);
- __ SmiUntag(scratch2, left);
- __ mr_z(scratch1, ip);
- // Check for overflowing the smi range - no overflow if higher 33 bits of
- // the result are identical.
- __ lr(ip, scratch2); // 32 bit load
- __ sra(ip, Operand(31));
- __ cr_z(ip, scratch1); // 32 bit compare
- __ bne(&stub_call);
+ // Remove tag from both operands.
+ __ SmiUntag(ip, right);
+ __ SmiUntag(scratch2, left);
+ __ mr_z(scratch1, ip);
+ // Check for overflowing the smi range - no overflow if higher 33 bits
+ // of the result are identical.
+ __ lr(ip, scratch2); // 32 bit load
+ __ sra(ip, Operand(31));
+ __ cr_z(ip, scratch1); // 32 bit compare
+ __ bne(&stub_call);
#else
- __ SmiUntag(ip, right);
- __ LoadRR(scratch2, left); // load into low order of reg pair
- __ mr_z(scratch1, ip); // R4:R5 = R5 * ip
- // Check for overflowing the smi range - no overflow if higher 33 bits of
- // the result are identical.
- __ TestIfInt32(scratch1, scratch2, ip);
- __ bne(&stub_call);
+ __ SmiUntag(ip, right);
+ __ LoadRR(scratch2, left); // load into low order of reg pair
+ __ mr_z(scratch1, ip); // R4:R5 = R5 * ip
+ // Check for overflowing the smi range - no overflow if higher 33 bits
+ // of the result are identical.
+ __ TestIfInt32(scratch1, scratch2, ip);
+ __ bne(&stub_call);
#endif
- // Go slow on zero result to handle -0.
- __ chi(scratch2, Operand::Zero());
- __ beq(&mul_zero, Label::kNear);
+ // Go slow on zero result to handle -0.
+ __ chi(scratch2, Operand::Zero());
+ __ beq(&mul_zero, Label::kNear);
#if V8_TARGET_ARCH_S390X
- __ SmiTag(right, scratch2);
+ __ SmiTag(right, scratch2);
#else
- __ LoadRR(right, scratch2);
+ __ LoadRR(right, scratch2);
#endif
+ }
__ b(&done);
// We need -0 if we were multiplying a negative number with 0 to get 0.
// We know one of them was zero.
« no previous file with comments | « src/crankshaft/s390/lithium-codegen-s390.cc ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698