xref: /freebsd/contrib/llvm-project/compiler-rt/lib/builtins/subsf3.c (revision 02e9120893770924227138ba49df1edb3896112a)
1 //===-- lib/subsf3.c - Single-precision subtraction ---------------*- C -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements single-precision soft-float subtraction.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #define SINGLE_PRECISION
14 #include "fp_lib.h"
15 
16 // Subtraction; flip the sign bit of b and add.
17 COMPILER_RT_ABI fp_t __subsf3(fp_t a, fp_t b) {
18   return __addsf3(a, fromRep(toRep(b) ^ signBit));
19 }
20 
21 #if defined(__ARM_EABI__)
22 #if defined(COMPILER_RT_ARMHF_TARGET)
23 AEABI_RTABI fp_t __aeabi_fsub(fp_t a, fp_t b) { return __subsf3(a, b); }
24 #else
25 COMPILER_RT_ALIAS(__subsf3, __aeabi_fsub)
26 #endif
27 #endif
28