OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-newlib/] [newlib-1.17.0/] [newlib/] [libm/] [machine/] [i386/] [f_rintf.c] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 jlechner
/*
2
 * ====================================================
3
 * x87 FP implementation contributed to Newlib by
4
 * Dave Korn, November 2007.  This file is placed in the
5
 * public domain.  Permission to use, copy, modify, and
6
 * distribute this software is freely granted.
7
 * ====================================================
8
 */
9
 
10
#if defined(__GNUC__) && !defined(_SOFT_FLOAT)
11
 
12
#include <math.h>
13
 
14
/*
15
 * Fast math version of rintf(x)
16
 * Return x rounded to integral value according to the prevailing
17
 * rounding mode.
18
 * Method:
19
 *      Using inline x87 asms.
20
 * Exception:
21
 *      Governed by x87 FPCR.
22
 */
23
 
24
float _f_rintf (float x)
25
{
26
  float _result;
27
  asm ("frndint" : "=t" (_result) : "0" (x));
28
  return _result;
29
}
30
 
31
#endif  /* !__GNUC__ || _SOFT_FLOAT */
32
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.