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

Side by Side Diff: runtime/vm/intermediate_language_x64.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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 switch (op_kind()) { 1999 switch (op_kind()) {
2000 case Token::kADD: __ addsd(left, right); break; 2000 case Token::kADD: __ addsd(left, right); break;
2001 case Token::kSUB: __ subsd(left, right); break; 2001 case Token::kSUB: __ subsd(left, right); break;
2002 case Token::kMUL: __ mulsd(left, right); break; 2002 case Token::kMUL: __ mulsd(left, right); break;
2003 case Token::kDIV: __ divsd(left, right); break; 2003 case Token::kDIV: __ divsd(left, right); break;
2004 default: UNREACHABLE(); 2004 default: UNREACHABLE();
2005 } 2005 }
2006 } 2006 }
2007 2007
2008 2008
2009 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
2010 const intptr_t kNumInputs = 1;
2011 const intptr_t kNumTemps = 0;
2012 LocationSummary* summary =
2013 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2014 summary->set_in(0, Location::RequiresXmmRegister());
2015 summary->set_out(Location::RequiresXmmRegister());
2016 return summary;
2017 }
2018
2019
2020 void MathSqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2021 __ sqrtsd(locs()->out().xmm_reg(), locs()->in(0).xmm_reg());
2022 }
2023
2024
2009 LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const { 2025 LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const {
2010 const intptr_t kNumInputs = 1; 2026 const intptr_t kNumInputs = 1;
2011 const intptr_t kNumTemps = 0; 2027 const intptr_t kNumTemps = 0;
2012 LocationSummary* summary = 2028 LocationSummary* summary =
2013 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 2029 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2014 summary->set_in(0, Location::RequiresRegister()); 2030 summary->set_in(0, Location::RequiresRegister());
2015 summary->set_out(Location::SameAsFirstInput()); 2031 summary->set_out(Location::SameAsFirstInput());
2016 return summary; 2032 return summary;
2017 } 2033 }
2018 2034
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
2310 __ j(ABOVE_EQUAL, deopt); 2326 __ j(ABOVE_EQUAL, deopt);
2311 } 2327 }
2312 } 2328 }
2313 2329
2314 2330
2315 } // namespace dart 2331 } // namespace dart
2316 2332
2317 #undef __ 2333 #undef __
2318 2334
2319 #endif // defined TARGET_ARCH_X64 2335 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/il_printer.cc ('K') | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698