abrown opened Issue #1350:
What is the feature or code improvement you would like to do in Cranelift?
I would like to implement the SIMD
load_extend
instructions.
- What is the value of adding this in Cranelift?
This is necessary for Wasm SIMD spec compliance.
- Do you have an implementation plan, and/or ideas for data structures or
algorithms to use?I see that currently
shared/instructions.rs
includes instructions such asuload32
andsload32
; one option is to add the additional instructions[u/s]load8x8
,[u/s]load16x4
, and[u/s]load32x4
. Alternately, @bnjbvr and I had discussed using the IR->IR infrastructure of legalization to implement peephole optimizations; if this was in place and at the right level, I could translate the Wasmload8x8_s
, e.g., to Cranelift'sload.i8x8
anduextend
and then write a peephole optimization to generate the appropriate x86PMOVSXBW
to encode both of these instructions (perhaps with a new Craneliftx86_pmovsxb
instruction). Which approach is better.
abrown commented on Issue #1350:
cc: @bnjbvr, @sunfishcode
abrown edited Issue #1350:
What is the feature or code improvement you would like to do in Cranelift?
I would like to implement the SIMD
load_extend
instructions.What is the value of adding this in Cranelift?
This is necessary for Wasm SIMD spec compliance.
Do you have an implementation plan, and/or ideas for data structures or algorithms to use?
I see that currently
shared/instructions.rs
includes instructions such asuload32
andsload32
; one option is to add the additional instructions[u/s]load8x8
,[u/s]load16x4
, and[u/s]load32x4
. Alternately, @bnjbvr and I had discussed using the IR->IR infrastructure of legalization to implement peephole optimizations; if this was in place and at the right level, I could translate the Wasmload8x8_s
, e.g., to Cranelift'sload.i8x8
anduextend
and then write a peephole optimization to generate the appropriate x86PMOVSXBW
to encode both of these instructions (perhaps with a new Craneliftx86_pmovsxb
instruction). Which approach is better.
sunfishcode commented on Issue #1350:
Significant peephole-style optimization will be best done once https://github.com/bytecodealliance/cranelift/issues/1344 is in place and we can build up from there. So my suggestion here is to just add the additional instructions,
[u/s]load8x8
, and so on, for now, and then we can revisit them later once we're ready to do more general peephole optimizations.
alexcrichton transferred Issue #1350:
What is the feature or code improvement you would like to do in Cranelift?
I would like to implement the SIMD
load_extend
instructions.What is the value of adding this in Cranelift?
This is necessary for Wasm SIMD spec compliance.
Do you have an implementation plan, and/or ideas for data structures or algorithms to use?
I see that currently
shared/instructions.rs
includes instructions such asuload32
andsload32
; one option is to add the additional instructions[u/s]load8x8
,[u/s]load16x4
, and[u/s]load32x4
. Alternately, @bnjbvr and I had discussed using the IR->IR infrastructure of legalization to implement peephole optimizations; if this was in place and at the right level, I could translate the Wasmload8x8_s
, e.g., to Cranelift'sload.i8x8
anduextend
and then write a peephole optimization to generate the appropriate x86PMOVSXBW
to encode both of these instructions (perhaps with a new Craneliftx86_pmovsxb
instruction). Which approach is better.
Last updated: Nov 22 2024 at 17:03 UTC