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

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

Issue 11573044: Inline Doubles truncate and round. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | tests/language/arithmetic_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 // Overflow is signalled with minint. 2203 // Overflow is signalled with minint.
2204 Label do_call, done; 2204 Label do_call, done;
2205 // Check for overflow and that it fits into Smi. 2205 // Check for overflow and that it fits into Smi.
2206 __ movq(temp, result); 2206 __ movq(temp, result);
2207 __ shlq(temp, Immediate(1)); 2207 __ shlq(temp, Immediate(1));
2208 __ j(OVERFLOW, deopt); 2208 __ j(OVERFLOW, deopt);
2209 __ SmiTag(result); 2209 __ SmiTag(result);
2210 } 2210 }
2211 2211
2212 2212
2213 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
2214 const intptr_t kNumInputs = 1;
2215 const intptr_t kNumTemps =
2216 (recognized_kind() == MethodRecognizer::kDoubleRound) ? 1 : 0;
2217 LocationSummary* result =
2218 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2219 result->set_in(0, Location::RequiresXmmRegister());
2220 result->set_out(Location::RequiresXmmRegister());
2221 if (recognized_kind() == MethodRecognizer::kDoubleRound) {
2222 result->set_temp(0, Location::RequiresXmmRegister());
2223 }
2224 return result;
2225 }
2226
2227
2228 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2229 XmmRegister value = locs()->in(0).xmm_reg();
2230 XmmRegister result = locs()->out().xmm_reg();
2231 if (recognized_kind() == MethodRecognizer::kDoubleTruncate) {
2232 __ roundsd(result, value, Assembler::kRoundToZero);
2233 } else {
2234 XmmRegister temp = locs()->temp(0).xmm_reg();
2235 __ DoubleRound(result, value, temp);
2236 }
2237 }
2238
2239
2213 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { 2240 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
2214 return MakeCallSummary(); 2241 return MakeCallSummary();
2215 } 2242 }
2216 2243
2217 2244
2218 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2245 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2219 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), 2246 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
2220 kDeoptPolymorphicInstanceCallTestFail); 2247 kDeoptPolymorphicInstanceCallTestFail);
2221 if (ic_data().NumberOfChecks() == 0) { 2248 if (ic_data().NumberOfChecks() == 0) {
2222 __ jmp(deopt); 2249 __ jmp(deopt);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2441 2468
2442 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2469 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2443 UNIMPLEMENTED(); 2470 UNIMPLEMENTED();
2444 } 2471 }
2445 2472
2446 } // namespace dart 2473 } // namespace dart
2447 2474
2448 #undef __ 2475 #undef __
2449 2476
2450 #endif // defined TARGET_ARCH_X64 2477 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | tests/language/arithmetic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698