| 1 |
/* Software IEEE 128-bit floating-point emulation for PowerPC. |
| 2 |
|
| 3 |
Copyright (C) 2016-2025 Free Software Foundation, Inc. |
| 4 |
This file is part of the GNU C Library. |
| 5 |
Contributed by Michael Meissner ([email protected]) |
| 6 |
Code is based on the main soft-fp library written by: |
| 7 |
Richard Henderson ([email protected]) and |
| 8 |
Jakub Jelinek ([email protected]). |
| 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 IEEE 128-bit floating point to IBM long double. */ |
| 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 __extendkftf2_sw __extendkftf2 |
| 44 |
#endif |
| 45 |
|
| 46 |
IBM128_TYPE |
| 47 |
__extendkftf2_sw (TFtype value) |
| 48 |
{ |
| 49 |
IBM128_TYPE ret; |
| 50 |
|
| 51 |
CVT_FLOAT128_TO_IBM128 (ret, value); |
| 52 |
return ret; |
| 53 |
} |