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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 822 case kImmutableArrayCid: | 822 case kImmutableArrayCid: |
| 823 return CompileType::Dynamic(); | 823 return CompileType::Dynamic(); |
| 824 | 824 |
| 825 case kTypedDataFloat32ArrayCid: | 825 case kTypedDataFloat32ArrayCid: |
| 826 case kTypedDataFloat64ArrayCid: | 826 case kTypedDataFloat64ArrayCid: |
| 827 return CompileType::FromCid(kDoubleCid); | 827 return CompileType::FromCid(kDoubleCid); |
| 828 case kTypedDataFloat32x4ArrayCid: | 828 case kTypedDataFloat32x4ArrayCid: |
| 829 return CompileType::FromCid(kFloat32x4Cid); | 829 return CompileType::FromCid(kFloat32x4Cid); |
| 830 case kTypedDataInt32x4ArrayCid: | 830 case kTypedDataInt32x4ArrayCid: |
| 831 return CompileType::FromCid(kInt32x4Cid); | 831 return CompileType::FromCid(kInt32x4Cid); |
| 832 case kTypedDataFloat64x2ArrayCid: | |
| 833 return CompileType::FromCid(kFloat64x2Cid); | |
| 832 | 834 |
| 833 case kTypedDataInt8ArrayCid: | 835 case kTypedDataInt8ArrayCid: |
| 834 case kTypedDataUint8ArrayCid: | 836 case kTypedDataUint8ArrayCid: |
| 835 case kTypedDataUint8ClampedArrayCid: | 837 case kTypedDataUint8ClampedArrayCid: |
| 836 case kExternalTypedDataUint8ArrayCid: | 838 case kExternalTypedDataUint8ArrayCid: |
| 837 case kExternalTypedDataUint8ClampedArrayCid: | 839 case kExternalTypedDataUint8ClampedArrayCid: |
| 838 case kTypedDataInt16ArrayCid: | 840 case kTypedDataInt16ArrayCid: |
| 839 case kTypedDataUint16ArrayCid: | 841 case kTypedDataUint16ArrayCid: |
| 840 case kOneByteStringCid: | 842 case kOneByteStringCid: |
| 841 case kTwoByteStringCid: | 843 case kTwoByteStringCid: |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 875 // Instruction can deoptimize if we optimistically assumed that the result | 877 // Instruction can deoptimize if we optimistically assumed that the result |
| 876 // fits into Smi. | 878 // fits into Smi. |
| 877 return CanDeoptimize() ? kTagged : kUnboxedMint; | 879 return CanDeoptimize() ? kTagged : kUnboxedMint; |
| 878 case kTypedDataFloat32ArrayCid: | 880 case kTypedDataFloat32ArrayCid: |
| 879 case kTypedDataFloat64ArrayCid: | 881 case kTypedDataFloat64ArrayCid: |
| 880 return kUnboxedDouble; | 882 return kUnboxedDouble; |
| 881 case kTypedDataInt32x4ArrayCid: | 883 case kTypedDataInt32x4ArrayCid: |
| 882 return kUnboxedInt32x4; | 884 return kUnboxedInt32x4; |
| 883 case kTypedDataFloat32x4ArrayCid: | 885 case kTypedDataFloat32x4ArrayCid: |
| 884 return kUnboxedFloat32x4; | 886 return kUnboxedFloat32x4; |
| 887 case kTypedDataFloat64x2ArrayCid: | |
| 888 return kUnboxedFloat64x2; | |
| 885 default: | 889 default: |
| 886 UNREACHABLE(); | 890 UNREACHABLE(); |
| 887 return kTagged; | 891 return kTagged; |
| 888 } | 892 } |
| 889 } | 893 } |
| 890 | 894 |
| 891 | 895 |
| 892 LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const { | 896 LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const { |
| 893 const intptr_t kNumInputs = 2; | 897 const intptr_t kNumInputs = 2; |
| 894 const intptr_t kNumTemps = 0; | 898 const intptr_t kNumTemps = 0; |
| 895 LocationSummary* locs = | 899 LocationSummary* locs = |
| 896 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 900 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 897 locs->set_in(0, Location::RequiresRegister()); | 901 locs->set_in(0, Location::RequiresRegister()); |
| 898 // The smi index is either untagged (element size == 1), or it is left smi | 902 // The smi index is either untagged (element size == 1), or it is left smi |
| 899 // tagged (for all element sizes > 1). | 903 // tagged (for all element sizes > 1). |
| 900 // TODO(regis): Revisit and see if the index can be immediate. | 904 // TODO(regis): Revisit and see if the index can be immediate. |
| 901 locs->set_in(1, Location::WritableRegister()); | 905 locs->set_in(1, Location::WritableRegister()); |
| 902 if ((representation() == kUnboxedDouble) || | 906 if ((representation() == kUnboxedDouble) || |
| 903 (representation() == kUnboxedFloat32x4) || | 907 (representation() == kUnboxedFloat32x4) || |
| 904 (representation() == kUnboxedInt32x4)) { | 908 (representation() == kUnboxedInt32x4) || |
| 909 (representation() == kUnboxedFloat64x2)) { | |
| 905 locs->set_out(Location::RequiresFpuRegister()); | 910 locs->set_out(Location::RequiresFpuRegister()); |
| 906 } else { | 911 } else { |
| 907 locs->set_out(Location::RequiresRegister()); | 912 locs->set_out(Location::RequiresRegister()); |
| 908 } | 913 } |
| 909 return locs; | 914 return locs; |
| 910 } | 915 } |
| 911 | 916 |
| 912 | 917 |
| 913 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 918 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 914 Register array = locs()->in(0).reg(); | 919 Register array = locs()->in(0).reg(); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 944 UNREACHABLE(); | 949 UNREACHABLE(); |
| 945 } | 950 } |
| 946 | 951 |
| 947 if (!IsExternal()) { | 952 if (!IsExternal()) { |
| 948 ASSERT(this->array()->definition()->representation() == kTagged); | 953 ASSERT(this->array()->definition()->representation() == kTagged); |
| 949 __ AddImmediate(index.reg(), | 954 __ AddImmediate(index.reg(), |
| 950 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag); | 955 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag); |
| 951 } | 956 } |
| 952 element_address = Address(array, index.reg(), LSL, 0); | 957 element_address = Address(array, index.reg(), LSL, 0); |
| 953 | 958 |
| 954 if ((representation() == kUnboxedDouble) || | 959 if ((representation() == kUnboxedDouble) || |
| 955 (representation() == kUnboxedMint) || | 960 (representation() == kUnboxedMint) || |
| 956 (representation() == kUnboxedFloat32x4) || | 961 (representation() == kUnboxedFloat32x4) || |
| 957 (representation() == kUnboxedInt32x4)) { | 962 (representation() == kUnboxedInt32x4) || |
| 963 (representation() == kUnboxedFloat64x2)) { | |
| 958 QRegister result = locs()->out().fpu_reg(); | 964 QRegister result = locs()->out().fpu_reg(); |
| 959 DRegister dresult0 = EvenDRegisterOf(result); | 965 DRegister dresult0 = EvenDRegisterOf(result); |
| 960 DRegister dresult1 = OddDRegisterOf(result); | 966 DRegister dresult1 = OddDRegisterOf(result); |
| 961 switch (class_id()) { | 967 switch (class_id()) { |
| 962 case kTypedDataInt32ArrayCid: | 968 case kTypedDataInt32ArrayCid: |
| 963 UNIMPLEMENTED(); | 969 UNIMPLEMENTED(); |
| 964 break; | 970 break; |
| 965 case kTypedDataUint32ArrayCid: | 971 case kTypedDataUint32ArrayCid: |
| 966 UNIMPLEMENTED(); | 972 UNIMPLEMENTED(); |
| 967 break; | 973 break; |
| 968 case kTypedDataFloat32ArrayCid: | 974 case kTypedDataFloat32ArrayCid: |
| 969 // Load single precision float and promote to double. | 975 // Load single precision float and promote to double. |
| 970 // vldrs does not support indexed addressing. | 976 // vldrs does not support indexed addressing. |
| 971 __ add(index.reg(), index.reg(), ShifterOperand(array)); | 977 __ add(index.reg(), index.reg(), ShifterOperand(array)); |
| 972 element_address = Address(index.reg(), 0); | 978 element_address = Address(index.reg(), 0); |
| 973 __ vldrs(STMP, element_address); | 979 __ vldrs(STMP, element_address); |
| 974 __ vcvtds(dresult0, STMP); | 980 __ vcvtds(dresult0, STMP); |
| 975 break; | 981 break; |
| 976 case kTypedDataFloat64ArrayCid: | 982 case kTypedDataFloat64ArrayCid: |
| 977 // vldrd does not support indexed addressing. | 983 // vldrd does not support indexed addressing. |
| 978 __ add(index.reg(), index.reg(), ShifterOperand(array)); | 984 __ add(index.reg(), index.reg(), ShifterOperand(array)); |
| 979 element_address = Address(index.reg(), 0); | 985 element_address = Address(index.reg(), 0); |
| 980 __ vldrd(dresult0, element_address); | 986 __ vldrd(dresult0, element_address); |
| 981 break; | 987 break; |
| 988 case kTypedDataFloat64x2ArrayCid: | |
| 982 case kTypedDataInt32x4ArrayCid: | 989 case kTypedDataInt32x4ArrayCid: |
| 983 case kTypedDataFloat32x4ArrayCid: | 990 case kTypedDataFloat32x4ArrayCid: |
| 984 __ add(index.reg(), index.reg(), ShifterOperand(array)); | 991 __ add(index.reg(), index.reg(), ShifterOperand(array)); |
| 985 __ LoadDFromOffset(dresult0, index.reg(), 0); | 992 __ LoadDFromOffset(dresult0, index.reg(), 0); |
|
Florian Schneider
2014/02/20 15:54:44
Isn't there a Load-quad-word instruction on ARM? C
Cutch
2014/02/20 19:33:11
zra says there is but it can only be used if there
| |
| 986 __ LoadDFromOffset(dresult1, index.reg(), 2*kWordSize); | 993 __ LoadDFromOffset(dresult1, index.reg(), 2*kWordSize); |
| 987 break; | 994 break; |
| 988 } | 995 } |
| 989 return; | 996 return; |
| 990 } | 997 } |
| 991 | 998 |
| 992 Register result = locs()->out().reg(); | 999 Register result = locs()->out().reg(); |
| 993 switch (class_id()) { | 1000 switch (class_id()) { |
| 994 case kTypedDataInt8ArrayCid: | 1001 case kTypedDataInt8ArrayCid: |
| 995 ASSERT(index_scale() == 1); | 1002 ASSERT(index_scale() == 1); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1060 case kTypedDataInt32ArrayCid: | 1067 case kTypedDataInt32ArrayCid: |
| 1061 case kTypedDataUint32ArrayCid: | 1068 case kTypedDataUint32ArrayCid: |
| 1062 return value()->IsSmiValue() ? kTagged : kUnboxedMint; | 1069 return value()->IsSmiValue() ? kTagged : kUnboxedMint; |
| 1063 case kTypedDataFloat32ArrayCid: | 1070 case kTypedDataFloat32ArrayCid: |
| 1064 case kTypedDataFloat64ArrayCid: | 1071 case kTypedDataFloat64ArrayCid: |
| 1065 return kUnboxedDouble; | 1072 return kUnboxedDouble; |
| 1066 case kTypedDataFloat32x4ArrayCid: | 1073 case kTypedDataFloat32x4ArrayCid: |
| 1067 return kUnboxedFloat32x4; | 1074 return kUnboxedFloat32x4; |
| 1068 case kTypedDataInt32x4ArrayCid: | 1075 case kTypedDataInt32x4ArrayCid: |
| 1069 return kUnboxedInt32x4; | 1076 return kUnboxedInt32x4; |
| 1077 case kTypedDataFloat64x2ArrayCid: | |
| 1078 return kUnboxedFloat64x2; | |
| 1070 default: | 1079 default: |
| 1071 UNREACHABLE(); | 1080 UNREACHABLE(); |
| 1072 return kTagged; | 1081 return kTagged; |
| 1073 } | 1082 } |
| 1074 } | 1083 } |
| 1075 | 1084 |
| 1076 | 1085 |
| 1077 LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const { | 1086 LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const { |
| 1078 const intptr_t kNumInputs = 3; | 1087 const intptr_t kNumInputs = 3; |
| 1079 const intptr_t kNumTemps = 0; | 1088 const intptr_t kNumTemps = 0; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 1099 case kTypedDataInt16ArrayCid: | 1108 case kTypedDataInt16ArrayCid: |
| 1100 case kTypedDataUint16ArrayCid: | 1109 case kTypedDataUint16ArrayCid: |
| 1101 case kTypedDataInt32ArrayCid: | 1110 case kTypedDataInt32ArrayCid: |
| 1102 case kTypedDataUint32ArrayCid: | 1111 case kTypedDataUint32ArrayCid: |
| 1103 locs->set_in(2, Location::WritableRegister()); | 1112 locs->set_in(2, Location::WritableRegister()); |
| 1104 break; | 1113 break; |
| 1105 case kTypedDataFloat32ArrayCid: | 1114 case kTypedDataFloat32ArrayCid: |
| 1106 case kTypedDataFloat64ArrayCid: // TODO(srdjan): Support Float64 constants. | 1115 case kTypedDataFloat64ArrayCid: // TODO(srdjan): Support Float64 constants. |
| 1107 case kTypedDataInt32x4ArrayCid: | 1116 case kTypedDataInt32x4ArrayCid: |
| 1108 case kTypedDataFloat32x4ArrayCid: | 1117 case kTypedDataFloat32x4ArrayCid: |
| 1118 case kTypedDataFloat64x2ArrayCid: | |
| 1109 locs->set_in(2, Location::RequiresFpuRegister()); | 1119 locs->set_in(2, Location::RequiresFpuRegister()); |
| 1110 break; | 1120 break; |
| 1111 default: | 1121 default: |
| 1112 UNREACHABLE(); | 1122 UNREACHABLE(); |
| 1113 return NULL; | 1123 return NULL; |
| 1114 } | 1124 } |
| 1115 return locs; | 1125 return locs; |
| 1116 } | 1126 } |
| 1117 | 1127 |
| 1118 | 1128 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1238 __ add(index.reg(), index.reg(), ShifterOperand(array)); | 1248 __ add(index.reg(), index.reg(), ShifterOperand(array)); |
| 1239 __ StoreSToOffset(STMP, index.reg(), 0); | 1249 __ StoreSToOffset(STMP, index.reg(), 0); |
| 1240 break; | 1250 break; |
| 1241 } | 1251 } |
| 1242 case kTypedDataFloat64ArrayCid: { | 1252 case kTypedDataFloat64ArrayCid: { |
| 1243 DRegister in2 = EvenDRegisterOf(locs()->in(2).fpu_reg()); | 1253 DRegister in2 = EvenDRegisterOf(locs()->in(2).fpu_reg()); |
| 1244 __ add(index.reg(), index.reg(), ShifterOperand(array)); | 1254 __ add(index.reg(), index.reg(), ShifterOperand(array)); |
| 1245 __ StoreDToOffset(in2, index.reg(), 0); | 1255 __ StoreDToOffset(in2, index.reg(), 0); |
| 1246 break; | 1256 break; |
| 1247 } | 1257 } |
| 1258 case kTypedDataFloat64x2ArrayCid: | |
| 1248 case kTypedDataInt32x4ArrayCid: | 1259 case kTypedDataInt32x4ArrayCid: |
| 1249 case kTypedDataFloat32x4ArrayCid: { | 1260 case kTypedDataFloat32x4ArrayCid: { |
| 1250 QRegister in = locs()->in(2).fpu_reg(); | 1261 QRegister in = locs()->in(2).fpu_reg(); |
| 1251 DRegister din0 = EvenDRegisterOf(in); | 1262 DRegister din0 = EvenDRegisterOf(in); |
| 1252 DRegister din1 = OddDRegisterOf(in); | 1263 DRegister din1 = OddDRegisterOf(in); |
| 1253 __ add(index.reg(), index.reg(), ShifterOperand(array)); | 1264 __ add(index.reg(), index.reg(), ShifterOperand(array)); |
| 1254 __ StoreDToOffset(din0, index.reg(), 0); | 1265 __ StoreDToOffset(din0, index.reg(), 0); |
| 1255 __ StoreDToOffset(din1, index.reg(), 2*kWordSize); | 1266 __ StoreDToOffset(din1, index.reg(), 2*kWordSize); |
| 1256 break; | 1267 break; |
| 1257 } | 1268 } |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1988 compiler->RestoreLiveRegisters(locs); | 1999 compiler->RestoreLiveRegisters(locs); |
| 1989 | 2000 |
| 1990 __ b(exit_label()); | 2001 __ b(exit_label()); |
| 1991 } | 2002 } |
| 1992 | 2003 |
| 1993 private: | 2004 private: |
| 1994 Instruction* instruction_; | 2005 Instruction* instruction_; |
| 1995 }; | 2006 }; |
| 1996 | 2007 |
| 1997 | 2008 |
| 2009 class BoxFloat64x2SlowPath : public SlowPathCode { | |
| 2010 public: | |
| 2011 explicit BoxFloat64x2SlowPath(Instruction* instruction) | |
| 2012 : instruction_(instruction) { } | |
| 2013 | |
| 2014 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 2015 __ Comment("BoxFloat64x2SlowPath"); | |
| 2016 __ Bind(entry_label()); | |
| 2017 const Class& float64x2_class = compiler->float64x2_class(); | |
| 2018 const Code& stub = | |
| 2019 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); | |
| 2020 const ExternalLabel label(float64x2_class.ToCString(), stub.EntryPoint()); | |
| 2021 | |
| 2022 LocationSummary* locs = instruction_->locs(); | |
| 2023 locs->live_registers()->Remove(locs->out()); | |
| 2024 | |
| 2025 compiler->SaveLiveRegisters(locs); | |
| 2026 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | |
| 2027 &label, | |
| 2028 PcDescriptors::kOther, | |
| 2029 locs); | |
| 2030 __ mov(locs->out().reg(), ShifterOperand(R0)); | |
| 2031 compiler->RestoreLiveRegisters(locs); | |
| 2032 | |
| 2033 __ b(exit_label()); | |
| 2034 } | |
| 2035 | |
| 2036 private: | |
| 2037 Instruction* instruction_; | |
| 2038 }; | |
| 2039 | |
| 2040 | |
| 1998 LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const { | 2041 LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const { |
| 1999 const intptr_t kNumInputs = 1; | 2042 const intptr_t kNumInputs = 1; |
| 2000 const intptr_t kNumTemps = 0; | 2043 const intptr_t kNumTemps = 0; |
| 2001 LocationSummary* locs = | 2044 LocationSummary* locs = |
| 2002 new LocationSummary( | 2045 new LocationSummary( |
| 2003 kNumInputs, kNumTemps, | 2046 kNumInputs, kNumTemps, |
| 2004 (opt && !IsPotentialUnboxedLoad()) | 2047 (opt && !IsPotentialUnboxedLoad()) |
| 2005 ? LocationSummary::kNoCall | 2048 ? LocationSummary::kNoCall |
| 2006 : LocationSummary::kCallOnSlowPath); | 2049 : LocationSummary::kCallOnSlowPath); |
| 2007 | 2050 |
| (...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3011 | 3054 |
| 3012 const DRegister result_even = EvenDRegisterOf(result); | 3055 const DRegister result_even = EvenDRegisterOf(result); |
| 3013 const DRegister result_odd = OddDRegisterOf(result); | 3056 const DRegister result_odd = OddDRegisterOf(result); |
| 3014 __ LoadDFromOffset(result_even, value, | 3057 __ LoadDFromOffset(result_even, value, |
| 3015 Float32x4::value_offset() - kHeapObjectTag); | 3058 Float32x4::value_offset() - kHeapObjectTag); |
| 3016 __ LoadDFromOffset(result_odd, value, | 3059 __ LoadDFromOffset(result_odd, value, |
| 3017 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 3060 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
| 3018 } | 3061 } |
| 3019 | 3062 |
| 3020 | 3063 |
| 3064 LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(bool opt) const { | |
| 3065 const intptr_t kNumInputs = 1; | |
| 3066 const intptr_t kNumTemps = 1; | |
| 3067 LocationSummary* summary = | |
| 3068 new LocationSummary(kNumInputs, | |
| 3069 kNumTemps, | |
| 3070 LocationSummary::kCallOnSlowPath); | |
| 3071 summary->set_in(0, Location::RequiresFpuRegister()); | |
| 3072 summary->set_temp(0, Location::RequiresRegister()); | |
| 3073 summary->set_out(Location::RequiresRegister()); | |
| 3074 return summary; | |
| 3075 } | |
| 3076 | |
| 3077 | |
| 3078 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 3079 BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this); | |
| 3080 compiler->AddSlowPathCode(slow_path); | |
| 3081 | |
| 3082 Register out_reg = locs()->out().reg(); | |
| 3083 QRegister value = locs()->in(0).fpu_reg(); | |
| 3084 DRegister value_even = EvenDRegisterOf(value); | |
| 3085 DRegister value_odd = OddDRegisterOf(value); | |
| 3086 | |
| 3087 __ TryAllocate(compiler->float64x2_class(), | |
| 3088 slow_path->entry_label(), | |
| 3089 out_reg, | |
| 3090 locs()->temp(0).reg()); | |
| 3091 __ Bind(slow_path->exit_label()); | |
| 3092 | |
| 3093 __ StoreDToOffset(value_even, out_reg, | |
|
Florian Schneider
2014/02/20 15:54:44
Use one store-multiple instead of two store instru
| |
| 3094 Float32x4::value_offset() - kHeapObjectTag); | |
|
zra
2014/02/20 22:46:40
Is this supposed to be Float64x2::value_offset()?
| |
| 3095 __ StoreDToOffset(value_odd, out_reg, | |
| 3096 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | |
|
Florian Schneider
2014/02/20 15:54:44
spaces around *
Cutch
2014/02/20 19:33:11
Done here and elsewhere.
| |
| 3097 } | |
| 3098 | |
| 3099 | |
| 3100 LocationSummary* UnboxFloat64x2Instr::MakeLocationSummary(bool opt) const { | |
| 3101 const intptr_t value_cid = value()->Type()->ToCid(); | |
| 3102 const intptr_t kNumInputs = 1; | |
| 3103 const intptr_t kNumTemps = value_cid == kFloat64x2Cid ? 0 : 1; | |
| 3104 LocationSummary* summary = | |
| 3105 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | |
| 3106 summary->set_in(0, Location::RequiresRegister()); | |
| 3107 if (kNumTemps > 0) { | |
| 3108 ASSERT(kNumTemps == 1); | |
| 3109 summary->set_temp(0, Location::RequiresRegister()); | |
| 3110 } | |
| 3111 summary->set_out(Location::RequiresFpuRegister()); | |
| 3112 return summary; | |
| 3113 } | |
| 3114 | |
| 3115 | |
| 3116 void UnboxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 3117 const intptr_t value_cid = value()->Type()->ToCid(); | |
| 3118 const Register value = locs()->in(0).reg(); | |
| 3119 const QRegister result = locs()->out().fpu_reg(); | |
| 3120 | |
| 3121 if (value_cid != kFloat64x2Cid) { | |
| 3122 const Register temp = locs()->temp(0).reg(); | |
| 3123 Label* deopt = compiler->AddDeoptStub(deopt_id_, kDeoptCheckClass); | |
| 3124 __ tst(value, ShifterOperand(kSmiTagMask)); | |
| 3125 __ b(deopt, EQ); | |
| 3126 __ CompareClassId(value, kFloat64x2Cid, temp); | |
| 3127 __ b(deopt, NE); | |
| 3128 } | |
| 3129 | |
| 3130 const DRegister result_even = EvenDRegisterOf(result); | |
| 3131 const DRegister result_odd = OddDRegisterOf(result); | |
| 3132 __ LoadDFromOffset(result_even, value, | |
|
Florian Schneider
2014/02/20 15:54:44
Load-multiple (vldmd) instead of 2 vldr? This woul
Cutch
2014/02/20 19:33:11
vldmd can't be used with an offset.
| |
| 3133 Float64x2::value_offset() - kHeapObjectTag); | |
| 3134 __ LoadDFromOffset(result_odd, value, | |
| 3135 Float64x2::value_offset() + 2*kWordSize - kHeapObjectTag); | |
| 3136 } | |
| 3137 | |
| 3138 | |
| 3021 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { | 3139 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { |
| 3022 const intptr_t kNumInputs = 1; | 3140 const intptr_t kNumInputs = 1; |
| 3023 const intptr_t kNumTemps = 1; | 3141 const intptr_t kNumTemps = 1; |
| 3024 LocationSummary* summary = | 3142 LocationSummary* summary = |
| 3025 new LocationSummary(kNumInputs, | 3143 new LocationSummary(kNumInputs, |
| 3026 kNumTemps, | 3144 kNumTemps, |
| 3027 LocationSummary::kCallOnSlowPath); | 3145 LocationSummary::kCallOnSlowPath); |
| 3028 summary->set_in(0, Location::RequiresFpuRegister()); | 3146 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3029 summary->set_temp(0, Location::RequiresRegister()); | 3147 summary->set_temp(0, Location::RequiresRegister()); |
| 3030 summary->set_out(Location::RequiresRegister()); | 3148 summary->set_out(Location::RequiresRegister()); |
| (...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4896 compiler->GenerateCall(token_pos(), | 5014 compiler->GenerateCall(token_pos(), |
| 4897 &label, | 5015 &label, |
| 4898 PcDescriptors::kOther, | 5016 PcDescriptors::kOther, |
| 4899 locs()); | 5017 locs()); |
| 4900 __ Drop(2); // Discard type arguments and receiver. | 5018 __ Drop(2); // Discard type arguments and receiver. |
| 4901 } | 5019 } |
| 4902 | 5020 |
| 4903 } // namespace dart | 5021 } // namespace dart |
| 4904 | 5022 |
| 4905 #endif // defined TARGET_ARCH_ARM | 5023 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |