Implementations of libgcc-style polyfills for arithmetic. More...
Go to the source code of this file.
Data Structures | |
union | u32x2 |
Helper type for fussing with the upper and lower halves of an i64. More... | |
struct | u32x2.__unnamed5__ |
union | u32x2.__unnamed5__.__unnamed7__ |
Typedefs | |
typedef union u32x2 | u32x2_t |
Helper type for fussing with the upper and lower halves of an i64. More... | |
Functions | |
int64_t | _ot_builtin_lshift_i64 (int64_t val, int32_t shift) |
int64_t | _ot_builtin_rshift_i64 (int64_t val, int32_t shift) |
int64_t | _ot_builtin_ashift_i64 (int64_t val, int32_t shift) |
Implementations of libgcc-style polyfills for arithmetic.
This file has no header, since its functions should not be called directly; the compiler will generate calls into them as needed.
The functions have names like _ot_builtin_*
, rather than their libgcc names, so that they can coexist with libgcc/libcompiler-rt on the host-side for the purpose of unit tests. The linker aliases for the libgcc names only exist on the device-side.
See https://github.com/llvm/llvm-project/tree/main/compiler-rt/lib/builtins for a detailed specification of the ABI we implement in this file.
The provided functions here are:
Although the RISC-V B extension provides instructions for some ofthese, we currently do not require using a Clang that is aware of how to codegen them, so LLVM may choose to emit libgcc polyfill symbols (like the following) instead. Once we mandate such a Clang, they should be removed.
Definition in file math_builtins.c.
union u32x2 |
Helper type for fussing with the upper and lower halves of an i64.
This is necessary to avoid accidentally calling into the shift polyfills inside of their implementations.
Definition at line 41 of file math_builtins.c.
Data Fields | ||
---|---|---|
struct u32x2 | __unnamed__ | |
int64_t | full |
struct u32x2.__unnamed5__ |
Definition at line 42 of file math_builtins.c.
Data Fields | ||
---|---|---|
__unnamed5__ | __unnamed__ | |
uint32_t | lo |
union u32x2.__unnamed5__.__unnamed7__ |
Definition at line 44 of file math_builtins.c.
Data Fields | ||
---|---|---|
uint32_t | hi | |
int32_t | hi_signed |