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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('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_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 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after
2314 __ cvttsd2si(result, value); 2314 __ cvttsd2si(result, value);
2315 // Overflow is signalled with minint. 2315 // Overflow is signalled with minint.
2316 Label do_call, done; 2316 Label do_call, done;
2317 // Check for overflow and that it fits into Smi. 2317 // Check for overflow and that it fits into Smi.
2318 __ cmpl(result, Immediate(0xC0000000)); 2318 __ cmpl(result, Immediate(0xC0000000));
2319 __ j(NEGATIVE, deopt); 2319 __ j(NEGATIVE, deopt);
2320 __ SmiTag(result); 2320 __ SmiTag(result);
2321 } 2321 }
2322 2322
2323 2323
2324 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
2325 const intptr_t kNumInputs = 1;
2326 const intptr_t kNumTemps =
2327 (recognized_kind() == MethodRecognizer::kDoubleRound) ? 1 : 0;
2328 LocationSummary* result =
2329 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2330 result->set_in(0, Location::RequiresXmmRegister());
2331 result->set_out(Location::RequiresXmmRegister());
2332 if (recognized_kind() == MethodRecognizer::kDoubleRound) {
2333 result->set_temp(0, Location::RequiresXmmRegister());
2334 }
2335 return result;
2336 }
2337
2338
2339 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2340 XmmRegister value = locs()->in(0).xmm_reg();
2341 XmmRegister result = locs()->out().xmm_reg();
2342 if (recognized_kind() == MethodRecognizer::kDoubleTruncate) {
2343 __ roundsd(result, value, Assembler::kRoundToZero);
2344 } else {
2345 XmmRegister temp = locs()->temp(0).xmm_reg();
2346 __ DoubleRound(result, value, temp);
2347 }
2348 }
2349
2350
2324 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { 2351 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
2325 return MakeCallSummary(); 2352 return MakeCallSummary();
2326 } 2353 }
2327 2354
2328 2355
2329 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2356 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2330 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), 2357 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
2331 kDeoptPolymorphicInstanceCallTestFail); 2358 kDeoptPolymorphicInstanceCallTestFail);
2332 if (ic_data().NumberOfChecks() == 0) { 2359 if (ic_data().NumberOfChecks() == 0) {
2333 __ jmp(deopt); 2360 __ jmp(deopt);
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. 2825 __ pcmpeqq(XMM0, XMM0); // Generate all 1's.
2799 __ pxor(value, XMM0); 2826 __ pxor(value, XMM0);
2800 } 2827 }
2801 2828
2802 2829
2803 } // namespace dart 2830 } // namespace dart
2804 2831
2805 #undef __ 2832 #undef __
2806 2833
2807 #endif // defined TARGET_ARCH_X64 2834 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698