Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Text syntax for SIMD lane index vs memory index operands #18

Closed
AndrewScheidecker opened this issue Mar 7, 2021 · 1 comment
Closed

Comments

@AndrewScheidecker
Copy link
Contributor

This proposal adds a memidx to the syntax for load/store instructions: i32.load 1 loads from memory index 1.

The SIMD proposal adds instructions with a laneidx immediate that load or store a single lane of a vector: v128.load8_lane 1 loads a scalar and replaces lane index 1 in a v128 operand.

If the proposals are merged, it's unclear whether the 1 in v128.load8_lane 1 should be parsed as a memory or lane index. It's possible to disambiguate it by saying that if there's a single index, it's the lane index, and if there are two indices, it's the memory index followed by the lane index.

Alternatively, we could require that memory index immediates are wrapped in a (memory ..) tag like in an active data segment definition. i.e.:

  • v128.load8_lane 2 would load a scalar from memory 0 and replace lane index 2.
  • v128.load8_lane (memory 1) would be malformed due to missing a lane index.
  • v128.load8_lane (memory 1) 2 would load a scalar from memory 1 and replace lane index 2.
@AndrewScheidecker
Copy link
Contributor Author

Oops, this is a dupe of #17.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant