| 1 |
/* Automatic switching between software and hardware IEEE 128-bit |
| 2 |
ISA 3.1 floating-point emulation for PowerPC. |
| 3 |
|
| 4 |
Copyright (C) 2016-2025 Free Software Foundation, Inc. |
| 5 |
This file is part of the GNU C Library. |
| 6 |
Contributed by Carl Love ([email protected]) |
| 7 |
Code is based on the main soft-fp library written by: |
| 8 |
Richard Henderson ([email protected]) and |
| 9 |
Jakub Jelinek ([email protected]). |
| 10 |
|
| 11 |
The GNU C Library is free software; you can redistribute it and/or |
| 12 |
modify it under the terms of the GNU Lesser General Public |
| 13 |
License as published by the Free Software Foundation; either |
| 14 |
version 2.1 of the License, or (at your option) any later version. |
| 15 |
|
| 16 |
In addition to the permissions in the GNU Lesser General Public |
| 17 |
License, the Free Software Foundation gives you unlimited |
| 18 |
permission to link the compiled version of this file into |
| 19 |
combinations with other programs, and to distribute those |
| 20 |
combinations without any restriction coming from the use of this |
| 21 |
file. (The Lesser General Public License restrictions do apply in |
| 22 |
other respects; for example, they cover modification of the file, |
| 23 |
and distribution when not linked into a combine executable.) |
| 24 |
|
| 25 |
The GNU C Library is distributed in the hope that it will be useful, |
| 26 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 27 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 28 |
Lesser General Public License for more details. |
| 29 |
|
| 30 |
You should have received a copy of the GNU Lesser General Public |
| 31 |
License along with the GNU C Library; if not, see |
| 32 |
<http://www.gnu.org/licenses/>. */ |
| 33 |
|
| 34 |
/* Note, the hardware conversion instructions for 128-bit integers are |
| 35 |
supported for ISA 3.1 and later. Only compile this file with -mcpu=power10 |
| 36 |
or newer support. */ |
| 37 |
|
| 38 |
#include <soft-fp.h> |
| 39 |
#include <quad-float128.h> |
| 40 |
|
| 41 |
#ifndef __FLOAT128_HARDWARE__ |
| 42 |
#error "This module must be compiled with IEEE 128-bit hardware support" |
| 43 |
#endif |
| 44 |
|
| 45 |
#ifndef _ARCH_PWR10 |
| 46 |
#error "This module must be compiled for Power 10 support" |
| 47 |
#endif |
| 48 |
|
| 49 |
TFtype |
| 50 |
__floattikf_hw (TItype_ppc a) |
| 51 |
{ |
| 52 |
return (TFtype) a; |
| 53 |
} |
| 54 |
|
| 55 |
TFtype |
| 56 |
__floatuntikf_hw (UTItype_ppc a) |
| 57 |
{ |
| 58 |
return (TFtype) a; |
| 59 |
} |
| 60 |
|
| 61 |
TItype_ppc |
| 62 |
__fixkfti_hw (TFtype a) |
| 63 |
{ |
| 64 |
return (TItype_ppc) a; |
| 65 |
} |
| 66 |
|
| 67 |
UTItype_ppc |
| 68 |
__fixunskfti_hw (TFtype a) |
| 69 |
{ |
| 70 |
return (UTItype_ppc) a; |
| 71 |
} |