On Wed, Dec 28, 2022 at 12:20 AM Mark Sibly <marksi...@gmail.com> wrote:
> Hi, > > I'm writing a little compiler that targets webassembly, but there are a > few things I don't quite understand that someone can hopefully help me with: > > * Is it true that wasm 'globals' are automatically 'thread local'? This > seems to be the general consensus after a few google searches, but there's > nothing in the w3 webassembly specs about it AFAICT. > Yes, this is how things work today, this is due to the fact that the only part of an instance that can be marked as "shared" is the memory. Nothing else about the instance (i.e the globals, the table, the function) can currently be marked as "shared". * The emscripten 'ABI' for passing/returning composite types like structs > seems to be to always 'pass by reference', ie: pass a single pointer to the > param/result value, is this correct? Is this ABI documented anywhere? > The C ABI is documented here: https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md > * Is it OK to use emscripten's __stack_pointer in my compiler output? > Anything I need to know about doing this beyond 'don't touch popped > memory'?!? > The linear stack is also documented here: See https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md#the-linear-stack You only need to follow those conventions if you want to link with other llvm-generated code of course. > Whew, that'll do for now! > > Bye, > Mark > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/461343cf-d0e3-4ef2-aa26-b09a33f8e30en%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/461343cf-d0e3-4ef2-aa26-b09a33f8e30en%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2-EC%3DWNzJzpXpVxCMFUroD6TdYc39wX0DWGMn8K1s3axA%40mail.gmail.com.