llvm / llvm/llvm-project

[MC][WebAssembly] Set table address type

Open
#172,907 1 comment 0 reactions 0 assignees View on GitHub
backend:WebAssembly
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

It is currently not possible to create `i64` tables through `llvm-mc` (AFAIK).
```gas
foo:
.tabletype foo, externref
```
always creates:
```wat
(table $foo 0 externref)
```
even when compiled with `wasm64`:
`llvm-mc --arch=wasm64 -mattr=+reference-types -filetype=obj test.s -o test.wasm`

This behavior seems to differ to inline assembly, where through additional target information, which can't be passed in the CLI, changes the default address type of tables to `i64`.

I'm not sure if we want to change anything about the default here, but I would propose simply adding another parameter to `.tabletype` accepting an address type. This would also allow the creation of `i32` address type tables in inline assembly even when targeting `wasm64-unknown-unknown`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.