1 //===-- aeabi_cfcmp.S - EABI cfcmp* implementation ------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "../assembly.h"
12 #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
13 #error big endian support not implemented
16 #define APSR_Z (1 << 30)
17 #define APSR_C (1 << 29)
19 // void __aeabi_cfcmpeq(float a, float b) {
20 // if (isnan(a) || isnan(b)) {
23 // __aeabi_cfcmple(a, b);
29 DEFINE_COMPILERRT_FUNCTION(__aeabi_cfcmpeq)
31 bl __aeabi_cfcmpeq_check_nan
35 // NaN has been ruled out, so __aeabi_cfcmple can't trap
40 END_COMPILERRT_FUNCTION(__aeabi_cfcmpeq)
43 // void __aeabi_cfcmple(float a, float b) {
44 // if (__aeabi_fcmplt(a, b)) {
46 // } else if (__aeabi_fcmpeq(a, b)) {
55 DEFINE_COMPILERRT_FUNCTION(__aeabi_cfcmple)
56 // Per the RTABI, this function must preserve r0-r11.
57 // Save lr in the same instruction for compactness
68 moveq ip, #(APSR_C | APSR_Z)
75 END_COMPILERRT_FUNCTION(__aeabi_cfcmple)
77 // int __aeabi_cfrcmple(float a, float b) {
78 // return __aeabi_cfcmple(b, a);
83 DEFINE_COMPILERRT_FUNCTION(__aeabi_cfrcmple)
90 END_COMPILERRT_FUNCTION(__aeabi_cfrcmple)
92 NO_EXEC_STACK_DIRECTIVE