Chromium Code Reviews| Index: runtime/vm/intermediate_language_ia32.cc |
| diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc |
| index e060657a517a8cf258d4b32f603fed2e9bb93bc3..86f19405fa1bacec5b445b155aa40f8272600e0e 100644 |
| --- a/runtime/vm/intermediate_language_ia32.cc |
| +++ b/runtime/vm/intermediate_language_ia32.cc |
| @@ -834,6 +834,8 @@ CompileType LoadIndexedInstr::ComputeType() const { |
| return CompileType::FromCid(kFloat32x4Cid); |
| case kTypedDataInt32x4ArrayCid: |
| return CompileType::FromCid(kInt32x4Cid); |
| + case kTypedDataFloat64x2ArrayCid: |
| + return CompileType::FromCid(kFloat64x2Cid); |
| case kTypedDataInt8ArrayCid: |
| case kTypedDataUint8ArrayCid: |
| @@ -887,6 +889,8 @@ Representation LoadIndexedInstr::representation() const { |
| return kUnboxedFloat32x4; |
| case kTypedDataInt32x4ArrayCid: |
| return kUnboxedInt32x4; |
| + case kTypedDataFloat64x2ArrayCid: |
| + return kUnboxedFloat64x2; |
| default: |
| UNIMPLEMENTED(); |
| return kTagged; |
| @@ -912,7 +916,8 @@ LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const { |
| } |
| if ((representation() == kUnboxedDouble) || |
| (representation() == kUnboxedFloat32x4) || |
| - (representation() == kUnboxedInt32x4)) { |
| + (representation() == kUnboxedInt32x4) || |
| + (representation() == kUnboxedFloat64x2)) { |
| locs->set_out(Location::RequiresFpuRegister()); |
| } else { |
| locs->set_out(Location::RequiresRegister()); |
| @@ -945,7 +950,13 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| if ((representation() == kUnboxedDouble) || |
| (representation() == kUnboxedMint) || |
| (representation() == kUnboxedFloat32x4) || |
| - (representation() == kUnboxedInt32x4)) { |
| + (representation() == kUnboxedInt32x4) || |
| + (representation() == kUnboxedFloat64x2)) { |
| + if (class_id_ == kTypedDataFloat64x2ArrayCid) { |
|
Florian Schneider
2014/02/20 15:54:44
Left-over debug printing?
Cutch
2014/02/20 19:33:11
Done.
|
| + printf("class id match\n"); |
| + printf("representation = %d\n", representation()); |
| + printf("%d\n", locs()->out().kind()); |
| + } |
| XmmRegister result = locs()->out().fpu_reg(); |
| if ((index_scale() == 1) && index.IsRegister()) { |
| __ SmiUntag(index.reg()); |
| @@ -969,6 +980,7 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| break; |
| case kTypedDataInt32x4ArrayCid: |
| case kTypedDataFloat32x4ArrayCid: |
| + case kTypedDataFloat64x2ArrayCid: |
| __ movups(result, element_address); |
| break; |
| } |
| @@ -1056,6 +1068,8 @@ Representation StoreIndexedInstr::RequiredInputRepresentation( |
| return kUnboxedFloat32x4; |
| case kTypedDataInt32x4ArrayCid: |
| return kUnboxedInt32x4; |
| + case kTypedDataFloat64x2ArrayCid: |
| + return kUnboxedFloat64x2; |
| default: |
| UNIMPLEMENTED(); |
| return kTagged; |
| @@ -1118,6 +1132,7 @@ LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const { |
| break; |
| case kTypedDataInt32x4ArrayCid: |
| case kTypedDataFloat32x4ArrayCid: |
| + case kTypedDataFloat64x2ArrayCid: |
| locs->set_in(2, Location::RequiresFpuRegister()); |
| break; |
| default: |
| @@ -1239,6 +1254,7 @@ void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| break; |
| case kTypedDataInt32x4ArrayCid: |
| case kTypedDataFloat32x4ArrayCid: |
| + case kTypedDataFloat64x2ArrayCid: |
| __ movups(element_address, locs()->in(2).fpu_reg()); |
| break; |
| default: |
| @@ -1995,6 +2011,37 @@ class BoxFloat32x4SlowPath : public SlowPathCode { |
| }; |
| +class BoxFloat64x2SlowPath : public SlowPathCode { |
| + public: |
| + explicit BoxFloat64x2SlowPath(Instruction* instruction) |
| + : instruction_(instruction) { } |
| + |
| + virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| + __ Comment("BoxFloat64x2SlowPath"); |
| + __ Bind(entry_label()); |
| + const Class& float64x2_class = compiler->float64x2_class(); |
| + const Code& stub = |
| + Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); |
| + const ExternalLabel label(float64x2_class.ToCString(), stub.EntryPoint()); |
| + |
| + LocationSummary* locs = instruction_->locs(); |
| + locs->live_registers()->Remove(locs->out()); |
| + |
| + compiler->SaveLiveRegisters(locs); |
| + compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| + &label, |
| + PcDescriptors::kOther, |
| + locs); |
| + __ MoveRegister(locs->out().reg(), EAX); |
| + compiler->RestoreLiveRegisters(locs); |
| + |
| + __ jmp(exit_label()); |
| + } |
| + |
| + private: |
| + Instruction* instruction_; |
| +}; |
| + |
| LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const { |
| const intptr_t kNumInputs = 1; |
| @@ -3042,6 +3089,69 @@ void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| } |
| +LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(bool opt) const { |
| + const intptr_t kNumInputs = 1; |
| + const intptr_t kNumTemps = 0; |
| + LocationSummary* summary = |
| + new LocationSummary(kNumInputs, |
| + kNumTemps, |
| + LocationSummary::kCallOnSlowPath); |
| + summary->set_in(0, Location::RequiresFpuRegister()); |
| + summary->set_out(Location::RequiresRegister()); |
| + return summary; |
| +} |
| + |
| + |
| +void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| + BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this); |
| + compiler->AddSlowPathCode(slow_path); |
| + |
| + Register out_reg = locs()->out().reg(); |
| + XmmRegister value = locs()->in(0).fpu_reg(); |
| + |
| + __ TryAllocate(compiler->float64x2_class(), |
| + slow_path->entry_label(), |
| + Assembler::kFarJump, |
| + out_reg, |
| + kNoRegister); |
| + __ Bind(slow_path->exit_label()); |
| + __ movups(FieldAddress(out_reg, Float64x2::value_offset()), value); |
| +} |
| + |
| + |
| +LocationSummary* UnboxFloat64x2Instr::MakeLocationSummary(bool opt) const { |
| + const intptr_t value_cid = value()->Type()->ToCid(); |
| + const intptr_t kNumInputs = 1; |
| + const intptr_t kNumTemps = value_cid == kFloat64x2Cid ? 0 : 1; |
| + LocationSummary* summary = |
| + new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| + summary->set_in(0, Location::RequiresRegister()); |
| + if (kNumTemps > 0) { |
| + ASSERT(kNumTemps == 1); |
| + summary->set_temp(0, Location::RequiresRegister()); |
| + } |
| + summary->set_out(Location::RequiresFpuRegister()); |
| + return summary; |
| +} |
| + |
| + |
| +void UnboxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| + const intptr_t value_cid = value()->Type()->ToCid(); |
| + const Register value = locs()->in(0).reg(); |
| + const XmmRegister result = locs()->out().fpu_reg(); |
| + |
| + if (value_cid != kFloat64x2Cid) { |
| + const Register temp = locs()->temp(0).reg(); |
| + Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptCheckClass); |
| + __ testl(value, Immediate(kSmiTagMask)); |
| + __ j(ZERO, deopt); |
| + __ CompareClassId(value, kFloat64x2Cid, temp); |
| + __ j(NOT_EQUAL, deopt); |
| + } |
| + __ movups(result, FieldAddress(value, Float64x2::value_offset())); |
| +} |
| + |
| + |
| LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { |
| const intptr_t kNumInputs = 1; |
| const intptr_t kNumTemps = 0; |