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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libm/] [machine/] [i386/] [f_lrintl.c] - Blame information for rev 865

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/*
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
#ifdef __GNUC__
11
#if !defined(_SOFT_FLOAT)
12
 
13
#include <math.h>
14
 
15
/*
16
 * Fast math version of lrintl(x)
17
 * Return x rounded to integral value according to the prevailing
18
 * rounding mode.
19
 * Method:
20
 *      Using inline x87 asms.
21
 * Exception:
22
 *      Governed by x87 FPCR.
23
 */
24
 
25
long int _f_lrintl (long double x)
26
{
27
  long int _result;
28
  asm ("fistpl %0" : "=m" (_result) : "t" (x) : "st");
29
  return _result;
30
}
31
 
32
/* For now, there is only the fast math version so we use it.  */
33
long int lrintl (long double x) {
34
  return _f_lrintl(x);
35
}
36
 
37
#endif /* !_SOFT_FLOAT */
38
#endif /* __GNUC__ */

powered by: WebSVN 2.1.0

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