Skip to content

Is it possible to do a call "call i32 @llvm.wasm.tls.size.i32()" from an assembly .S file? #16475

@juj

Description

@juj

In LLVM we have the built-ins

https://github.com/llvm-mirror/clang/blob/aa231e4be75ac4759c236b755c57876f76e3cf05/test/CodeGen/builtins-wasm.c#L41-L51

I would like to call these built-ins directly from a WebAssembly asm .S file. However I am not sure what (if any?) the syntax would be. Trying something like

initialize_tls:
  .functype initialize_tls() -> ()

  .functype llvm.wasm.tls.size.i32 () -> (i32)
  call llvm.wasm.tls.size.i32

  end_function

does not work, but simply yields an undefined external function declaration. Trying some variations by replacing .s with _s does not give much help either.

Anyone knows if it would be possible to call these built-ins from a Wasm assembly .S file? The reason I need to do that is that I want to call out to get the TLS size (and alignment) before I have established a stack frame for the thread, so I cannot call in to C/C++ code to do that, because that would try to do stack pointer push/pop operations on a stack pointer that does not yet exist.

@sbc100 @tlively @dschuff ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions