Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
783 bytes
|
Line | |
---|
1 | /* |
---|
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 llrintf(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 long int _f_llrintf (float x) |
---|
26 | { |
---|
27 | long long int _result; |
---|
28 | asm ("fistpll %0" : "=m" (_result) : "t" (x) : "st"); |
---|
29 | return _result; |
---|
30 | } |
---|
31 | |
---|
32 | #endif /* !_SOFT_FLOAT */ |
---|
33 | #endif /* __GNUC__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.