#if defined(DART_PRECOMPILED_RUNTIME)
#error "AOT runtime should not use compiler sources (including header files)"
#endif // defined(DART_PRECOMPILED_RUNTIME)
Remove #if defined(DART_PRECOMPILED_RUNTIME) from most compiler sources.
Change-Id: Id175c83fdbea38d9d5e1371ff433e3888f2afe8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143523
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Rewrite most SIMD instructions on ARM using this new way.
Our current way for defining instruction backends -- a pair of two virtual
methods called MakeLocationSummary and EmitNativeCode, leads to unnecessary
duplicated and verbose code. Code generation happens in three steps:
1. For each instruction in the graph MakeLocationSummary is called to
constructing a location summary object encoding register allocation constraints;
2. When all register constraints are collected a register allocation is performed
and results are filled back into the location summaries;
3. For each instruction in the graph EmitNativeCode is called. It unpacks
location summary attached to the instruction into actual machine registers and
emits native code.
There is usually a lot of duplication between declaring register constraints in
MLS and unpacking them in ENC which this CL is trying to remove.
The new way is centered on the concept of an *emitter function* which encodes
in its signature register constraints for a particular instruction.
We use a combination of templates and macroses to enable writing
DEFINE_BACKEND(BinaryFloat32x4Op,
(QRegister result, QRegister left, QRegister right)) {
// ...
}
Instead of
LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
LocationSummary* summary = new (zone)
LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
}
void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const QRegister left = locs()->in(0).fpu_reg();
const QRegister right = locs()->in(1).fpu_reg();
const QRegister result = locs()->out(0).fpu_reg();
// ...
}
This change also introduces a new, more handy way to work with S/D components of QRegisters, QRegister_ wrapper type.
Bug: https://github.com/dart-lang/sdk/issues/30949
Change-Id: I7bb0fc9672c89acc3d3d9b5e9859ae5a5471f420
Reviewed-on: https://dart-review.googlesource.com/11820
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit 04aa2b0186.
Reason for revert: Compilation is failing on some Windows builders. It may be the version of MSVC running on those machines that makes the difference. But I think we need to revert until we figure it out. The error is "runtime\vm\compiler\backend\locations_helpers_test.cc(111): error C2466: cannot allocate an array of constant size 0"
Original change's description:
> [VM] Introduce new way to define instruction backends.
>
> Rewrite most SIMD instructions on ARM using this new way.
>
> Our current way for defining instruction backends -- a pair of two virtual
> methods called MakeLocationSummary and EmitNativeCode, leads to unnecessary
> duplicated and verbose code. Code generation happens in three steps:
>
> 1. For each instruction in the graph MakeLocationSummary is called to
> constructing a location summary object encoding register allocation constraints;
> 2. When all register constraints are collected a register allocation is performed
> and results are filled back into the location summaries;
> 3. For each instruction in the graph EmitNativeCode is called. It unpacks
> location summary attached to the instruction into actual machine registers and
> emits native code.
>
> There is usually a lot of duplication between declaring register constraints in
> MLS and unpacking them in ENC which this CL is trying to remove.
>
> The new way is centered on the concept of an *emitter function* which encodes
> in its signature register constraints for a particular instruction.
>
> We use a combination of templates and macroses to enable writing
>
> DEFINE_BACKEND(BinaryFloat32x4Op,
> (QRegister result, QRegister left, QRegister right)) {
> // ...
> }
>
> Instead of
>
> LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
> bool opt) const {
> const intptr_t kNumInputs = 2;
> const intptr_t kNumTemps = 0;
> LocationSummary* summary = new (zone)
> LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
> summary->set_in(0, Location::RequiresFpuRegister());
> summary->set_in(1, Location::RequiresFpuRegister());
> summary->set_out(0, Location::RequiresFpuRegister());
> return summary;
> }
>
> void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
> const QRegister left = locs()->in(0).fpu_reg();
> const QRegister right = locs()->in(1).fpu_reg();
> const QRegister result = locs()->out(0).fpu_reg();
> // ...
> }
>
> This change also introduces a new, more handy way to work with S/D components of QRegisters, QRegister_ wrapper type.
>
> Bug: https://github.com/dart-lang/sdk/issues/30949
> Change-Id: I7f2beb106d1458facf4a3d75cae123e1fc25d8b5
> Reviewed-on: https://dart-review.googlesource.com/11507
> Reviewed-by: Zach Anderson <zra@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,alexmarkov@google.com,zra@google.com
Change-Id: Icfaabe58351a61d4eb50c4f9ac3bbd9677339fe7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/30949
Reviewed-on: https://dart-review.googlesource.com/11780
Reviewed-by: William Hesse <whesse@google.com>
Rewrite most SIMD instructions on ARM using this new way.
Our current way for defining instruction backends -- a pair of two virtual
methods called MakeLocationSummary and EmitNativeCode, leads to unnecessary
duplicated and verbose code. Code generation happens in three steps:
1. For each instruction in the graph MakeLocationSummary is called to
constructing a location summary object encoding register allocation constraints;
2. When all register constraints are collected a register allocation is performed
and results are filled back into the location summaries;
3. For each instruction in the graph EmitNativeCode is called. It unpacks
location summary attached to the instruction into actual machine registers and
emits native code.
There is usually a lot of duplication between declaring register constraints in
MLS and unpacking them in ENC which this CL is trying to remove.
The new way is centered on the concept of an *emitter function* which encodes
in its signature register constraints for a particular instruction.
We use a combination of templates and macroses to enable writing
DEFINE_BACKEND(BinaryFloat32x4Op,
(QRegister result, QRegister left, QRegister right)) {
// ...
}
Instead of
LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
LocationSummary* summary = new (zone)
LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
}
void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const QRegister left = locs()->in(0).fpu_reg();
const QRegister right = locs()->in(1).fpu_reg();
const QRegister result = locs()->out(0).fpu_reg();
// ...
}
This change also introduces a new, more handy way to work with S/D components of QRegisters, QRegister_ wrapper type.
Bug: https://github.com/dart-lang/sdk/issues/30949
Change-Id: I7f2beb106d1458facf4a3d75cae123e1fc25d8b5
Reviewed-on: https://dart-review.googlesource.com/11507
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>