Run-Time-Support Arithmetic Routines

The run-time-support library contains a number of assembly language functions that provide arithmetic routines for C/C++ math operations that the C6000 instruction set does not provide, such as integer division, integer remainder, and floating-point operations.

These routines follow the standard C/C++ calling sequence. The compiler automatically adds these routines when appropriate; they are not intended to be called directly by your programs.

The source code for these functions is in the source library rts.src. The source code has comments that describe the operation of the functions. You can extract, inspect, and modify any of the math functions. Be sure, however, that you follow the calling conventions and register-saving rules outlined in this chapter. Table 8-9 summarizes the run-time-support functions used for arithmetic.

Table 8-9 Summary of Run-Time-Support Arithmetic Functions

Type Function Description
float __c6xabi_cvtdf (double) Convert double to float
int __c6xabi_fixdi (double) Convert double to signed integer
long __c6xabi_fixdi (double) Convert double to long
long long __c6xabi_fixdlli (double) Convert double to long long
uint __c6xabi_fixdlli (double) Convert double to unsigned integer
ulong __c6xabi_fixdul (double) Convert double to unsigned long
ulong long __c6xabi_fixdull (double) Convert double to unsigned long long
double __c6xabi_cvtfd (float) Convert float to double
int __c6xabi_fixfi (float) Convert float to signed integer
long __c6xabi_fixfli (float) Convert float to long
long long __c6xabi_fixflli (float) Convert float to long long
uint __c6xabi_fixfu (float) Convert float to unsigned integer
ulong __c6xabi_fixful (float) Convert float to unsigned long
ulong long __c6xabi_fixfull (float) Convert float to unsigned long long
double __c6xabi_fltid (int) Convert signed integer to double
float __c6xabi_fltif (int) Convert signed integer to float
double __c6xabi_fltud (uint) Convert unsigned integer to double
float __c6xabi_fltuf (uint) Convert unsigned integer to float
double __c6xabi_fltlid (long) Convert signed long to double
float __c6xabi_fltlif (long) Convert signed long to float
double __c6xabi_fltuld (ulong) Convert unsigned long to double
float __c6xabi_fltulf (ulong) Convert unsigned long to float
double __c6xabi_fltllid (long long) Convert signed long long to double
float __c6xabi_fltllif (long long) Convert signed long long to float
double __c6xabi_fltulld (ulong long) Convert unsigned long long to double
float __c6xabi_fltullf (ulong long) Convert unsigned long long to float
double __c6xabi_absd (double) Double absolute value
float __c6xabi_absf (float) Float absolute value
long __c6xabi_labs (long) Long absolute value
long long __c6xabi_llabs (long long) Long long absolute value
double __c6xabi_negd (double) Double negate value
float __c6xabi_negf (float) Float negate value
long long __c6xabi_negll (long) Long long negate value
long long __c6xabi_llshl (long long) Long long shift left
long long __c6xabi_llshr (long long) Long long shift right
ulong long __c6xabi_llshru (ulong long) Unsigned long long shift right
double __c6xabi_addd (double, double) Double addition
double __c6xabi_cmpd (double, double) Double comparison
double __c6xabi_divd (double, double) Double division
double __c6xabi_mpyd (double, double) Double multiplication
double __c6xabi_subd (double, double) Double subtraction
float __c6xabi_addf (float, float) Float addition
float __c6xabi_cmpf (float, float) Float comparison
float __c6xabi_divf (float, float) Float division
float __c6xabi_mpyf (float, float) Float multiplication
float __c6xabi_subf (float, float) Float subtraction
int __c6xabi_divi (int, int) Signed integer division
int __c6xabi_remi (int, int) Signed integer remainder
uint __c6xabi_divu (uint, uint) Unsigned integer division
uint __c6xabi_remu (uint, uint) Unsigned integer remainder
long __c6xabi_divli (long, long) Signed long division
long __c6xabi_remli (long, long) Signed long remainder
ulong __c6xabi_divul (ulong, ulong) Unsigned long division
ulong __c6xabi_remul (ulong, ulong) Unsigned long remainder
long long __c6xabi_divlii (long long, long long) Signed long long division
long long __c6xabi_remlli (long long, long long) Signed long long remainder
ulong long __c6xabi_mpyll (long long, long long) Unsigned long long multiplication
ulong long __c6xabi_divull (ulong long, ulong long) Unsigned long long division
ulong long __c6xabi_remull (ulong long, ulong long) Unsigned long long remainder