(root)/
gcc-13.2.0/
libgcc/
config/
rs6000/
trunctfkf2-sw.c
       1  /* Software IEEE 128-bit floating-point emulation for PowerPC.
       2  
       3     Copyright (C) 2016-2023 Free Software Foundation, Inc.
       4     This file is part of the GNU C Library.
       5     Contributed by Michael Meissner (meissner@linux.vnet.ibm.com)
       6     Code is based on the main soft-fp library written by:
       7  	Richard Henderson (rth@cygnus.com) and
       8  	Jakub Jelinek (jj@ultra.linux.cz).
       9  
      10     The GNU C Library is free software; you can redistribute it and/or
      11     modify it under the terms of the GNU Lesser General Public
      12     License as published by the Free Software Foundation; either
      13     version 2.1 of the License, or (at your option) any later version.
      14  
      15     In addition to the permissions in the GNU Lesser General Public
      16     License, the Free Software Foundation gives you unlimited
      17     permission to link the compiled version of this file into
      18     combinations with other programs, and to distribute those
      19     combinations without any restriction coming from the use of this
      20     file.  (The Lesser General Public License restrictions do apply in
      21     other respects; for example, they cover modification of the file,
      22     and distribution when not linked into a combine executable.)
      23  
      24     The GNU C Library is distributed in the hope that it will be useful,
      25     but WITHOUT ANY WARRANTY; without even the implied warranty of
      26     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      27     Lesser General Public License for more details.
      28  
      29     You should have received a copy of the GNU Lesser General Public
      30     License along with the GNU C Library; if not, see
      31     <http://www.gnu.org/licenses/>.  */
      32  
      33  /* Convert IBM long double to IEEE 128-bit floating point.  */
      34  
      35  #ifdef __FLOAT128_HARDWARE__
      36  #error "This module must not be compiled with IEEE 128-bit hardware support"
      37  #endif
      38  
      39  #include "soft-fp.h"
      40  #include "quad-float128.h"
      41  
      42  #ifndef FLOAT128_HW_INSNS
      43  #define __trunctfkf2_sw __trunctfkf2
      44  #endif
      45  
      46  TFtype
      47  __trunctfkf2_sw (IBM128_TYPE value)
      48  {
      49    TFtype ret;
      50  
      51    CVT_IBM128_TO_FLOAT128 (ret, value);
      52    return ret;
      53  }