Would WebAssembly support be desired for QBE? It would mean rewriting a
lot of "emit.c" and others, since WebAssembly is not assembled via GAS
or NASM but with WABT, which has an S-Expr-like format.
Quoth John Nunley <dev@notgull.net>:
> Would WebAssembly support be desired for QBE? It would mean rewriting a> lot of "emit.c" and others, since WebAssembly is not assembled via GAS> or NASM but with WABT, which has an S-Expr-like format.
It would involve a lot more than that, since wasm doesn't allow
arbitrary control flow graphs.
> It would involve a lot more than that, since wasm doesn't allow> arbitrary control flow graphs.
That's fair, I suppose. It's the kind of thing I haven't put much
thought into yet.
> It would involve a lot more than that, since wasm doesn't allow
arbitrary control flow graphs.
May I ask you to elaborate a bit more on this? Or, would you have any
references to read and better understand what you mean by that?
Do you see WASM intrinsically incompatible as a target with the premises
and/or the current architecture of QBE?
On 2024-12-05 02:26AM, Karurochari wrote:
>> It would involve a lot more than that, since wasm doesn't allow >>arbitrary control flow graphs.>May I ask you to elaborate a bit more on this? Or, would you have any >references to read and better understand what you mean by that?>Do you see WASM intrinsically incompatible as a target with the >premises and/or the current architecture of QBE?
This link has good overview of the limitations of WebAssembly's control
flow:
http://troubles.md/posts/why-do-we-need-the-relooper-algorithm-again/
I can't find the link now but there was some forum or mailing list
thread where LLVM devs said that supporting WASM was "500x more
difficult than any other architecture" without a shred of hyperbole.
Mostly because WASM demands restrictions that no IR would impose on
frontends so they have to map the looser requirements to the restricted
environment using complex algorithms (and yet, in the case of control
flow, Control Flow Graphs used by complex compilers still result in the
same correctness guarantees WASM is attempting to enforce but with
substantially more flexibility and optimization opportunities).
No clue the opinions of QBE in particular on it though.
~nytpu
--
Alex // nytpu
alex@nytpu.comhttps://nytpu.com/ - gemini://nytpu.com/ - gopher://nytpu.com/