зеркало из https://github.com/mozilla/gecko-dev.git
db99d20ce6
The wasm test machinery has functions `codegenTest{X64,X32,ARM64}_adhoc` to compile tiny wasm fragments and compare generated code against expected regexps. While useful these have the following limitations: * arm(32) isn't handled * results from the other 3 Tier-1 targets, given the same input, are potentially scattered across multiple files These make it difficult to systematically assess folding and codegen effects across the 4 Tier-1 platforms. The attached patch: * adds `codegenTestMultiplatform_adhoc`, which takes expected-result strings for all 4 platforms and uses the correct one. Debug printing is also improved. For convenience, the result string for 32-bit arm may be omitted, in which case the relevant test is not run. * adds tests for the folding rules shown below, for both 32- and 64-bit operations. mips64 is not supported, because it has no disassembly facility. Various missing folding rules and much regalloc badness is thereby exposed. The behaviour of the compilers is unaltered; this patch merely serves as a convenient way to assess and document the current folding behaviour. ``` 0 * x => 0 1 * x => x -1 * x => -x 2 * x => x + x 4 * x => x << 2 x * 0 => 0 x * 1 => x x * -1 => -x x * 2 => x + x x * 4 => x << 2 x >> 0 => x (any shift kind: shl, shrU, shrS) x + 0 => x 0 + x => x x + x => x << 1 x - 0 => x 0 - x => -x x - x => 0 ``` Differential Revision: https://phabricator.services.mozilla.com/D138129 |
||
---|---|---|
.. | ||
ductwork/debugger | ||
examples | ||
loader | ||
public | ||
src | ||
xpconnect | ||
app.mozbuild | ||
ffi.configure | ||
moz.build | ||
moz.configure | ||
sub.configure |