Chromium Code Reviews| Index: runtime/vm/intermediate_language_x64.cc |
| diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc |
| index 3a7a6e1e82a2df1241185aa42824ca76f92afd12..4ec2b3702ca1d4551db8cde91143b4c70f14c703 100644 |
| --- a/runtime/vm/intermediate_language_x64.cc |
| +++ b/runtime/vm/intermediate_language_x64.cc |
| @@ -2798,7 +2798,13 @@ void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| const Register value = locs()->in(0).reg(); |
| const XmmRegister result = locs()->out().fpu_reg(); |
| - ASSERT(value_cid == kFloat32x4Cid); |
| + if (value_cid != kFloat32x4Cid) { |
|
Vyacheslav Egorov (Google)
2013/04/15 11:09:35
Ditto
Cutch
2013/04/15 13:34:56
Done.
|
| + Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptCheckClass); |
| + __ testq(value, Immediate(kSmiTagMask)); |
| + __ j(ZERO, deopt); |
| + __ CompareClassId(value, kFloat32x4Cid); |
| + __ j(NOT_EQUAL, deopt); |
| + } |
| __ movups(result, FieldAddress(value, Float32x4::value_offset())); |
| } |
| @@ -2831,6 +2837,34 @@ void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| } |
| +LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const { |
| + const intptr_t kNumInputs = 2; |
| + const intptr_t kNumTemps = 0; |
| + LocationSummary* summary = |
| + new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| + summary->set_in(0, Location::RequiresFpuRegister()); |
| + summary->set_in(1, Location::RequiresFpuRegister()); |
| + summary->set_out(Location::SameAsFirstInput()); |
| + return summary; |
| +} |
| + |
| + |
| +void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| + XmmRegister left = locs()->in(0).fpu_reg(); |
| + XmmRegister right = locs()->in(1).fpu_reg(); |
| + |
| + ASSERT(locs()->out().fpu_reg() == left); |
| + |
| + switch (op_kind()) { |
| + case Token::kADD: __ addps(left, right); break; |
| + case Token::kSUB: __ subps(left, right); break; |
| + case Token::kMUL: __ mulps(left, right); break; |
| + case Token::kDIV: __ divps(left, right); break; |
| + default: UNREACHABLE(); |
| + } |
| +} |
| + |
| + |
| LocationSummary* MathSqrtInstr::MakeLocationSummary() const { |
| const intptr_t kNumInputs = 1; |
| const intptr_t kNumTemps = 0; |