Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#10 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
wasm
Lĩnh vực
compilers

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
WebAssembly
Star
4
Fork
1
Merge trung bình
16 giờ 35 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WebAssembly/multibyte-array-access

Tất cả issue của WebAssembly/multibyte-array-access

Issue tương tự

Thêm issue về Compilers

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.