| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 2947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2958 QRegister result = locs()->out().fpu_reg(); | 2958 QRegister result = locs()->out().fpu_reg(); |
| 2959 DRegister dresult0 = EvenDRegisterOf(result); | 2959 DRegister dresult0 = EvenDRegisterOf(result); |
| 2960 SRegister sresult0 = EvenSRegisterOf(dresult0); | 2960 SRegister sresult0 = EvenSRegisterOf(dresult0); |
| 2961 | 2961 |
| 2962 DRegister dvalue0 = EvenDRegisterOf(value); | 2962 DRegister dvalue0 = EvenDRegisterOf(value); |
| 2963 DRegister dvalue1 = OddDRegisterOf(value); | 2963 DRegister dvalue1 = OddDRegisterOf(value); |
| 2964 | 2964 |
| 2965 // For these cases the vdup instruction requires fewer | 2965 // For these cases the vdup instruction requires fewer |
| 2966 // instructions. For arbitrary shuffles, vtbl will be needed. | 2966 // instructions. For arbitrary shuffles, vtbl will be needed. |
| 2967 switch (op_kind()) { | 2967 switch (op_kind()) { |
| 2968 case MethodRecognizer::kFloat32x4ShuffleXXXX: | |
| 2969 __ vdup(kWord, result, dvalue0, 0); | |
| 2970 break; | |
| 2971 case MethodRecognizer::kFloat32x4ShuffleYYYY: | |
| 2972 __ vdup(kWord, result, dvalue0, 1); | |
| 2973 break; | |
| 2974 case MethodRecognizer::kFloat32x4ShuffleZZZZ: | |
| 2975 __ vdup(kWord, result, dvalue1, 0); | |
| 2976 break; | |
| 2977 case MethodRecognizer::kFloat32x4ShuffleWWWW: | |
| 2978 __ vdup(kWord, result, dvalue1, 1); | |
| 2979 break; | |
| 2980 case MethodRecognizer::kFloat32x4ShuffleX: | 2968 case MethodRecognizer::kFloat32x4ShuffleX: |
| 2981 __ vdup(kWord, result, dvalue0, 0); | 2969 __ vdup(kWord, result, dvalue0, 0); |
| 2982 __ vcvtds(dresult0, sresult0); | 2970 __ vcvtds(dresult0, sresult0); |
| 2983 break; | 2971 break; |
| 2984 case MethodRecognizer::kFloat32x4ShuffleY: | 2972 case MethodRecognizer::kFloat32x4ShuffleY: |
| 2985 __ vdup(kWord, result, dvalue0, 1); | 2973 __ vdup(kWord, result, dvalue0, 1); |
| 2986 __ vcvtds(dresult0, sresult0); | 2974 __ vcvtds(dresult0, sresult0); |
| 2987 break; | 2975 break; |
| 2988 case MethodRecognizer::kFloat32x4ShuffleZ: | 2976 case MethodRecognizer::kFloat32x4ShuffleZ: |
| 2989 __ vdup(kWord, result, dvalue1, 0); | 2977 __ vdup(kWord, result, dvalue1, 0); |
| 2990 __ vcvtds(dresult0, sresult0); | 2978 __ vcvtds(dresult0, sresult0); |
| 2991 break; | 2979 break; |
| 2992 case MethodRecognizer::kFloat32x4ShuffleW: | 2980 case MethodRecognizer::kFloat32x4ShuffleW: |
| 2993 __ vdup(kWord, result, dvalue1, 1); | 2981 __ vdup(kWord, result, dvalue1, 1); |
| 2994 __ vcvtds(dresult0, sresult0); | 2982 __ vcvtds(dresult0, sresult0); |
| 2995 break; | 2983 break; |
| 2984 case MethodRecognizer::kFloat32x4Shuffle: |
| 2985 if (mask_ == 0x00) { |
| 2986 __ vdup(kWord, result, dvalue0, 0); |
| 2987 } else if (mask_ == 0x55) { |
| 2988 __ vdup(kWord, result, dvalue0, 1); |
| 2989 } else if (mask_ == 0xAA) { |
| 2990 __ vdup(kWord, result, dvalue1, 0); |
| 2991 } else if (mask_ == 0xFF) { |
| 2992 __ vdup(kWord, result, dvalue1, 1); |
| 2993 } else { |
| 2994 // TODO(zra): Implement other shuffles. |
| 2995 UNIMPLEMENTED(); |
| 2996 } |
| 2997 break; |
| 2996 default: UNREACHABLE(); | 2998 default: UNREACHABLE(); |
| 2997 } | 2999 } |
| 2998 } | 3000 } |
| 2999 | 3001 |
| 3000 | 3002 |
| 3001 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const { | 3003 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const { |
| 3002 const intptr_t kNumInputs = 4; | 3004 const intptr_t kNumInputs = 4; |
| 3003 const intptr_t kNumTemps = 0; | 3005 const intptr_t kNumTemps = 0; |
| 3004 LocationSummary* summary = | 3006 LocationSummary* summary = |
| 3005 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3007 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3932 compiler->GenerateCall(token_pos(), | 3934 compiler->GenerateCall(token_pos(), |
| 3933 &label, | 3935 &label, |
| 3934 PcDescriptors::kOther, | 3936 PcDescriptors::kOther, |
| 3935 locs()); | 3937 locs()); |
| 3936 __ Drop(2); // Discard type arguments and receiver. | 3938 __ Drop(2); // Discard type arguments and receiver. |
| 3937 } | 3939 } |
| 3938 | 3940 |
| 3939 } // namespace dart | 3941 } // namespace dart |
| 3940 | 3942 |
| 3941 #endif // defined TARGET_ARCH_ARM | 3943 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |