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

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

Issue 2273943002: VM: More refactoring of recognized methods inlining. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « runtime/vm/intermediate_language.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/compiler.h" 10 #include "vm/compiler.h"
(...skipping 5248 matching lines...) Expand 10 before | Expand all | Expand 10 after
5259 case Token::kBIT_XOR: __ veorq(result, left, right); break; 5259 case Token::kBIT_XOR: __ veorq(result, left, right); break;
5260 case Token::kADD: __ vaddqi(kWord, result, left, right); break; 5260 case Token::kADD: __ vaddqi(kWord, result, left, right); break;
5261 case Token::kSUB: __ vsubqi(kWord, result, left, right); break; 5261 case Token::kSUB: __ vsubqi(kWord, result, left, right); break;
5262 default: UNREACHABLE(); 5262 default: UNREACHABLE();
5263 } 5263 }
5264 } 5264 }
5265 5265
5266 5266
5267 LocationSummary* MathUnaryInstr::MakeLocationSummary(Zone* zone, 5267 LocationSummary* MathUnaryInstr::MakeLocationSummary(Zone* zone,
5268 bool opt) const { 5268 bool opt) const {
5269 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) {
5270 const intptr_t kNumInputs = 1;
5271 const intptr_t kNumTemps = TargetCPUFeatures::hardfp_supported() ? 0 : 4;
5272 LocationSummary* summary = new(zone) LocationSummary(
5273 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
5274 summary->set_in(0, Location::FpuRegisterLocation(Q0));
5275 summary->set_out(0, Location::FpuRegisterLocation(Q0));
5276 if (!TargetCPUFeatures::hardfp_supported()) {
5277 summary->set_temp(0, Location::RegisterLocation(R0));
5278 summary->set_temp(1, Location::RegisterLocation(R1));
5279 summary->set_temp(2, Location::RegisterLocation(R2));
5280 summary->set_temp(3, Location::RegisterLocation(R3));
5281 }
5282 return summary;
5283 }
5284 ASSERT((kind() == MathUnaryInstr::kSqrt) || 5269 ASSERT((kind() == MathUnaryInstr::kSqrt) ||
5285 (kind() == MathUnaryInstr::kDoubleSquare)); 5270 (kind() == MathUnaryInstr::kDoubleSquare));
5286 const intptr_t kNumInputs = 1; 5271 const intptr_t kNumInputs = 1;
5287 const intptr_t kNumTemps = 0; 5272 const intptr_t kNumTemps = 0;
5288 LocationSummary* summary = new(zone) LocationSummary( 5273 LocationSummary* summary = new(zone) LocationSummary(
5289 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5274 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5290 summary->set_in(0, Location::RequiresFpuRegister()); 5275 summary->set_in(0, Location::RequiresFpuRegister());
5291 summary->set_out(0, Location::RequiresFpuRegister()); 5276 summary->set_out(0, Location::RequiresFpuRegister());
5292 return summary; 5277 return summary;
5293 } 5278 }
5294 5279
5295 5280
5296 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5281 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5297 if (kind() == MathUnaryInstr::kSqrt) { 5282 if (kind() == MathUnaryInstr::kSqrt) {
5298 const DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg()); 5283 const DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg());
5299 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); 5284 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg());
5300 __ vsqrtd(result, val); 5285 __ vsqrtd(result, val);
5301 } else if (kind() == MathUnaryInstr::kDoubleSquare) { 5286 } else if (kind() == MathUnaryInstr::kDoubleSquare) {
5302 const DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg()); 5287 const DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg());
5303 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); 5288 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg());
5304 __ vmuld(result, val, val); 5289 __ vmuld(result, val, val);
5305 } else { 5290 } else {
5306 ASSERT((kind() == MathUnaryInstr::kSin) || 5291 UNREACHABLE();
5307 (kind() == MathUnaryInstr::kCos));
5308 if (TargetCPUFeatures::hardfp_supported()) {
5309 __ CallRuntime(TargetFunction(), InputCount());
5310 } else {
5311 // If we aren't doing "hardfp", then we have to move the double arguments
5312 // to the integer registers, and take the results from the integer
5313 // registers.
5314 __ vmovrrd(R0, R1, D0);
5315 __ vmovrrd(R2, R3, D1);
5316 __ CallRuntime(TargetFunction(), InputCount());
5317 __ vmovdrr(D0, R0, R1);
5318 __ vmovdrr(D1, R2, R3);
5319 }
5320 } 5292 }
5321 } 5293 }
5322 5294
5323 5295
5324 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary( 5296 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
5325 Zone* zone, bool opt) const { 5297 Zone* zone, bool opt) const {
5326 const intptr_t kNumTemps = 0; 5298 const intptr_t kNumTemps = 0;
5327 LocationSummary* summary = new(zone) LocationSummary( 5299 LocationSummary* summary = new(zone) LocationSummary(
5328 zone, InputCount(), kNumTemps, LocationSummary::kCall); 5300 zone, InputCount(), kNumTemps, LocationSummary::kCall);
5329 summary->set_in(0, Location::RegisterLocation(R0)); 5301 summary->set_in(0, Location::RegisterLocation(R0));
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
7013 1, 6985 1,
7014 locs()); 6986 locs());
7015 __ Drop(1); 6987 __ Drop(1);
7016 __ Pop(result); 6988 __ Pop(result);
7017 } 6989 }
7018 6990
7019 6991
7020 } // namespace dart 6992 } // namespace dart
7021 6993
7022 #endif // defined TARGET_ARCH_ARM 6994 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698