diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/jit-test/tests/wasm/memory-arm64-ion-codegen.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/wasm/memory-arm64-ion-codegen.js')
-rw-r--r-- | js/src/jit-test/tests/wasm/memory-arm64-ion-codegen.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/memory-arm64-ion-codegen.js b/js/src/jit-test/tests/wasm/memory-arm64-ion-codegen.js new file mode 100644 index 0000000000..48ad75aa11 --- /dev/null +++ b/js/src/jit-test/tests/wasm/memory-arm64-ion-codegen.js @@ -0,0 +1,56 @@ +// |jit-test| skip-if: !hasDisassembler() || wasmCompileMode() != "ion" || !getBuildConfiguration().arm64; include:codegen-arm64-test.js + +// Test that loads/stores at friendly constant offsets yield expected code + +codegenTestARM64_adhoc( + `(module + (memory 1) + (func (export "f") (result i32) + (i32.load (i32.const 4000))))`, + 'f', + 'b94fa2a0 ldr w0, \\[x21, #4000\\]'); + +codegenTestARM64_adhoc( + `(module + (memory 1) + (func (export "f") (result i32) + (i32.load offset=1000 (i32.const 3000))))`, + 'f', + 'b94fa2a0 ldr w0, \\[x21, #4000\\]'); + +codegenTestARM64_adhoc( + `(module + (memory 1) + (func (export "f") (param i32) + (i32.store (i32.const 4000) (local.get 0))))`, + 'f', + 'b90fa2a0 str w0, \\[x21, #4000\\]'); + +codegenTestARM64_adhoc( + `(module + (memory 1) + (func (export "f") (param i32) + (i32.store offset=1000 (i32.const 3000) (local.get 0))))`, + 'f', + 'b90fa2a0 str w0, \\[x21, #4000\\]'); + +// Unfriendly offsets are first loaded into a scratch register + +codegenTestARM64_adhoc( + `(module + (memory 1) + (func (export "f") (result i32) + (i32.load (i32.const 4001))))`, + 'f', + `d281f430 mov x16, #0xfa1 + b8706aa0 ldr w0, \\[x21, x16\\]`); + +codegenTestARM64_adhoc( + `(module + (memory 1) + (func (export "f") (param i32) + (i32.store (i32.const 4001) (local.get 0))))`, + 'f', + `d281f430 mov x16, #0xfa1 + b8306aa0 str w0, \\[x21, x16\\]`); + |