gecko-dev/js
Julian Seward db99d20ce6 Bug 1753972 - Generalise `codegenTest{X64,X32,ARM64}_adhoc` and add consistent folding tests. r=lth.
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
2022-02-22 08:52:29 +00:00
..
ductwork/debugger
examples Bug 1746090 - Generalize traversing through a function's CFG with BFS_upwards(). r=jonco 2022-01-22 01:34:42 +00:00
loader Bug 1742437 - re-scope all generic module/script loader files under js/loader; r=jonco 2022-02-21 15:39:09 +00:00
public Backed out 3 changesets (bug 1753709) for causing build bustages on ScriptLoader.cpp. CLOSED TREE 2022-02-21 09:45:40 -08:00
src Bug 1753972 - Generalise `codegenTest{X64,X32,ARM64}_adhoc` and add consistent folding tests. r=lth. 2022-02-22 08:52:29 +00:00
xpconnect Bug 1755539 - Check more defensively in URLPreloader::ReadCache(). r=smaug 2022-02-16 21:56:01 +00:00
app.mozbuild
ffi.configure
moz.build
moz.configure Bug 1709578 - Trap NPE when loading registers for cheap call_indirect null check. r=jseward 2022-02-15 07:03:30 +00:00
sub.configure Bug 1752072 - Remove check for RANLIB. r=firefox-build-system-reviewers,mhentges 2022-02-03 00:06:30 +00:00