Tracking issue for compiler_rt ARM compatibility
Context and Purpose
Based on https://gist.github.com/harieamjari/61aa4420ae4ded5e86f5143e46d93573 by user @harieamjari the list of ARM run-time functions to double-check
The official documentation is found here https://github.com/ARM-software/abi-aa/releases and the runtime abi (Q32022) here: https://github.com/ARM-software/abi-aa/blob/2982a9f3b512a5bfdc9e3fea5d3b298f9165c36b/rtabi32/rtabi32.rst
Preparation for audit of compiler_rt in #1504. see also https://embeddedartistry.com/blog/2017/10/11/demystifying-arm-floating-point-compiler-options/
List of Routines
The functions declared here is based on the document, number,
* "ARM IHI 0043D, current through ABI release 2.09", which
* defines the run-time helper-function ABI for programs written
* in ARM-Thumb assembly language, C, and C++.
/* Standard double precision floating-point arithmetic helper functions */
- [x] extern double __aeabi_dadd(double, double);
- [x] extern double __aeabi_ddiv(double n, double d);
- [x] extern double __aeabi_dmul(double, double);
- [ ] extern double __aeabi_drsub(double x, double y);
- [x] extern double __aeabi_dsub(double x, double y);
/* double precision floating-point comparison helper functions */
- [ ] extern void __aeabi_cdcmpeq(double, double);
- [ ] extern void __aeabi_cdcmple(double, double);
- [ ] extern void __aeabi_cdrcmple(double, double);
- [x] extern int __aeabi_dcmpeq(double, double);
- [x] extern int __aeabi_dcmplt(double, double);
- [x] extern int __aeabi_dcmple(double, double);
- [ ] extern int __aeabi_dcmpge(double, double); TODO README
- [ ] extern int __aeabi_dcmpgt(double, double); TODO README
- [x] extern int __aeabi_dcmpun(double, double);
/* Standard single precision floating-point arithmetic helper functions */
- [x] extern float __aeabi_fadd(float, float);
- [x] extern float __aeabi_fdiv(float n, float d);
- [ ] extern float __aeabi_fmul(float, float); TODO README
- [ ] extern float __aeabi_frsub(float x, float y);
- [x] extern float __aeabi_fsub(float x, float y);
/* Standard single precision floating-point comparison helper functions */
- [ ] extern void __aeabi_cfcmpeq(float, float);
- [ ] extern void __aeabi_cfcmple(float, float);
- [ ] extern void __aeabi_cfrcmple(float, float);
- [x] extern int __aeabi_fcmpeq(float, float);
- [x] extern int __aeabi_fcmplt(float, float);
- [x] extern int __aeabi_fcmple(float, float);
- [ ] extern int __aeabi_fcmpge(float, float); TODO README
- [ ] extern int __aeabi_fcmpgt(float, float); TODO README
- [x] extern int __aeabi_fcmpun(float, float);
/* Standard floating-point to integer conversions */
- [ ] extern int __aeabi_d2iz(double); TODO README
- [ ] extern unsigned __aeabi_d2uiz(double); TODO README
- [ ] extern long long __aeabi_d2lz(double); TODO README
- [ ] extern unsigned long long __aeabi_d2ulz(double); TODO README
- [ ] extern int __aeabi_f2iz(float); TODO README
- [ ] extern unsigned __aeabi_f2uiz(float); TODO README
- [ ] extern long long __aeabi_f2lz(float); TODO README
- [ ] extern unsigned long long __aeabi_f2ulz(float); TODO README
/* Standard conversions between floating types */
- [x] extern float __aeabi_d2f(double);
- [ ] extern double __aeabi_f2d(float); TODO README
- [ ] extern float __aeabi_h2f(short hf); TODO README
- [ ] extern float __aeabi_h2f_alt(short hf);
- [x] extern short __aeabi_f2h(float f);
- [ ] extern short __aeabi_f2h_alt(float f);
- [x] extern short __aeabi_d2h(double);
- [ ] extern short __aeabi_d2h_alt(double);
/* Standard integer to floating-point conversions */
- [ ] extern double __aeabi_i2d(int); TODO README
- [ ] extern double __aeabi_ui2d(unsigned); TODO README
- [ ] extern double __aeabi_l2d(long long); TODO README
- [ ] extern double __aeabi_ul2d(unsigned long long); TODO README
- [ ] extern float __aeabi_i2f(int); TODO README
- [ ] extern float __aeabi_ui2f(unsigned); TODO README
- [ ] extern float __aeabi_l2f(long long); TODO README
- [ ] extern float __aeabi_ul2f(unsigned long long); TODO README
/* Long long functions */
- [ ] extern long long __aeabi_lmul(long long, long long); TODO README
- [ ] extern lldiv_t __aeabi_ldivmod(long long n, long long d); TODO README /* ulldiv_t might be unsupported */
- [ ] extern ulldiv_t __aeabi_uldivmod(unsigned long long n, unsigned long long d); TODO README
- [x] extern long long __aeabi_llsl(long long, int);
- [x] extern long long __aeabi_llsr(long long, int);
- [ ] extern int __aeabi_lcmp(long long, long long);
- [ ] extern int __aeabi_ulcmp(unsigned long long, unsigned long long);
/* Integer (32/32 -> 32) division functions */
- [x] extern int __aeabi_idiv(int numerator, int denominator);
- [x] extern unsigned __aeabi_uidiv(unsigned numerator, unsigned denominator); typedef struct { int quot; int rem; } idiv_return; typedef struct { unsigned quot; unsigned rem; } uidiv_return;
- [ ] extern idiv_return __aeabi_idivmod(int numerator, int denominator); TODO README
- [ ] extern uidiv_return __aeabi_uidivmod(unsigned numerator, unsigned denominator); TODO README
/* Division by zero */
- [ ] extern int __aeabi_idiv0(int return_value);
- [ ] extern long long __aeabi_ldiv0(long long return_value);
/* Unaligned memory access */
- [ ] extern int __aeabi_uread4(void *address);
- [ ] extern int __aeabi_uwrite4(int value, void *address);
- [ ] extern long long __aeabi_uread8(void *address);
- [ ] extern long long __aeabi_uwrite8(long long value, void *address);
/* Memory copying */
- [x] extern void __aeabi_memcpy8(void *dest, const void *src, size_t n);
- [x] extern void __aeabi_memcpy4(void *dest, const void *src, size_t n);
- [x] extern void __aeabi_memcpy(void *dest, const void *src, size_t n);
- [x] extern void __aeabi_memmove8(void *dest, const void *src, size_t n);
- [x] extern void __aeabi_memmove4(void *dest, const void *src, size_t n);
- [x] extern void __aeabi_memmove(void *dest, const void *src, size_t n);
/* Memory clearing and setting */
- [x] extern void __aeabi_memset8(void *dest, size_t n, int c);
- [x] extern void __aeabi_memset4(void *dest, size_t n, int c);
- [x] extern void __aeabi_memset(void *dest, size_t n, int c);
- [x] extern void __aeabi_memclr8(void *dest, size_t n);
- [x] extern void __aeabi_memclr4(void *dest, size_t n);
- [x] extern void __aeabi_memclr(void *dest, size_t n);