1 //===-- lib/subtf3.c - Quad-precision subtraction -----------------*- C -*-===//
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 // This file implements quad-precision soft-float subtraction with the
10 // IEEE-754 default rounding (to nearest, ties to even).
12 //===----------------------------------------------------------------------===//
14 #define QUAD_PRECISION
17 #if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
18 COMPILER_RT_ABI fp_t __addtf3(fp_t a, fp_t b);
20 // Subtraction; flip the sign bit of b and add.
21 COMPILER_RT_ABI fp_t __subtf3(fp_t a, fp_t b) {
22 return __addtf3(a, fromRep(toRep(b) ^ signBit));