зеркало из https://github.com/mozilla/gecko-dev.git
b71f48bafa
For all targets, we generate good code for i32 compare followed by i32 select, provided the compare result is only used once. "Good" in the sense that the comparison result is not materialised into a register, but is instead transmitted to the select instruction as a condition code. On various targets float64 and float32 arguments are variously accepted as the comparison and/or selection types. However, on no targets are 64-bit integers accepted as either type. This patch extends the machinery to create good code for the cases compare-i32-select-i64, compare-i64-select-i32 and compare-i64-select-i64, on x64 and arm64. All other targets are unaffected. The patch uses the existing `LWasmCompareAndSelect` LIR node since that already has meaning "single register compare, single register select", and we are not introducing any double-register working here. The methods `LIRGenerator*::canSpecializeWasmCompareAndSelect`, `LIRGenerator*::lowerWasmCompareAndSelect` and `CodeGenerator*::visitWasmCompareAndSelect` have been completely un-shared (they were previously partly shared) and specialised to their specific architectures. With the addition of the {i32,i64} x {i32,i64} cases the remaining sharing is minimal and makes the code harder to follow. The rest of the changes are straightforward. tests/wasm/binop-arm64-ion-codegen.js tests/wasm/binop-x64-ion-codegen.js * new tests jit/shared/Lowering-shared.cpp * remove generic {canSpecialize,lower}WasmCompareAndSelect jit/CodeGenerator.cpp: * remove generic emitWasmCompareAndSelect jit/arm64/Lowering-arm64.cpp * extend existing {canSpecialize,lower}WasmCompareAndSelect jit/arm64/CodeGenerator-arm64.cpp * extend existing visitWasmCompareAndSelect jit/x64/Lowering-x64.cpp * private versions of {canSpecialize,lower}WasmCompareAndSelect jit/x64/CodeGenerator-x64.cpp * new method visitWasmCompareAndSelect (heavily modified generic) jit/arm/Lowering-arm.cpp * private versions of {canSpecialize,lower}WasmCompareAndSelect jit/arm/CodeGenerator-arm.cpp * private version of emitWasmCompareAndSelect (specialisation of generic) jit/x86/Lowering-x86.cpp * private versions of {canSpecialize,lower}WasmCompareAndSelect jit/x86/CodeGenerator-x86.cpp * private version of emitWasmCompareAndSelect (copy of generic) jit/arm64/MacroAssembler-arm64.h * new insn support for arm64 jit/x64/MacroAssembler-x64.h jit/x64/MacroAssembler-x64.cpp * new insn support for x64 Differential Revision: https://phabricator.services.mozilla.com/D133738 |
||
---|---|---|
.. | ||
ductwork/debugger | ||
examples | ||
public | ||
src | ||
xpconnect | ||
app.mozbuild | ||
ffi.configure | ||
moz.build | ||
moz.configure | ||
sub.configure |