1 | /* roundevenf() - S390 version. |
2 | Copyright (C) 2019-2024 Free Software Foundation, Inc. |
3 | |
4 | This file is part of the GNU C Library. |
5 | |
6 | The GNU C Library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Lesser General Public License as |
8 | published by the Free Software Foundation; either version 2.1 of the |
9 | License, or (at your option) any later version. |
10 | |
11 | The GNU C Library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Lesser General Public License for more details. |
15 | |
16 | You should have received a copy of the GNU Lesser General Public |
17 | License along with the GNU C Library; if not, see |
18 | <https://www.gnu.org/licenses/>. */ |
19 | |
20 | #ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT |
21 | # define NO_MATH_REDIRECT |
22 | # include <math.h> |
23 | # include <libm-alias-float.h> |
24 | |
25 | float |
26 | __roundevenf (float x) |
27 | { |
28 | float y; |
29 | /* The z196 zarch "load fp integer" (fiebra) instruction is rounding |
30 | x to the nearest integer with "ties to even" rounding mode |
31 | (M3-field: 4) where inexact exceptions are suppressed (M4-field: 4). */ |
32 | __asm__ ("fiebra %0,4,%1,4" : "=f" (y) : "f" (x)); |
33 | return y; |
34 | } |
35 | libm_alias_float (__roundeven, roundeven) |
36 | |
37 | #else |
38 | # include <sysdeps/ieee754/flt-32/s_roundevenf.c> |
39 | #endif |
40 | |