summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/simd/README-codegen.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/jit-test/tests/wasm/simd/README-codegen.md
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/wasm/simd/README-codegen.md')
-rw-r--r--js/src/jit-test/tests/wasm/simd/README-codegen.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/simd/README-codegen.md b/js/src/jit-test/tests/wasm/simd/README-codegen.md
new file mode 100644
index 0000000000..9db06e07ad
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/simd/README-codegen.md
@@ -0,0 +1,28 @@
+About whitebox code generation tests (*-codegen.js):
+
+These test that extraneous moves are not inserted by the register
+allocator or code generator under ideal conditions: when it is in
+principle possible for the code generator and register allocator to
+use inputs where they are and generate outputs directly in the target
+registers.
+
+These tests are both limited in scope and brittle in the face of
+changes to the register allocator, but how else would we test that
+code generation and register allocation work when presented with the
+easiest case? And if they don't work then, when will they work?
+
+For a reliable test, the inputs must be known to be in the fixed
+parameter registers and the result must be known to be desired in the
+fixed function result register.
+
+Sometimes, to test optimal codegen, we need the inputs to be in
+reversed or permuted locations so as to avoid generating moves that
+are inserted by the regalloc to adapt to the function signature.
+
+In the test cases, the expected output is expressed as a multi-line
+regular expression. The first line of each expected output is the
+tail end of the prologue; subsequent lines comprise the operation;
+finally there is the beginning of the epilogue. Sometimes there is
+only the end of the prologue and the beginning of the operation, as
+the operation is long and we don't care about its tail.
+