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

Unified Diff: src/ia32/lithium-codegen-ia32.cc

Issue 13447003: IA32: Small assembler tweak for divsd->mulsd sequence (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 8 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/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
===================================================================
--- src/ia32/lithium-codegen-ia32.cc (revision 14205)
+++ src/ia32/lithium-codegen-ia32.cc (working copy)
@@ -2018,6 +2018,35 @@
break;
case Token::DIV:
__ divsd(left, right);
+ // Don't delete this mov. It may improve performance on some CPUs,
+ // when there is a mulsd depending on the result
+ {
+ bool has_dependent_mul = false;
+ HValue* value = instr->hydrogen_value();
+ for (HUseIterator it(value->uses()); !it.Done(); it.Advance()) {
+ HValue* use = it.value();
+ if (!use->IsMul()) continue;
+ LArithmeticD* lmul = NULL;
+ for (int i = use->block()->first_instruction_index();
+ i <= use->block()->last_instruction_index(); i++) {
+ LInstruction* luse = chunk_->instructions()->at(i);
+ if (luse->hydrogen_value() == use) {
+ ASSERT(luse->IsArithmeticD());
+ lmul = reinterpret_cast<LArithmeticD*>(luse);
+ ASSERT(lmul->op() == Token::MUL);
+ break;
+ }
+ }
+ if (lmul->left()->Equals(instr->left()) ||
+ lmul->right()->Equals(instr->left())) {
+ has_dependent_mul = true;
+ break;
+ }
+ }
+ if (has_dependent_mul) {
+ __ movaps(left, left);
+ }
+ }
break;
case Token::MOD: {
// Pass two doubles as arguments on the stack.
« no previous file with comments | « no previous file | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698