diff options
| author | Luuk de Gram <luuk@degram.dev> | 2021-11-15 09:02:24 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-15 18:02:24 +0100 |
| commit | d3135f76823a053c4e580830f6a6c080caae5ab5 (patch) | |
| tree | 254a2617b03c3c002dfee9c7444ea3ae59385b2d /lib | |
| parent | b26b72f54051b89e6fc349f453aafe9f3a3135a5 (diff) | |
| download | zig-d3135f76823a053c4e580830f6a6c080caae5ab5.tar.gz zig-d3135f76823a053c4e580830f6a6c080caae5ab5.zip | |
Stage2: wasm - Implement the MIR pass (#10153)
* wasm: Move wasm's codegen to arch/wasm/CodeGen.zig
* wasm: Define Wasm's Mir
This declares the initial most-used instructions for wasm as
well as the data that represents them.
TODO: Add binary operand opcodes.
By re-using the wasm opcode values, we can emit each opcode very easily
by simply using `@enumToInt()`. However, this poses a possible problem:
If we use all of wasm's opcodes, it leaves us no room to use synthetic opcodes such as debugging instructions.
We could use reserved opcodes, but the wasm spec may use them at some point.
TODO: Check if we should perhaps use a 16bit tag where the highest bits are used for synthetic opcodes.
* wasm: Define basic Emit structure
* wasm: Implement corresponding Emit functions for MIR
* wasm: Initial lowering to MIR
- This implements lowering to MIR from AIR for storing and loading of locals
as well as emitting immediates.
- Relocating function indexes has been simplified a lot as well as we no
longer need to patch offsets and we write a relocatable value instead.
- Locals are now emitted at the beginning of the function section entry
meaning all offsets we generate are stable.
* wasm: Lower all AIR instructions to MIR
* wasm: Implement remaining MIR instructions
* wasm: Fix function relocations
* wasm: Get all tests working
* wasm: Make `Data` 4 bytes instead of 8.
- 64bit immediates are now stored in 2 seperate u32's.
- 64bit floats are now stored in 2 seperate u32's.
- `mem_arg` is now stored as a seperate payload in extra.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions
