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

Side by Side Diff: src/a64/lithium-codegen-a64.cc

Issue 190603003: A64 tweaks for division-like operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/a64/macro-assembler-a64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 2623
2624 if (divisor == 0) { 2624 if (divisor == 0) {
2625 Deoptimize(instr->environment()); 2625 Deoptimize(instr->environment());
2626 return; 2626 return;
2627 } 2627 }
2628 2628
2629 // Check for (0 / -x) that will produce negative zero. 2629 // Check for (0 / -x) that will produce negative zero.
2630 HDiv* hdiv = instr->hydrogen(); 2630 HDiv* hdiv = instr->hydrogen();
2631 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && 2631 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) &&
2632 hdiv->left()->RangeCanInclude(0) && divisor < 0) { 2632 hdiv->left()->RangeCanInclude(0) && divisor < 0) {
2633 __ Cmp(dividend, 0); 2633 DeoptimizeIfZero(dividend, instr->environment());
2634 DeoptimizeIf(eq, instr->environment());
2635 } 2634 }
2636 2635
2637 __ FlooringDiv(result, dividend, Abs(divisor)); 2636 __ FlooringDiv(result, dividend, Abs(divisor));
2638 if (divisor < 0) __ Neg(result, result); 2637 if (divisor < 0) __ Neg(result, result);
2639 2638
2640 if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) { 2639 if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) {
2641 Register temp = ToRegister32(instr->temp()); 2640 Register temp = ToRegister32(instr->temp());
2642 ASSERT(!AreAliased(dividend, result, temp)); 2641 ASSERT(!AreAliased(dividend, result, temp));
2643 __ Sxtw(dividend.X(), dividend); 2642 __ Sxtw(dividend.X(), dividend);
2644 __ Mov(temp, divisor); 2643 __ Mov(temp, divisor);
(...skipping 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after
5802 __ Bind(&out_of_object); 5801 __ Bind(&out_of_object);
5803 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5802 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5804 // Index is equal to negated out of object property index plus 1. 5803 // Index is equal to negated out of object property index plus 1.
5805 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5804 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5806 __ Ldr(result, FieldMemOperand(result, 5805 __ Ldr(result, FieldMemOperand(result,
5807 FixedArray::kHeaderSize - kPointerSize)); 5806 FixedArray::kHeaderSize - kPointerSize));
5808 __ Bind(&done); 5807 __ Bind(&done);
5809 } 5808 }
5810 5809
5811 } } // namespace v8::internal 5810 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/a64/macro-assembler-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698