Skip to content

cranelift: Expose MachLabel#6529

Merged
cfallin merged 1 commit intobytecodealliance:mainfrom
saulecabrera:cranelift-expose-mach-label
Jun 6, 2023
Merged

cranelift: Expose MachLabel#6529
cfallin merged 1 commit intobytecodealliance:mainfrom
saulecabrera:cranelift-expose-mach-label

Conversation

@saulecabrera
Copy link
Member

This is the first of a series of patches to support control flow in Winch.

This change exposes MachLabel from cranelift for it to be consumed by Winch's MacroAssembler and Assembler.

This is the first of a series of patches to support control flow in
Winch.

This change exposes `MachLabel` from cranelift for it to be consumed by
Winch's `MacroAssembler` and `Assembler`.
@saulecabrera saulecabrera requested a review from a team as a code owner June 6, 2023 19:44
@saulecabrera saulecabrera requested review from cfallin and removed request for a team June 6, 2023 19:44
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Jun 6, 2023
@cfallin cfallin added this pull request to the merge queue Jun 6, 2023
Merged via the queue into bytecodealliance:main with commit 5c42fb4 Jun 6, 2023
@saulecabrera saulecabrera deleted the cranelift-expose-mach-label branch June 6, 2023 23:57
saulecabrera added a commit to saulecabrera/wasmtime that referenced this pull request Feb 8, 2024
Closes bytecodealliance#6529

This patch adds support for all the instructions involving WebAssembly
loads and stores for 32-bit memories. Given that the `memory64` proposal
is not enabled by default, this patch doesn't include an
implementation/tests for it; in theory minimal tweaks to the
currrent implementation will be needed in order to support 64-bit
memories.

Implemenation-wise, this change, follows a similar pattern as Cranelift
in order to calculate addresses for dynamic/static heaps, the main
difference being that in some cases, doing less work at compile time is
preferred; the current implemenation only checks for the general case of
out-of-bounds access for dynamic heaps for example.

Another important detail regarding the implementation, is the
introduction of `MacroAssembler::wasm_load` and
`MacroAssembler::wasm_store`, which internally use a common
implemenation for loads and stores, with the only difference that the
`wasm_*` variants set the right flags in order to signal that these
operations are not trusted and might trap.

Finally, given that this change introduces support for the last set of
instructions missing for a Wasm MVP, it removes most of Winch's copy of
the spectest suite, and switches over to using the official test suite
where possible (for tests that don't use SIMD or Reference Types).

Follow-up items:

* Before doing any deep benchmarking I'm planning on landing a couple of
  improvements regarding compile times that I've identified in parallel
  to this change.
* The `imports.wast` tests are disabled because I've identified a bug
  with `call_indirect`, which is not related to this change and exists
  in main.
* Find a way to run the `tests/all/memory.rs` (or perhaps most of
  integration tests) with Winch.

--
prtest:full
github-merge-queue bot pushed a commit that referenced this pull request Feb 9, 2024
* winch: Add support for WebAssembly loads/stores

Closes #6529

This patch adds support for all the instructions involving WebAssembly
loads and stores for 32-bit memories. Given that the `memory64` proposal
is not enabled by default, this patch doesn't include an
implementation/tests for it; in theory minimal tweaks to the
currrent implementation will be needed in order to support 64-bit
memories.

Implemenation-wise, this change, follows a similar pattern as Cranelift
in order to calculate addresses for dynamic/static heaps, the main
difference being that in some cases, doing less work at compile time is
preferred; the current implemenation only checks for the general case of
out-of-bounds access for dynamic heaps for example.

Another important detail regarding the implementation, is the
introduction of `MacroAssembler::wasm_load` and
`MacroAssembler::wasm_store`, which internally use a common
implemenation for loads and stores, with the only difference that the
`wasm_*` variants set the right flags in order to signal that these
operations are not trusted and might trap.

Finally, given that this change introduces support for the last set of
instructions missing for a Wasm MVP, it removes most of Winch's copy of
the spectest suite, and switches over to using the official test suite
where possible (for tests that don't use SIMD or Reference Types).

Follow-up items:

* Before doing any deep benchmarking I'm planning on landing a couple of
  improvements regarding compile times that I've identified in parallel
  to this change.
* The `imports.wast` tests are disabled because I've identified a bug
  with `call_indirect`, which is not related to this change and exists
  in main.
* Find a way to run the `tests/all/memory.rs` (or perhaps most of
  integration tests) with Winch.

--
prtest:full

* Review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants