ZHCUAU3J January 2018 – March 2024
运行时支持库包含许多汇编语言函数,为C/C++ 数学运算提供了 C7000 指令集不提供的算术例程,例如整数除法、整数求余数以及浮点运算。
这些例程遵循标准的 C/C++ 调用序列。编译器会在适用时自动添加这些例程;它们并非供您的程序直接调用。
lib/src
源目录中提供了这些函数的源代码。源代码中包含有用于描述函数运算的注释。您可以提取、检查和修改任何数学函数。不过,请务必遵循本章中概述的调用惯例和寄存器内容保存规则。表 6-3总结了用于算术运算的运行时支持函数。
返回类型 | C 函数 | 说明 |
---|---|---|
void | __c7xabi_abort_msg (const char *) | 报告断言失败。(请参阅以下注意事项。) |
double | __c7xabi_divd (double, double) | 将两个双精度浮点数相除。 |
float | __c7xabi_divf (float, float) | 将两个单精度浮点数相除。 |
long long | __c7xabi_divlli (long long, long long) | 64 位带符号整数除法。 |
unsigned long long | __c7xabi_divull (unsigned long long, unsigned long long) | 64 位无符号整数除法。 |
long long | __c7xabi_fixdlli (double) | 将双精度浮点型转换为 64 位整数型。 |
unsigned | __c7xabi_fixdu (double) | 将双精度浮点型转换为 32 位无符号整数型。 |
unsigned long long | __c7xabi_fixdull (double) | 将双精度浮点型转换为 64 位无符号整数型。 |
ong long | __c7xabi_fixflli (float) | 将单精度浮点型转换为 64 位整数型。 |
unsigned | __c7xabi_fixfu (float) | 将单精度浮点型转换为 32 位无符号整数型。 |
unsigned long long | __c7xabi_fixfull (float) | 将单精度浮点型转换为 64 位无符号整数型。 |
double | __c7xabi_fltllid (long long) | 将 64 位整数型转换为双精度浮点型。 |
float | __c7xabi_fltllif (long long) | 将 64 位整数型转换为单精度浮点型。 |
double | __c7xabi_fltulld (unsigned long long) | 将 64 位无符号整数型转换为双精度浮点型。 |
float | __c7xabi_fltullf (unsigned long long) | 将 64 位无符号整数型转换为单精度浮点型。 |
long long | __c7xabi_remlli (long long, long long) | 64 位整数取模。 |
unsigned long long | __c7xabi_remull (unsigned long long, unsigned long long) | 64 位无符号整数取模。 |
void | __c7xabi_strasg (int*, const int*, unsigned) | 块复制。(请参阅以下注意事项。) |
__c7xabi_unwind_cpp_pr0 | 短帧展开,16 位范围。 | |
__c7xabi_unwind_cpp_pr1 | 长帧展开,16 位范围。 | |
__c7xabi_unwind_cpp_pr2 | 长帧展开,32 位范围。 | |
__c7xabi_unwind_cpp_pr3 | 展开,24 位编码,16 位范围。 |
__c7xabi_abort_msg() 函数:
void __c7xabi_abort_msg(const char *msg)
生成该函数
__c7xabi_abort_msg()
是为了在运行时断言(例如 C 断言宏)失败时输出诊断信息。该函数不得返回。也就是说,该函数必须调用中止或通过其他方式终止程序。
__c7xabi_strasg() 函数:
void __c7xabi_strasg(int* dst, const int* src, unsigned cnt)
该函数
__c7xabi_strasg()
由编译器为高效行外结构或数组复制操作生成。
cnt
参数表示大小,单位为字节。