[PATCH] D154639: [WebAssembly] Add frexp{f,l} libcall signatures

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 13:05:19 PDT 2023


sbc100 added inline comments.


================
Comment at: llvm/test/CodeGen/WebAssembly/libcalls.ll:261
+; CHECK-NEXT:    call $push8=, ldexp, $pop19, $pop7
+; CHECK-NEXT:    call llvm.frexp.f64.i32, $pop20, $pop8
+; CHECK-NEXT:    local.get $push22=, 3
----------------
sbc100 wrote:
> dschuff wrote:
> > sbc100 wrote:
> > > How is `llvm.frexp.f64.i32` implemented?  Is it supposed to be the name of a function compiler-rt?   
> > it's a libm function, like the other functions in this test. IIRC some of the libcalls might be compiler-rt, I'm not sure LLVM differentiates. Also the list of intrinsics doesn't really differentiate between ones that lower directly to libcalls and ones that don't, because it depends on the architecture (e.g. if there are instructions that map directly or not). In this case wasm doesn't really have a direct equivalent for frexp.
> But how can libm implement a function called `llvm.frexp.f64.i32`.. wouldn't you need a name without periods in it if you want to be able to implement it in C?
The other callees here have names like `__powidf2`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154639/new/

https://reviews.llvm.org/D154639



More information about the llvm-commits mailing list