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
33 #if __ARM_ARCH_ISA_THUMB == 1
35 // NaN has been ruled out, so __aeabi_cfcmple can't trap
48 // NaN has been ruled out, so __aeabi_cfcmple can't trap
51 #if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
59 END_COMPILERRT_FUNCTION(__aeabi_cfcmpeq)
62 // void __aeabi_cfcmple(float a, float b) {
63 // if (__aeabi_fcmplt(a, b)) {
65 // } else if (__aeabi_fcmpeq(a, b)) {
74 DEFINE_COMPILERRT_FUNCTION(__aeabi_cfcmple)
75 // Per the RTABI, this function must preserve r0-r11.
76 // Save lr in the same instruction for compactness
81 #if __ARM_ARCH_ISA_THUMB == 1
111 moveq ip, #(APSR_C | APSR_Z)
115 #if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
123 END_COMPILERRT_FUNCTION(__aeabi_cfcmple)
125 // int __aeabi_cfrcmple(float a, float b) {
126 // return __aeabi_cfcmple(b, a);
131 DEFINE_COMPILERRT_FUNCTION(__aeabi_cfrcmple)
138 END_COMPILERRT_FUNCTION(__aeabi_cfrcmple)
140 NO_EXEC_STACK_DIRECTIVE