Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Binary format bikeshed: where the `typeidx` immediate is located

Aperta
#10 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
wasm
Ambito
compilers

Direzione di ricerca

The issue discusses the binary format of the memarg immediate in WebAssembly proposals. Review the spec for multibyte-array-access and acquire-release-atomics to understand the current layout. Examine the parser code that handles these flags and immediates. The goal is to propose a consistent ordering of immediates based on flag bits, ensuring the change is compatible with existing and related proposals.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Currently this proposal specifies memarg ::= flags:u32 offset:u32 typeidx:u32 when flags has bit 5 set, but subjectively I find this a bit inconsistent with other immediates-specified-by-flags. For example bit 6, implying a memory index immediate, looks like memarg ::= flags:u32 memidx:u32 offset:u32. For the acquire-release-atomics proposal bit 4 implies memarg ::= flags:u32 ordering:u8 offset:u32 (at least I'm pretty sure given my current reading of the explainer and parser).

I opened a somewhat related issue at WebAssembly/acquire-release-atomics#28 but I think it'd be a bit nicer if the flags bits had payloads present after the flags leb in increasing order of the bits. Specifically I'd propose:

;; already specified in core wasm
memarg ::= flags:u32 offset:u32                               if (flags >> 4) == 0b000
         | flags:u32 memidx:u32 offset:u32                    if (flags >> 4) == 0b100

;; added by acquire-release-atomics
memarg ::= ...
         | flags:u32 ordering:u8 offset:u32                   if (flags >> 4) == 0b001
         | flags:u32 ordering:u8 memidx:u32 offset:u32        if (flags >> 4) == 0b101

;; added by multibyte-array-access
memarg ::= ...
         | flags:u32 typeidx:u32 offset:u32                   if (flags >> 4) == 0b010

;; added by both 
memarg ::= ...
         | flags:u32 ordering:u8 typeidx:u32 offset:u32       if (flags >> 4) == 0b011

where 0b110 and 0b111 are both parse errors with this proposal (memory index + type index). The 0b011 case might be invalid for now though while this proposal isn't extended to atomics, though.

Basically though I wanted to ask: what would others think about moving the typeidx immediate to before offset:u32?

EDIT: sorry forgot to finish writing the issue title before I hit submit so the notifications sent out have a pretty bad issue title :(

Lingua principale
WebAssembly
Stelle
4
Fork
1
Merge medio
16h 35m
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WebAssembly/multibyte-array-access

Tutte le issue di WebAssembly/multibyte-array-access

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.