Skip to content

Disassemble *.cwasm for compile disas tests #8237

Merged
alexcrichton merged 3 commits intobytecodealliance:mainfrom
alexcrichton:change-how-compile-tests-work
Mar 26, 2024
Merged

Disassemble *.cwasm for compile disas tests #8237
alexcrichton merged 3 commits intobytecodealliance:mainfrom
alexcrichton:change-how-compile-tests-work

Conversation

@alexcrichton
Copy link
Member

This commit changes how the compile mode of the disas test suite
works. Previously this would use --emit-clif and run the Cranelift
pipeline for each individual function and use the custom VCode-based
disassembly for instruction output. This commit instead uses the raw
binary coming out of Wasmtime. The ELF file itself is parsed and is
disassembled in a manner similar to Winch tests.

The goal of this commit is somewhat twofold:

  • Lay the groundwork to migrate all Winch-based filetests to
    tests/disas.
  • Test the raw output from Cranelift/Wasmtime which includes
    optimizations like branch chomping in the MachBuffer.

This commit doesn't itself move the Winch tests yet, that's left for a
future commit.

@alexcrichton alexcrichton requested review from a team as code owners March 25, 2024 22:26
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team March 25, 2024 22:26
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

This commit changes how the `compile` mode of the `disas` test suite
works. Previously this would use `--emit-clif` and run the Cranelift
pipeline for each individual function and use the custom VCode-based
disassembly for instruction output. This commit instead uses the raw
binary coming out of Wasmtime. The ELF file itself is parsed and is
disassembled in a manner similar to Winch tests.

The goal of this commit is somewhat twofold:

* Lay the groundwork to migrate all Winch-based filetests to
  `tests/disas`.
* Test the raw output from Cranelift/Wasmtime which includes
  optimizations like branch chomping in the `MachBuffer`.

This commit doesn't itself move the Winch tests yet, that's left for a
future commit.
@alexcrichton alexcrichton force-pushed the change-how-compile-tests-work branch from 8d8c135 to 1f58359 Compare March 26, 2024 14:26
@alexcrichton alexcrichton enabled auto-merge March 26, 2024 14:29
@alexcrichton alexcrichton added this pull request to the merge queue Mar 26, 2024
Merged via the queue into bytecodealliance:main with commit ad30810 Mar 26, 2024
@alexcrichton alexcrichton deleted the change-how-compile-tests-work branch March 26, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants