Delete changes meant for a private branch.
[official-gcc.git] / libgcc / config / rs6000 / float128-decimal.c
blob31af26bf22da57872d932ba39a8d0e6ca95b08d8
1 /* Provide missing conversions between IEEE 128-bit floating point and Decimal
2 floating point for PowerPC.
4 Copyright (C) 2020 Free Software Foundation, Inc.
5 This file is part of the GNU C Library.
6 Contributed by Michael Meissner (meissner@linux.ibm.com)
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.
13 In addition to the permissions in the GNU Lesser General Public
14 License, the Free Software Foundation gives you unlimited
15 permission to link the compiled version of this file into
16 combinations with other programs, and to distribute those
17 combinations without any restriction coming from the use of this
18 file. (The Lesser General Public License restrictions do apply in
19 other respects; for example, they cover modification of the file,
20 and distribution when not linked into a combine executable.)
22 The GNU C Library is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 Lesser General Public License for more details.
27 You should have received a copy of the GNU Lesser General Public
28 License along with the GNU C Library; if not, see
29 <http://www.gnu.org/licenses/>. */
31 extern __float128 __dpd_trunctdkf (_Decimal128);
32 extern __float128 __dpd_truncddkf (_Decimal64);
33 extern __float128 __dpd_truncsdkf (_Decimal64);
34 extern _Decimal128 __dpd_extendkftd (__float128);
35 extern _Decimal64 __dpd_trunckfdd (__float128);
36 extern _Decimal32 __dpd_trunckfsd (__float128);
38 __float128
39 __dpd_trunctdkf (_Decimal128 x)
41 __ibm128 ibm = (__ibm128) x;
42 return (__float128) ibm;
45 __float128
46 __dpd_truncddkf (_Decimal64 x)
48 __ibm128 ibm = (__ibm128) x;
49 return (__float128) ibm;
52 __float128
53 __dpd_truncsdkf (_Decimal64 x)
55 __ibm128 ibm = (__ibm128) x;
56 return (__float128) ibm;
59 _Decimal128
60 __dpd_extendkftd (__float128 x)
62 __ibm128 ibm = (__ibm128) x;
63 return (_Decimal128) ibm;
66 _Decimal64
67 __dpd_trunckfdd (__float128 x)
69 __ibm128 ibm = (__ibm128) x;
70 return (_Decimal64) ibm;
73 _Decimal32
74 __dpd_trunckfsd (__float128 x)
76 __ibm128 ibm = (__ibm128) x;
77 return (_Decimal32) ibm;