[PATCH] D84602: [MSP430] Expose msp430_builtin calling convention to C code

Anatoly Trosinenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 6 10:29:00 PDT 2020


atrosinenko added a comment.

I suspect there might be some terminology clash, so clarifying a bit just in case.

It was probably better to refer to these functions as //LibCalls// - functions from the compiler support library (such as `libgcc`) such as `__adddf3`. While there are `__popcount[sdt]i2` among them, most of the times they are implicitly called when the high-level code performs division on `__uint128`, for example. Unfortunately, they reside under `compiler-rt/lib/builtins` - so that name was used... :) So, if I get it right, you have proposed something like `clang/include/clang/Basic/BuiltinsMips.def` and those are another kind of builtins.

The `CallingConv::MSP430_BUILTIN` was the name of a calling convention that the MSP430 codegen of LLVM had to use //for a small subset of those support functions//, as defined by MSP430 EABI. While it can be useful to add some other CC for those functions for internal use by compiler-rt someday, now there are only two CCs defined for MSP430 LibCalls: that "special convention" for 13 functions only with two 64-bit arguments (including 64-bit integer shifts) and the `CallingConv::C` for everything else both from the support library and regular object files.

Technically, these functions could probably be listed by names somewhere in the backend code, completely detangling the upstreaming of MSP430 compiler-rt port from D84602 <https://reviews.llvm.org/D84602> (this one), D84605 <https://reviews.llvm.org/D84605> and, the most scary of them, D84636 <https://reviews.llvm.org/D84636>. That may probably look a bit hackish, though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84602



More information about the cfe-commits mailing list