GC and on-stack equivalents of f32.load_f16 and f32.store_f16
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- wasm
- 领域
- compilers
调研方向
从 issue 中描述的拟议 on-stack 操作和替代的 f16 存储类型开始;比较它们对 WasmGC、线性内存以及现有 struct/array 指令的影响。提案对所需指令或存储类型形成确定的设计,并且对相应行为作出规范说明后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Outside of the SIMD operations, the proposal includes two opcodes to read and write f32s to the linear memory as f16s. Languages that compile to WasmGC typically don't even allocate a memory at all. It would be quite inconvenient to allocate a 2-byte memory and read-write through it in order to manipulate f16 bits.
I propose to add at least an on-stack equivalent to these instructions, which is similar to the pairs f32.reinterpret_i32 f64.promote_f32 and f32.demote_f64 i32.reinterpret_f32:
-
f32.promote_f16_reinterpret_i32: [i32] -> [f32]
extracts the 16 low-order bits of the input, reinterpret them as anf16, and promote thatf16value anf32. -
i32.reinterpret_f16_demote_f32: [f32] -> [i32]
demotes the inputf32into anf16, reinterpret it as ani16, and zero-extend it to ani32
One could argue that the above are the fundamental operations, and that the memory operations could be expressed in terms of them + i16 memory operations.
If not, then I propose we also bring WasmGC on par with the linear memory with appropriate struct. and array. operations:
struct.get_promote x y: [(ref null x)] -> [f32]: loads ani16field, reinterpret asf16and promote tof32struct.set_demote x y: [(ref null x) f32] -> []: demotes to anf16, reinterpret asi16and stores- Similarly for
array.get_promoteandarray.set_demote.
Edit: alternative for WasmGC: just introduce f16 as a storagetype, but not as a full valtype (like i16). Then we can use the existing struct.get, struct.set, etc. instructions. This is probably a lot simpler.
- 主要语言
- WebAssembly
- 星标
- 14
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WebAssembly/fp16 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
WebAssembly/fp16#11 · 1 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
WebAssembly/fp16#8 · 1 条评论 ·
-
Hardware support未关闭
难度 5/5 一周以上 新手友好度 25/100
WebAssembly/fp16#7 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
WebAssembly/fp16#6 · 1 条评论 · 1 个 reaction ·
-
难度 5/5 一周以上 新手友好度 20/100
WebAssembly/fp16#4 · 22 条评论 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
-
DAE2 crashes on call.without.effects with a non ref.func expression可能已有人在做 @stevenfontanella 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
WebAssembly/binaryen#9404 ·
维护者通常 1 天内回复
-
area:compiler effort:S impact:med platform:windows type:bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
area:Analysis enhancement
难度 1/5 1-3 小时 新手友好度 69/100
facebookresearch/atlas-lean#5118 ·
维护者通常 1 天内回复
-
C-bugfix
难度 2/5 1-3 小时 新手友好度 82/100
Quantinuum/hugr#3354 ·
维护者通常 1 天内回复