Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: runtime/vm/intermediate_language_ia32.cc

Issue 19564014: Add all 256 shuffle methods to Float32x4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 return summary; 2999 return summary;
3000 } 3000 }
3001 3001
3002 3002
3003 void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3003 void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3004 XmmRegister value = locs()->in(0).fpu_reg(); 3004 XmmRegister value = locs()->in(0).fpu_reg();
3005 3005
3006 ASSERT(locs()->out().fpu_reg() == value); 3006 ASSERT(locs()->out().fpu_reg() == value);
3007 3007
3008 switch (op_kind()) { 3008 switch (op_kind()) {
3009 case MethodRecognizer::kFloat32x4ShuffleXXXX:
3010 __ shufps(value, value, Immediate(0x00));
3011 break;
3012 case MethodRecognizer::kFloat32x4ShuffleYYYY:
3013 __ shufps(value, value, Immediate(0x55));
3014 break;
3015 case MethodRecognizer::kFloat32x4ShuffleZZZZ:
3016 __ shufps(value, value, Immediate(0xAA));
3017 break;
3018 case MethodRecognizer::kFloat32x4ShuffleWWWW:
3019 __ shufps(value, value, Immediate(0xFF));
3020 break;
3021 case MethodRecognizer::kFloat32x4ShuffleX: 3009 case MethodRecognizer::kFloat32x4ShuffleX:
3022 __ shufps(value, value, Immediate(0x00)); 3010 __ shufps(value, value, Immediate(0x00));
3023 __ cvtss2sd(value, value); 3011 __ cvtss2sd(value, value);
3024 break; 3012 break;
3025 case MethodRecognizer::kFloat32x4ShuffleY: 3013 case MethodRecognizer::kFloat32x4ShuffleY:
3026 __ shufps(value, value, Immediate(0x55)); 3014 __ shufps(value, value, Immediate(0x55));
3027 __ cvtss2sd(value, value); 3015 __ cvtss2sd(value, value);
3028 break; 3016 break;
3029 case MethodRecognizer::kFloat32x4ShuffleZ: 3017 case MethodRecognizer::kFloat32x4ShuffleZ:
3030 __ shufps(value, value, Immediate(0xAA)); 3018 __ shufps(value, value, Immediate(0xAA));
3031 __ cvtss2sd(value, value); 3019 __ cvtss2sd(value, value);
3032 break; 3020 break;
3033 case MethodRecognizer::kFloat32x4ShuffleW: 3021 case MethodRecognizer::kFloat32x4ShuffleW:
3034 __ shufps(value, value, Immediate(0xFF)); 3022 __ shufps(value, value, Immediate(0xFF));
3035 __ cvtss2sd(value, value); 3023 __ cvtss2sd(value, value);
3036 break; 3024 break;
3037 3025 case MethodRecognizer::kFloat32x4Shuffle:
3026 __ shufps(value, value, Immediate(mask_));
3027 break;
3038 default: UNREACHABLE(); 3028 default: UNREACHABLE();
3039 } 3029 }
3040 } 3030 }
3041 3031
3042 3032
3043 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const { 3033 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
3044 const intptr_t kNumInputs = 4; 3034 const intptr_t kNumInputs = 4;
3045 const intptr_t kNumTemps = 0; 3035 const intptr_t kNumTemps = 0;
3046 LocationSummary* summary = 3036 LocationSummary* summary =
3047 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3037 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
4759 PcDescriptors::kOther, 4749 PcDescriptors::kOther,
4760 locs()); 4750 locs());
4761 __ Drop(2); // Discard type arguments and receiver. 4751 __ Drop(2); // Discard type arguments and receiver.
4762 } 4752 }
4763 4753
4764 } // namespace dart 4754 } // namespace dart
4765 4755
4766 #undef __ 4756 #undef __
4767 4757
4768 #endif // defined TARGET_ARCH_IA32 4758 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698