Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#10 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
wasm
Área
compilers

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 :(

Lenguaje dominante
WebAssembly
Estrellas
4
Forks
1
Merge medio
16 h 35 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de WebAssembly/multibyte-array-access

Todos los issues de WebAssembly/multibyte-array-access

Issues similares

Más issues de Compilers

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.