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

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

Issue 10915200: Optimistically inline Math.sqrt as unboxed sqrtsd instruction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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) 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 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 switch (op_kind()) { 1972 switch (op_kind()) {
1973 case Token::kADD: __ addsd(left, right); break; 1973 case Token::kADD: __ addsd(left, right); break;
1974 case Token::kSUB: __ subsd(left, right); break; 1974 case Token::kSUB: __ subsd(left, right); break;
1975 case Token::kMUL: __ mulsd(left, right); break; 1975 case Token::kMUL: __ mulsd(left, right); break;
1976 case Token::kDIV: __ divsd(left, right); break; 1976 case Token::kDIV: __ divsd(left, right); break;
1977 default: UNREACHABLE(); 1977 default: UNREACHABLE();
1978 } 1978 }
1979 } 1979 }
1980 1980
1981 1981
1982 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
1983 const intptr_t kNumInputs = 1;
1984 const intptr_t kNumTemps = 0;
1985 LocationSummary* summary =
1986 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
1987 summary->set_in(0, Location::RequiresXmmRegister());
1988 summary->set_out(Location::RequiresXmmRegister());
1989 return summary;
1990 }
1991
1992
1993 void MathSqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1994 __ sqrtsd(locs()->out().xmm_reg(), locs()->in(0).xmm_reg());
1995 }
1996
1997
1982 LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const { 1998 LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const {
1983 const intptr_t kNumInputs = 1; 1999 const intptr_t kNumInputs = 1;
1984 const intptr_t kNumTemps = 0; 2000 const intptr_t kNumTemps = 0;
1985 LocationSummary* summary = 2001 LocationSummary* summary =
1986 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2002 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
1987 summary->set_in(0, Location::RequiresRegister()); 2003 summary->set_in(0, Location::RequiresRegister());
1988 summary->set_out(Location::SameAsFirstInput()); 2004 summary->set_out(Location::SameAsFirstInput());
1989 return summary; 2005 return summary;
1990 } 2006 }
1991 2007
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 __ j(ABOVE_EQUAL, deopt); 2301 __ j(ABOVE_EQUAL, deopt);
2286 } 2302 }
2287 } 2303 }
2288 2304
2289 2305
2290 } // namespace dart 2306 } // namespace dart
2291 2307
2292 #undef __ 2308 #undef __
2293 2309
2294 #endif // defined TARGET_ARCH_X64 2310 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698