1 //===-- aeabi_dcmp.S - EABI dcmp* implementation ---------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "../assembly.h"
11 // int __aeabi_dcmp{eq,lt,le,ge,gt}(double a, double b) {
12 // int result = __{eq,lt,le,ge,gt}df2(a, b);
13 // if (result {==,<,<=,>=,>} 0) {
20 #if defined(COMPILER_RT_ARMHF_TARGET)
21 # define CONVERT_DCMP_ARGS_TO_DF2_ARGS \
22 vmov d0, r0, r1 SEPARATOR \
25 # define CONVERT_DCMP_ARGS_TO_DF2_ARGS
28 #define DEFINE_AEABI_DCMP(cond) \
29 .syntax unified SEPARATOR \
30 .p2align 2 SEPARATOR \
31 DEFINE_COMPILERRT_FUNCTION(__aeabi_dcmp ## cond) \
32 push { r4, lr } SEPARATOR \
33 CONVERT_DCMP_ARGS_TO_DF2_ARGS SEPARATOR \
34 bl SYMBOL_NAME(__ ## cond ## df2) SEPARATOR \
35 cmp r0, #0 SEPARATOR \
36 b ## cond 1f SEPARATOR \
37 movs r0, #0 SEPARATOR \
38 pop { r4, pc } SEPARATOR \
40 movs r0, #1 SEPARATOR \
41 pop { r4, pc } SEPARATOR \
42 END_COMPILERRT_FUNCTION(__aeabi_dcmp ## cond)
50 NO_EXEC_STACK_DIRECTIVE