xref: /freebsd/contrib/llvm-project/compiler-rt/lib/builtins/subtf3.c (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
10b57cec5SDimitry Andric //===-- lib/subtf3.c - Quad-precision subtraction -----------------*- C -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
968d75effSDimitry Andric // This file implements quad-precision soft-float subtraction.
100b57cec5SDimitry Andric //
110b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric #define QUAD_PRECISION
140b57cec5SDimitry Andric #include "fp_lib.h"
150b57cec5SDimitry Andric 
16*06c3fb27SDimitry Andric #if defined(CRT_HAS_TF_MODE)
170b57cec5SDimitry Andric COMPILER_RT_ABI fp_t __addtf3(fp_t a, fp_t b);
180b57cec5SDimitry Andric 
190b57cec5SDimitry Andric // Subtraction; flip the sign bit of b and add.
__subtf3(fp_t a,fp_t b)200b57cec5SDimitry Andric COMPILER_RT_ABI fp_t __subtf3(fp_t a, fp_t b) {
210b57cec5SDimitry Andric   return __addtf3(a, fromRep(toRep(b) ^ signBit));
220b57cec5SDimitry Andric }
230b57cec5SDimitry Andric 
240b57cec5SDimitry Andric #endif
25