| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 } else { | 1857 } else { |
| 1858 Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptBinaryDoubleOp); | 1858 Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptBinaryDoubleOp); |
| 1859 compiler->LoadDoubleOrSmiToXmm(result, | 1859 compiler->LoadDoubleOrSmiToXmm(result, |
| 1860 value, | 1860 value, |
| 1861 locs()->temp(0).reg(), | 1861 locs()->temp(0).reg(), |
| 1862 deopt); | 1862 deopt); |
| 1863 } | 1863 } |
| 1864 } | 1864 } |
| 1865 | 1865 |
| 1866 | 1866 |
| 1867 LocationSummary* UnboxedDoubleBinaryOpInstr::MakeLocationSummary() const { | 1867 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary() const { |
| 1868 const intptr_t kNumInputs = 2; | 1868 const intptr_t kNumInputs = 2; |
| 1869 const intptr_t kNumTemps = 0; | 1869 const intptr_t kNumTemps = 0; |
| 1870 LocationSummary* summary = | 1870 LocationSummary* summary = |
| 1871 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1871 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1872 summary->set_in(0, Location::RequiresXmmRegister()); | 1872 summary->set_in(0, Location::RequiresXmmRegister()); |
| 1873 summary->set_in(1, Location::RequiresXmmRegister()); | 1873 summary->set_in(1, Location::RequiresXmmRegister()); |
| 1874 summary->set_out(Location::SameAsFirstInput()); | 1874 summary->set_out(Location::SameAsFirstInput()); |
| 1875 return summary; | 1875 return summary; |
| 1876 } | 1876 } |
| 1877 | 1877 |
| 1878 | 1878 |
| 1879 void UnboxedDoubleBinaryOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1879 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1880 XmmRegister left = locs()->in(0).xmm_reg(); | 1880 XmmRegister left = locs()->in(0).xmm_reg(); |
| 1881 XmmRegister right = locs()->in(1).xmm_reg(); | 1881 XmmRegister right = locs()->in(1).xmm_reg(); |
| 1882 | 1882 |
| 1883 ASSERT(locs()->out().xmm_reg() == left); | 1883 ASSERT(locs()->out().xmm_reg() == left); |
| 1884 | 1884 |
| 1885 switch (op_kind()) { | 1885 switch (op_kind()) { |
| 1886 case Token::kADD: __ addsd(left, right); break; | 1886 case Token::kADD: __ addsd(left, right); break; |
| 1887 case Token::kSUB: __ subsd(left, right); break; | 1887 case Token::kSUB: __ subsd(left, right); break; |
| 1888 case Token::kMUL: __ mulsd(left, right); break; | 1888 case Token::kMUL: __ mulsd(left, right); break; |
| 1889 case Token::kDIV: __ divsd(left, right); break; | 1889 case Token::kDIV: __ divsd(left, right); break; |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2300 Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()), | 2300 Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()), |
| 2301 slow_path->entry_label(), | 2301 slow_path->entry_label(), |
| 2302 Assembler::kFarJump, | 2302 Assembler::kFarJump, |
| 2303 out_reg); | 2303 out_reg); |
| 2304 __ Bind(slow_path->exit_label()); | 2304 __ Bind(slow_path->exit_label()); |
| 2305 __ movsd(FieldAddress(out_reg, Mint::value_offset()), value); | 2305 __ movsd(FieldAddress(out_reg, Mint::value_offset()), value); |
| 2306 __ Bind(&done); | 2306 __ Bind(&done); |
| 2307 } | 2307 } |
| 2308 | 2308 |
| 2309 | 2309 |
| 2310 LocationSummary* UnboxedMintBinaryOpInstr::MakeLocationSummary() const { | 2310 LocationSummary* BinaryMintOpInstr::MakeLocationSummary() const { |
| 2311 const intptr_t kNumInputs = 2; | 2311 const intptr_t kNumInputs = 2; |
| 2312 switch (op_kind()) { | 2312 switch (op_kind()) { |
| 2313 case Token::kBIT_AND: | 2313 case Token::kBIT_AND: |
| 2314 case Token::kBIT_OR: | 2314 case Token::kBIT_OR: |
| 2315 case Token::kBIT_XOR: { | 2315 case Token::kBIT_XOR: { |
| 2316 const intptr_t kNumTemps = 0; | 2316 const intptr_t kNumTemps = 0; |
| 2317 LocationSummary* summary = | 2317 LocationSummary* summary = |
| 2318 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2318 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2319 summary->set_in(0, Location::RequiresXmmRegister()); | 2319 summary->set_in(0, Location::RequiresXmmRegister()); |
| 2320 summary->set_in(1, Location::RequiresXmmRegister()); | 2320 summary->set_in(1, Location::RequiresXmmRegister()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2333 summary->set_out(Location::SameAsFirstInput()); | 2333 summary->set_out(Location::SameAsFirstInput()); |
| 2334 return summary; | 2334 return summary; |
| 2335 } | 2335 } |
| 2336 default: | 2336 default: |
| 2337 UNREACHABLE(); | 2337 UNREACHABLE(); |
| 2338 return NULL; | 2338 return NULL; |
| 2339 } | 2339 } |
| 2340 } | 2340 } |
| 2341 | 2341 |
| 2342 | 2342 |
| 2343 void UnboxedMintBinaryOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2343 void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2344 XmmRegister left = locs()->in(0).xmm_reg(); | 2344 XmmRegister left = locs()->in(0).xmm_reg(); |
| 2345 XmmRegister right = locs()->in(1).xmm_reg(); | 2345 XmmRegister right = locs()->in(1).xmm_reg(); |
| 2346 | 2346 |
| 2347 ASSERT(locs()->out().xmm_reg() == left); | 2347 ASSERT(locs()->out().xmm_reg() == left); |
| 2348 | 2348 |
| 2349 switch (op_kind()) { | 2349 switch (op_kind()) { |
| 2350 case Token::kBIT_AND: __ andpd(left, right); break; | 2350 case Token::kBIT_AND: __ andpd(left, right); break; |
| 2351 case Token::kBIT_OR: __ orpd(left, right); break; | 2351 case Token::kBIT_OR: __ orpd(left, right); break; |
| 2352 case Token::kBIT_XOR: __ xorpd(left, right); break; | 2352 case Token::kBIT_XOR: __ xorpd(left, right); break; |
| 2353 case Token::kADD: | 2353 case Token::kADD: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2374 __ addl(ESP, Immediate(2 * kWordSize)); | 2374 __ addl(ESP, Immediate(2 * kWordSize)); |
| 2375 __ jmp(deopt); | 2375 __ jmp(deopt); |
| 2376 __ Bind(&done); | 2376 __ Bind(&done); |
| 2377 break; | 2377 break; |
| 2378 } | 2378 } |
| 2379 default: UNREACHABLE(); | 2379 default: UNREACHABLE(); |
| 2380 } | 2380 } |
| 2381 } | 2381 } |
| 2382 | 2382 |
| 2383 | 2383 |
| 2384 LocationSummary* UnboxedMintUnaryOpInstr::MakeLocationSummary() const { | 2384 LocationSummary* UnaryMintOpInstr::MakeLocationSummary() const { |
| 2385 const intptr_t kNumInputs = 1; | 2385 const intptr_t kNumInputs = 1; |
| 2386 const intptr_t kNumTemps = 0; | 2386 const intptr_t kNumTemps = 0; |
| 2387 LocationSummary* summary = | 2387 LocationSummary* summary = |
| 2388 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2388 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2389 summary->set_in(0, Location::RequiresXmmRegister()); | 2389 summary->set_in(0, Location::RequiresXmmRegister()); |
| 2390 summary->set_out(Location::SameAsFirstInput()); | 2390 summary->set_out(Location::SameAsFirstInput()); |
| 2391 return summary; | 2391 return summary; |
| 2392 } | 2392 } |
| 2393 | 2393 |
| 2394 | 2394 |
| 2395 void UnboxedMintUnaryOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2395 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2396 ASSERT(op_kind() == Token::kBIT_NOT); | 2396 ASSERT(op_kind() == Token::kBIT_NOT); |
| 2397 XmmRegister value = locs()->in(0).xmm_reg(); | 2397 XmmRegister value = locs()->in(0).xmm_reg(); |
| 2398 ASSERT(value == locs()->out().xmm_reg()); | 2398 ASSERT(value == locs()->out().xmm_reg()); |
| 2399 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. | 2399 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. |
| 2400 __ pxor(value, XMM0); | 2400 __ pxor(value, XMM0); |
| 2401 } | 2401 } |
| 2402 | 2402 |
| 2403 | 2403 |
| 2404 } // namespace dart | 2404 } // namespace dart |
| 2405 | 2405 |
| 2406 #undef __ | 2406 #undef __ |
| 2407 | 2407 |
| 2408 #endif // defined TARGET_ARCH_X64 | 2408 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |