]>
Commit | Line | Data |
---|---|---|
fe13a20c | 1 | /* llround function. POWER8 PowerPC64 version. |
04277e02 | 2 | Copyright (C) 2014-2019 Free Software Foundation, Inc. |
fe13a20c AZ |
3 | This file is part of the GNU C Library. |
4 | ||
5 | The GNU C Library is free software; you can redistribute it and/or | |
6 | modify it under the terms of the GNU Lesser General Public | |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
9 | ||
10 | The GNU C Library is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | Lesser General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU Lesser General Public | |
16 | License along with the GNU C Library; if not, see | |
17 | <http://www.gnu.org/licenses/>. */ | |
18 | ||
19 | #include <sysdep.h> | |
757d9dd5 | 20 | #include <endian.h> |
fe13a20c | 21 | #include <math_ldbl_opt.h> |
216933b2 | 22 | #include <libm-alias-float.h> |
d17542d2 | 23 | #include <libm-alias-double.h> |
fe13a20c | 24 | |
7110166d | 25 | #define MFVSRD_R3_V1 .long 0x7c230066 /* mfvsrd r3,vs1 */ |
fe13a20c AZ |
26 | |
27 | /* long long [r3] llround (float x [fp1]) */ | |
28 | ||
d5b41185 | 29 | ENTRY_TOCLESS (__llround) |
fe13a20c AZ |
30 | CALL_MCOUNT 0 |
31 | frin fp1,fp1 /* Round to nearest +-0.5. */ | |
32 | fctidz fp1,fp1 /* Convert To Integer DW round toward 0. */ | |
33 | MFVSRD_R3_V1 | |
34 | blr | |
35 | END (__llround) | |
36 | ||
37 | strong_alias (__llround, __lround) | |
d17542d2 JM |
38 | libm_alias_double (__llround, llround) |
39 | libm_alias_double (__lround, lround) | |
001b09a6 RS |
40 | /* The double version also works for single-precision as both float and |
41 | double parameters are passed in 64bit FPRs and both versions are expected | |
42 | to return [long] long type. */ | |
43 | strong_alias (__llround, __llroundf) | |
216933b2 | 44 | libm_alias_float (__llround, llround) |
001b09a6 | 45 | strong_alias (__lround, __lroundf) |
216933b2 | 46 | libm_alias_float (__lround, lround) |