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

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

Issue 267283004: Adds unary double operations to ARM64, enables many tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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/disassembler_arm64.cc ('k') | runtime/vm/intermediate_language_arm64.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) 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 5001 matching lines...) Expand 10 before | Expand all | Expand 10 after
5012 LocationSummary* result = new LocationSummary( 5012 LocationSummary* result = new LocationSummary(
5013 kNumInputs, kNumTemps, LocationSummary::kNoCall); 5013 kNumInputs, kNumTemps, LocationSummary::kNoCall);
5014 result->set_in(0, Location::RequiresFpuRegister()); 5014 result->set_in(0, Location::RequiresFpuRegister());
5015 result->set_out(0, Location::RequiresRegister()); 5015 result->set_out(0, Location::RequiresRegister());
5016 return result; 5016 return result;
5017 } 5017 }
5018 5018
5019 5019
5020 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5020 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5021 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); 5021 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi);
5022 Register result = locs()->out(0).reg(); 5022 const Register result = locs()->out(0).reg();
5023 DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); 5023 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg());
5024 // First check for NaN. Checking for minint after the conversion doesn't work 5024 // First check for NaN. Checking for minint after the conversion doesn't work
5025 // on ARM because vcvtid gives 0 for NaN. 5025 // on ARM because vcvtid gives 0 for NaN.
5026 __ vcmpd(value, value); 5026 __ vcmpd(value, value);
5027 __ vmstat(); 5027 __ vmstat();
5028 __ b(deopt, VS); 5028 __ b(deopt, VS);
5029 5029
5030 __ vcvtid(STMP, value); 5030 __ vcvtid(STMP, value);
5031 __ vmovrs(result, STMP); 5031 __ vmovrs(result, STMP);
5032 // Check for overflow and that it fits into Smi. 5032 // Check for overflow and that it fits into Smi.
5033 __ CompareImmediate(result, 0xC0000000); 5033 __ CompareImmediate(result, 0xC0000000);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
5119 // Pseudo code: 5119 // Pseudo code:
5120 // if (exponent == 0.0) return 1.0; 5120 // if (exponent == 0.0) return 1.0;
5121 // if (base == 1.0) return 1.0; 5121 // if (base == 1.0) return 1.0;
5122 // if (base.isNaN || exponent.isNaN) { 5122 // if (base.isNaN || exponent.isNaN) {
5123 // return double.NAN; 5123 // return double.NAN;
5124 // } 5124 // }
5125 // if (base != -Infinity && exponent == 0.5) { 5125 // if (base != -Infinity && exponent == 0.5) {
5126 // if (base == 0.0) return 0.0; 5126 // if (base == 0.0) return 0.0;
5127 // return sqrt(value); 5127 // return sqrt(value);
5128 // } 5128 // }
5129 DRegister base = EvenDRegisterOf(locs()->in(0).fpu_reg()); 5129 const DRegister base = EvenDRegisterOf(locs()->in(0).fpu_reg());
5130 DRegister exp = EvenDRegisterOf(locs()->in(1).fpu_reg()); 5130 const DRegister exp = EvenDRegisterOf(locs()->in(1).fpu_reg());
5131 DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); 5131 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg());
5132 Register temp = locs()->temp(0).reg(); 5132 const Register temp = locs()->temp(0).reg();
5133 DRegister saved_base = EvenDRegisterOf(locs()->temp(1).fpu_reg()); 5133 const DRegister saved_base = EvenDRegisterOf(locs()->temp(1).fpu_reg());
5134 ASSERT((base == result) && (result != saved_base)); 5134 ASSERT((base == result) && (result != saved_base));
5135 5135
5136 Label try_sqrt, check_base, return_nan; 5136 Label try_sqrt, check_base, return_nan;
5137 __ vmovd(saved_base, base); 5137 __ vmovd(saved_base, base);
5138 __ LoadDImmediate(DTMP, 0.0, temp); 5138 __ LoadDImmediate(DTMP, 0.0, temp);
5139 __ LoadDImmediate(result, 1.0, temp); 5139 __ LoadDImmediate(result, 1.0, temp);
5140 // exponent == 0.0 -> return 1.0; 5140 // exponent == 0.0 -> return 1.0;
5141 __ vcmpd(exp, DTMP); 5141 __ vcmpd(exp, DTMP);
5142 __ vmstat(); 5142 __ vmstat();
5143 __ b(&check_base, VS); // NaN -> check base. 5143 __ b(&check_base, VS); // NaN -> check base.
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
6081 compiler->GenerateCall(token_pos(), 6081 compiler->GenerateCall(token_pos(),
6082 &label, 6082 &label,
6083 PcDescriptors::kOther, 6083 PcDescriptors::kOther,
6084 locs()); 6084 locs());
6085 __ Drop(ArgumentCount()); // Discard arguments. 6085 __ Drop(ArgumentCount()); // Discard arguments.
6086 } 6086 }
6087 6087
6088 } // namespace dart 6088 } // namespace dart
6089 6089
6090 #endif // defined TARGET_ARCH_ARM 6090 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/disassembler_arm64.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698