extendkftf2-sw.c 1.9 KB

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