| Index: runtime/vm/intermediate_language_mips.cc
|
| diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
|
| index 5c4a304f1dbffab63806526b5870b99e7629f5ee..6940312cf42fe764b683b8ff209383b004643721 100644
|
| --- a/runtime/vm/intermediate_language_mips.cc
|
| +++ b/runtime/vm/intermediate_language_mips.cc
|
| @@ -1084,8 +1084,7 @@ CompileType LoadIndexedInstr::ComputeType() const {
|
|
|
| case kTypedDataInt32ArrayCid:
|
| case kTypedDataUint32ArrayCid:
|
| - return Typed32BitIsSmi() ? CompileType::FromCid(kSmiCid)
|
| - : CompileType::FromCid(kMintCid);
|
| + return CompileType::Int();
|
|
|
| default:
|
| UNIMPLEMENTED();
|
| @@ -1109,8 +1108,9 @@ Representation LoadIndexedInstr::representation() const {
|
| case kTwoByteStringCid:
|
| return kTagged;
|
| case kTypedDataInt32ArrayCid:
|
| + return kUnboxedInt32;
|
| case kTypedDataUint32ArrayCid:
|
| - return Typed32BitIsSmi() ? kTagged : kUnboxedMint;
|
| + return kUnboxedUint32;
|
| case kTypedDataFloat32ArrayCid:
|
| case kTypedDataFloat64ArrayCid:
|
| return kUnboxedDouble;
|
| @@ -1180,17 +1180,10 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| // Warning: element_address may use register TMP as base.
|
|
|
| if ((representation() == kUnboxedDouble) ||
|
| - (representation() == kUnboxedMint) ||
|
| (representation() == kUnboxedFloat32x4) ||
|
| (representation() == kUnboxedInt32x4)) {
|
| DRegister result = locs()->out(0).fpu_reg();
|
| switch (class_id()) {
|
| - case kTypedDataInt32ArrayCid:
|
| - UNIMPLEMENTED();
|
| - break;
|
| - case kTypedDataUint32ArrayCid:
|
| - UNIMPLEMENTED();
|
| - break;
|
| case kTypedDataFloat32ArrayCid:
|
| // Load single precision float.
|
| __ lwc1(EvenFRegisterOf(result), element_address);
|
| @@ -1207,6 +1200,26 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| return;
|
| }
|
|
|
| + if ((representation() == kUnboxedUint32) ||
|
| + (representation() == kUnboxedInt32)) {
|
| + const Register result = locs()->out(0).reg();
|
| + switch (class_id()) {
|
| + case kTypedDataInt32ArrayCid:
|
| + ASSERT(representation() == kUnboxedUint32);
|
| + __ lw(result, element_address);
|
| + break;
|
| + case kTypedDataUint32ArrayCid:
|
| + ASSERT(representation() == kUnboxedInt32);
|
| + __ lw(result, element_address);
|
| + break;
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| + return;
|
| + }
|
| +
|
| + ASSERT(representation() == kTagged);
|
| +
|
| const Register result = locs()->out(0).reg();
|
| switch (class_id()) {
|
| case kTypedDataInt8ArrayCid:
|
| @@ -1232,26 +1245,6 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| __ lhu(result, element_address);
|
| __ SmiTag(result);
|
| break;
|
| - case kTypedDataInt32ArrayCid: {
|
| - Label* deopt = compiler->AddDeoptStub(deopt_id(),
|
| - ICData::kDeoptInt32Load);
|
| - __ lw(result, element_address);
|
| - // Verify that the signed value in 'result' can fit inside a Smi.
|
| - __ BranchSignedLess(result, Immediate(0xC0000000), deopt);
|
| - __ SmiTag(result);
|
| - }
|
| - break;
|
| - case kTypedDataUint32ArrayCid: {
|
| - Label* deopt = compiler->AddDeoptStub(deopt_id(),
|
| - ICData::kDeoptUint32Load);
|
| - __ lw(result, element_address);
|
| - // Verify that the unsigned value in 'result' can fit inside a Smi.
|
| - __ LoadImmediate(TMP, 0xC0000000);
|
| - __ and_(CMPRES1, result, TMP);
|
| - __ bne(CMPRES1, ZR, deopt);
|
| - __ SmiTag(result);
|
| - }
|
| - break;
|
| default:
|
| ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid));
|
| __ lw(result, element_address);
|
| @@ -3824,7 +3817,24 @@ void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -DEFINE_UNIMPLEMENTED_INSTRUCTION(Int32ToDoubleInstr)
|
| +LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Isolate* isolate,
|
| + bool opt) const {
|
| + const intptr_t kNumInputs = 1;
|
| + const intptr_t kNumTemps = 0;
|
| + LocationSummary* result = new(isolate) LocationSummary(
|
| + isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
|
| + result->set_in(0, Location::RequiresRegister());
|
| + result->set_out(0, Location::RequiresFpuRegister());
|
| + return result;
|
| +}
|
| +
|
| +
|
| +void Int32ToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| + Register value = locs()->in(0).reg();
|
| + FpuRegister result = locs()->out(0).fpu_reg();
|
| + __ mtc1(value, STMP1);
|
| + __ cvtdw(result, STMP1);
|
| +}
|
|
|
|
|
| LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate,
|
|
|