Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2761 slow_path->entry_label(), | 2761 slow_path->entry_label(), |
| 2762 Assembler::kFarJump, | 2762 Assembler::kFarJump, |
| 2763 out_reg); | 2763 out_reg); |
| 2764 __ Bind(slow_path->exit_label()); | 2764 __ Bind(slow_path->exit_label()); |
| 2765 __ movups(FieldAddress(out_reg, Float32x4::value_offset()), value); | 2765 __ movups(FieldAddress(out_reg, Float32x4::value_offset()), value); |
| 2766 } | 2766 } |
| 2767 | 2767 |
| 2768 | 2768 |
| 2769 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { | 2769 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { |
| 2770 const intptr_t kNumInputs = 1; | 2770 const intptr_t kNumInputs = 1; |
| 2771 const intptr_t kNumTemps = 0; | 2771 const intptr_t value_cid = value()->Type()->ToCid(); |
| 2772 const intptr_t kNumTemps = value_cid != kFloat32x4Cid ? 1 : 0; | |
| 2772 LocationSummary* summary = | 2773 LocationSummary* summary = |
| 2773 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2774 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2774 summary->set_in(0, Location::RequiresRegister()); | 2775 summary->set_in(0, Location::RequiresRegister()); |
| 2776 if (kNumTemps > 0) { | |
| 2777 ASSERT(kNumTemps == 1); | |
| 2778 summary->set_temp(0, Location::RequiresRegister()); | |
| 2779 } | |
|
Vyacheslav Egorov (Google)
2013/04/15 13:49:21
I think this temp should go away now.
Cutch
2013/04/15 14:07:06
Done.
| |
| 2775 summary->set_out(Location::RequiresFpuRegister()); | 2780 summary->set_out(Location::RequiresFpuRegister()); |
| 2776 return summary; | 2781 return summary; |
| 2777 } | 2782 } |
| 2778 | 2783 |
| 2779 | 2784 |
| 2780 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2785 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2781 const intptr_t value_cid = value()->Type()->ToCid(); | 2786 const intptr_t value_cid = value()->Type()->ToCid(); |
| 2782 const Register value = locs()->in(0).reg(); | 2787 const Register value = locs()->in(0).reg(); |
| 2783 const XmmRegister result = locs()->out().fpu_reg(); | 2788 const XmmRegister result = locs()->out().fpu_reg(); |
| 2784 | 2789 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 2808 switch (op_kind()) { | 2813 switch (op_kind()) { |
| 2809 case Token::kADD: __ addsd(left, right); break; | 2814 case Token::kADD: __ addsd(left, right); break; |
| 2810 case Token::kSUB: __ subsd(left, right); break; | 2815 case Token::kSUB: __ subsd(left, right); break; |
| 2811 case Token::kMUL: __ mulsd(left, right); break; | 2816 case Token::kMUL: __ mulsd(left, right); break; |
| 2812 case Token::kDIV: __ divsd(left, right); break; | 2817 case Token::kDIV: __ divsd(left, right); break; |
| 2813 default: UNREACHABLE(); | 2818 default: UNREACHABLE(); |
| 2814 } | 2819 } |
| 2815 } | 2820 } |
| 2816 | 2821 |
| 2817 | 2822 |
| 2823 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const { | |
| 2824 const intptr_t kNumInputs = 2; | |
| 2825 const intptr_t kNumTemps = 0; | |
| 2826 LocationSummary* summary = | |
| 2827 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | |
| 2828 summary->set_in(0, Location::RequiresFpuRegister()); | |
| 2829 summary->set_in(1, Location::RequiresFpuRegister()); | |
| 2830 summary->set_out(Location::SameAsFirstInput()); | |
| 2831 return summary; | |
| 2832 } | |
| 2833 | |
| 2834 | |
| 2835 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 2836 XmmRegister left = locs()->in(0).fpu_reg(); | |
| 2837 XmmRegister right = locs()->in(1).fpu_reg(); | |
| 2838 | |
| 2839 ASSERT(locs()->out().fpu_reg() == left); | |
| 2840 | |
| 2841 switch (op_kind()) { | |
| 2842 case Token::kADD: __ addps(left, right); break; | |
| 2843 case Token::kSUB: __ subps(left, right); break; | |
| 2844 case Token::kMUL: __ mulps(left, right); break; | |
| 2845 case Token::kDIV: __ divps(left, right); break; | |
| 2846 default: UNREACHABLE(); | |
| 2847 } | |
| 2848 } | |
| 2849 | |
| 2818 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { | 2850 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { |
| 2819 const intptr_t kNumInputs = 1; | 2851 const intptr_t kNumInputs = 1; |
| 2820 const intptr_t kNumTemps = 0; | 2852 const intptr_t kNumTemps = 0; |
| 2821 LocationSummary* summary = | 2853 LocationSummary* summary = |
| 2822 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2854 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2823 summary->set_in(0, Location::RequiresFpuRegister()); | 2855 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2824 summary->set_out(Location::RequiresFpuRegister()); | 2856 summary->set_out(Location::RequiresFpuRegister()); |
| 2825 return summary; | 2857 return summary; |
| 2826 } | 2858 } |
| 2827 | 2859 |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3944 PcDescriptors::kOther, | 3976 PcDescriptors::kOther, |
| 3945 locs()); | 3977 locs()); |
| 3946 __ Drop(2); // Discard type arguments and receiver. | 3978 __ Drop(2); // Discard type arguments and receiver. |
| 3947 } | 3979 } |
| 3948 | 3980 |
| 3949 } // namespace dart | 3981 } // namespace dart |
| 3950 | 3982 |
| 3951 #undef __ | 3983 #undef __ |
| 3952 | 3984 |
| 3953 #endif // defined TARGET_ARCH_IA32 | 3985 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |