Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit aa785d9

Browse files
aartbikcommit-bot@chromium.org
authored andcommitted
[dart/vm] Fix erroneous claim on "temp" Q7
Rationale: Q7 is a scratch register, it cannot hold input/outputs. flutter/flutter#32708 Change-Id: I0ad23d2d3e363be14cf83b085b94ce9ff3a22261 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103551 Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Aart Bik <[email protected]>
1 parent 704446d commit aa785d9

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

runtime/vm/compiler/backend/flow_graph_compiler_arm.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,12 +1432,14 @@ void ParallelMoveResolver::EmitSwap(int index) {
14321432
if (TargetCPUFeatures::neon_supported()) {
14331433
const QRegister dst = destination.fpu_reg();
14341434
const QRegister src = source.fpu_reg();
1435+
ASSERT(dst != QTMP && src != QTMP);
14351436
__ vmovq(QTMP, src);
14361437
__ vmovq(src, dst);
14371438
__ vmovq(dst, QTMP);
14381439
} else {
14391440
const DRegister dst = EvenDRegisterOf(destination.fpu_reg());
14401441
const DRegister src = EvenDRegisterOf(source.fpu_reg());
1442+
ASSERT(dst != DTMP && src != DTMP);
14411443
__ vmovd(DTMP, src);
14421444
__ vmovd(src, dst);
14431445
__ vmovd(dst, DTMP);

runtime/vm/compiler/backend/il_arm.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,10 +1295,10 @@ LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone,
12951295
(representation() == kUnboxedInt32x4) ||
12961296
(representation() == kUnboxedFloat64x2)) {
12971297
if (class_id() == kTypedDataFloat32ArrayCid) {
1298-
// Need register <= Q7 for float operations.
1298+
// Need register < Q7 for float operations.
12991299
// TODO(fschneider): Add a register policy to specify a subset of
13001300
// registers.
1301-
locs->set_out(0, Location::FpuRegisterLocation(Q7));
1301+
locs->set_out(0, Location::FpuRegisterLocation(Q6));
13021302
} else {
13031303
locs->set_out(0, Location::RequiresFpuRegister());
13041304
}
@@ -1599,8 +1599,8 @@ LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone,
15991599
Location::RequiresRegister()));
16001600
break;
16011601
case kTypedDataFloat32ArrayCid:
1602-
// Need low register (<= Q7).
1603-
locs->set_in(2, Location::FpuRegisterLocation(Q7));
1602+
// Need low register (< Q7).
1603+
locs->set_in(2, Location::FpuRegisterLocation(Q6));
16041604
break;
16051605
case kTypedDataFloat64ArrayCid: // TODO(srdjan): Support Float64 constants.
16061606
case kTypedDataInt32x4ArrayCid:
@@ -5396,9 +5396,9 @@ LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Zone* zone,
53965396
const intptr_t kNumTemps = 0;
53975397
LocationSummary* result = new (zone)
53985398
LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5399-
// Low (<= Q7) Q registers are needed for the conversion instructions.
5399+
// Low (< Q7) Q registers are needed for the conversion instructions.
54005400
result->set_in(0, Location::RequiresFpuRegister());
5401-
result->set_out(0, Location::FpuRegisterLocation(Q7));
5401+
result->set_out(0, Location::FpuRegisterLocation(Q6));
54025402
return result;
54035403
}
54045404

@@ -5415,8 +5415,8 @@ LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Zone* zone,
54155415
const intptr_t kNumTemps = 0;
54165416
LocationSummary* result = new (zone)
54175417
LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5418-
// Low (<= Q7) Q registers are needed for the conversion instructions.
5419-
result->set_in(0, Location::FpuRegisterLocation(Q7));
5418+
// Low (< Q7) Q registers are needed for the conversion instructions.
5419+
result->set_in(0, Location::FpuRegisterLocation(Q6));
54205420
result->set_out(0, Location::RequiresFpuRegister());
54215421
return result;
54225422
}

0 commit comments

Comments
 (0)