Commit 63a654bb39bd6d154a535c535190b1f3a9d27699
1 parent
50d3eeae
trunc() for Solaris 9 / SPARC, by Juergen Keil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2508 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
0 deletions
fpu/softfloat-native.c
| @@ -221,6 +221,12 @@ float128 float64_to_float128( float64 a STATUS_PARAM) | @@ -221,6 +221,12 @@ float128 float64_to_float128( float64 a STATUS_PARAM) | ||
| 221 | /*---------------------------------------------------------------------------- | 221 | /*---------------------------------------------------------------------------- |
| 222 | | Software IEC/IEEE double-precision operations. | 222 | | Software IEC/IEEE double-precision operations. |
| 223 | *----------------------------------------------------------------------------*/ | 223 | *----------------------------------------------------------------------------*/ |
| 224 | +#if ( defined(__sun__) && ( HOST_SOLARIS < 10 )) | ||
| 225 | +static inline float64 trunc(float64 x) | ||
| 226 | +{ | ||
| 227 | + return x < 0 ? -floor(-x) : floor(x); | ||
| 228 | +} | ||
| 229 | +#endif | ||
| 224 | float64 float64_trunc_to_int( float64 a STATUS_PARAM ) | 230 | float64 float64_trunc_to_int( float64 a STATUS_PARAM ) |
| 225 | { | 231 | { |
| 226 | return trunc(a); | 232 | return trunc(a); |