subdf3.c revision 353358
1276789Sdim//===-- lib/adddf3.c - Double-precision subtraction ---------------*- C -*-===// 2276789Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6276789Sdim// 7276789Sdim//===----------------------------------------------------------------------===// 8276789Sdim// 9276789Sdim// This file implements double-precision soft-float subtraction with the 10276789Sdim// IEEE-754 default rounding (to nearest, ties to even). 11276789Sdim// 12276789Sdim//===----------------------------------------------------------------------===// 13276789Sdim 14276789Sdim#define DOUBLE_PRECISION 15276789Sdim#include "fp_lib.h" 16276789Sdim 17276789Sdim// Subtraction; flip the sign bit of b and add. 18353358SdimCOMPILER_RT_ABI fp_t __subdf3(fp_t a, fp_t b) { 19353358Sdim return __adddf3(a, fromRep(toRep(b) ^ signBit)); 20276789Sdim} 21276789Sdim 22321369Sdim#if defined(__ARM_EABI__) 23327952Sdim#if defined(COMPILER_RT_ARMHF_TARGET) 24353358SdimAEABI_RTABI fp_t __aeabi_dsub(fp_t a, fp_t b) { return __subdf3(a, b); } 25327952Sdim#else 26353358SdimCOMPILER_RT_ALIAS(__subdf3, __aeabi_dsub) 27321369Sdim#endif 28327952Sdim#endif 29