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

Unified Diff: src/crankshaft/arm64/lithium-codegen-arm64.cc

Issue 2622643005: ARM64: Add NEON support (Closed)
Patch Set: Created 3 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
Index: src/crankshaft/arm64/lithium-codegen-arm64.cc
diff --git a/src/crankshaft/arm64/lithium-codegen-arm64.cc b/src/crankshaft/arm64/lithium-codegen-arm64.cc
index 141ac3f6108217e805e45cc83fccb9ed58654af7..ed91a5a5fa00f243407a57ff35b939ff3f55e660 100644
--- a/src/crankshaft/arm64/lithium-codegen-arm64.cc
+++ b/src/crankshaft/arm64/lithium-codegen-arm64.cc
@@ -177,9 +177,9 @@ class TestAndBranch : public BranchGenerator {
// Test the input and branch if it is non-zero and not a NaN.
class BranchIfNonZeroNumber : public BranchGenerator {
public:
- BranchIfNonZeroNumber(LCodeGen* codegen, const FPRegister& value,
- const FPRegister& scratch)
- : BranchGenerator(codegen), value_(value), scratch_(scratch) { }
+ BranchIfNonZeroNumber(LCodeGen* codegen, const VRegister& value,
+ const VRegister& scratch)
+ : BranchGenerator(codegen), value_(value), scratch_(scratch) {}
virtual void Emit(Label* label) const {
__ Fabs(scratch_, value_);
@@ -196,8 +196,8 @@ class BranchIfNonZeroNumber : public BranchGenerator {
}
private:
- const FPRegister& value_;
- const FPRegister& scratch_;
+ const VRegister& value_;
+ const VRegister& scratch_;
};
@@ -545,7 +545,7 @@ void LCodeGen::SaveCallerDoubles() {
while (!iterator.Done()) {
// TODO(all): Is this supposed to save just the callee-saved doubles? It
// looks like it's saving all of them.
- FPRegister value = FPRegister::from_code(iterator.Current());
+ VRegister value = VRegister::from_code(iterator.Current());
__ Poke(value, count * kDoubleSize);
iterator.Advance();
count++;
@@ -563,7 +563,7 @@ void LCodeGen::RestoreCallerDoubles() {
while (!iterator.Done()) {
// TODO(all): Is this supposed to restore just the callee-saved doubles? It
// looks like it's restoring all of them.
- FPRegister value = FPRegister::from_code(iterator.Current());
+ VRegister value = VRegister::from_code(iterator.Current());
__ Peek(value, count * kDoubleSize);
iterator.Advance();
count++;
@@ -1134,7 +1134,7 @@ MemOperand LCodeGen::ToMemOperand(LOperand* op, StackMode stack_mode) const {
(pushed_arguments_ + GetTotalFrameSlotCount()) * kPointerSize -
StandardFrameConstants::kFixedFrameSizeAboveFp;
int jssp_offset = fp_offset + jssp_offset_to_fp;
- if (masm()->IsImmLSScaled(jssp_offset, LSDoubleWord)) {
+ if (masm()->IsImmLSScaled(jssp_offset, 3)) {
bbudge 2017/01/31 01:41:31 nit: replace magic number with named constant
martyn.capewell 2017/02/03 11:01:31 Done.
return MemOperand(masm()->StackPointer(), jssp_offset);
}
}
@@ -1273,11 +1273,10 @@ void LCodeGen::EmitTestAndBranch(InstrType instr,
EmitBranchGeneric(instr, branch);
}
-
-template<class InstrType>
+template <class InstrType>
void LCodeGen::EmitBranchIfNonZeroNumber(InstrType instr,
- const FPRegister& value,
- const FPRegister& scratch) {
+ const VRegister& value,
+ const VRegister& scratch) {
BranchIfNonZeroNumber branch(this, value, scratch);
EmitBranchGeneric(instr, branch);
}
@@ -2274,7 +2273,7 @@ void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
void LCodeGen::DoCmpHoleAndBranchD(LCmpHoleAndBranchD* instr) {
DCHECK(instr->hydrogen()->representation().IsDouble());
- FPRegister object = ToDoubleRegister(instr->object());
+ VRegister object = ToDoubleRegister(instr->object());
Register temp = ToRegister(instr->temp());
// If we don't have a NaN, we don't have the hole, so branch now to avoid the
@@ -3270,7 +3269,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
if (instr->hydrogen()->representation().IsDouble()) {
DCHECK(access.IsInobject());
- FPRegister result = ToDoubleRegister(instr->result());
+ VRegister result = ToDoubleRegister(instr->result());
__ Ldr(result, FieldMemOperand(object, offset));
return;
}
@@ -3430,7 +3429,7 @@ void LCodeGen::DoMathAbsTagged(LMathAbsTagged* instr) {
// The result is the magnitude (abs) of the smallest value a smi can
// represent, encoded as a double.
- __ Mov(result_bits, double_to_rawbits(0x80000000));
+ __ Mov(result_bits, bit_cast<uint64_t>(static_cast<double>(INT64_MIN)));
__ B(deferred->allocation_entry());
__ Bind(deferred->exit());
@@ -4972,7 +4971,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
DCHECK(access.IsInobject());
DCHECK(!instr->hydrogen()->has_transition());
DCHECK(!instr->hydrogen()->NeedsWriteBarrier());
- FPRegister value = ToDoubleRegister(instr->value());
+ VRegister value = ToDoubleRegister(instr->value());
__ Str(value, FieldMemOperand(object, offset));
return;
}
@@ -5010,7 +5009,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
if (FLAG_unbox_double_fields && representation.IsDouble()) {
DCHECK(access.IsInobject());
- FPRegister value = ToDoubleRegister(instr->value());
+ VRegister value = ToDoubleRegister(instr->value());
__ Str(value, FieldMemOperand(object, offset));
} else if (representation.IsSmi() &&
instr->hydrogen()->value()->representation().IsInteger32()) {

Powered by Google App Engine
This is Rietveld 408576698