| 1 |
/* Software floating-point emulation, convert IEEE quad to 128bit unsigned |
| 2 |
integer. |
| 3 |
|
| 4 |
Copyright (C) 2016-2025 Free Software Foundation, Inc. |
| 5 |
This file is part of the GNU C Library. |
| 6 |
Contributed by Steven Munroe ([email protected]) |
| 7 |
Code is based on the main soft-fp library written by: |
| 8 |
Uros Bizjak ([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 |
#ifdef _ARCH_PPC64 |
| 34 |
#include "soft-fp.h" |
| 35 |
#include "quad-float128.h" |
| 36 |
|
| 37 |
UTItype |
| 38 |
__fixunskfti_sw (TFtype a) |
| 39 |
{ |
| 40 |
FP_DECL_EX; |
| 41 |
FP_DECL_Q (A); |
| 42 |
UTItype r; |
| 43 |
|
| 44 |
FP_INIT_EXCEPTIONS; |
| 45 |
FP_UNPACK_RAW_Q (A, a); |
| 46 |
FP_TO_INT_Q (r, A, TI_BITS, 0); |
| 47 |
FP_HANDLE_EXCEPTIONS; |
| 48 |
|
| 49 |
return r; |
| 50 |
} |
| 51 |
#endif |