Home | History | Annotate | Line # | Download | only in builtins
      1  1.1  joerg //===-- lib/adddf3.c - Double-precision subtraction ---------------*- C -*-===//
      2  1.1  joerg //
      3  1.1  joerg //                     The LLVM Compiler Infrastructure
      4  1.1  joerg //
      5  1.1  joerg // This file is dual licensed under the MIT and the University of Illinois Open
      6  1.1  joerg // Source Licenses. See LICENSE.TXT for details.
      7  1.1  joerg //
      8  1.1  joerg //===----------------------------------------------------------------------===//
      9  1.1  joerg //
     10  1.1  joerg // This file implements double-precision soft-float subtraction with the
     11  1.1  joerg // IEEE-754 default rounding (to nearest, ties to even).
     12  1.1  joerg //
     13  1.1  joerg //===----------------------------------------------------------------------===//
     14  1.1  joerg 
     15  1.1  joerg #define DOUBLE_PRECISION
     16  1.1  joerg #include "fp_lib.h"
     17  1.1  joerg 
     18  1.1  joerg // Subtraction; flip the sign bit of b and add.
     19  1.1  joerg COMPILER_RT_ABI fp_t
     20  1.1  joerg __subdf3(fp_t a, fp_t b) {
     21  1.1  joerg     return __adddf3(a, fromRep(toRep(b) ^ signBit));
     22  1.1  joerg }
     23  1.1  joerg 
     24  1.2    rin #if defined(__ARM_EABI__)
     25  1.3    rin #if defined(COMPILER_RT_ARMHF_TARGET)
     26  1.2    rin AEABI_RTABI fp_t __aeabi_dsub(fp_t a, fp_t b) {
     27  1.2    rin   return __subdf3(a, b);
     28  1.2    rin }
     29  1.3    rin #else
     30  1.3    rin AEABI_RTABI fp_t __aeabi_dsub(fp_t a, fp_t b) COMPILER_RT_ALIAS(__subdf3);
     31  1.3    rin #endif
     32  1.2    rin #endif
     33