Commit bef768149bb891a2bf959d610b3945eb4b54bc19
- Diff rendering mode:
- inline
- side by side
stlport/stl/_limits.c
(51 / 9)
|   | |||
| 292 | 292 | } | |
| 293 | 293 | template <class __dummy> | |
| 294 | 294 | float _STLP_CALL _LimG<__dummy>::get_F_qNaN() { | |
| 295 | typedef float_helper<float, 0x7f81u> _FloatHelper; | ||
| 295 | typedef float_helper<float, 0x7fc0u> _FloatHelper; | ||
| 296 | 296 | return _FloatHelper::get_from_last_word(); | |
| 297 | 297 | } | |
| 298 | 298 | template <class __dummy> | |
| 299 | 299 | float _STLP_CALL _LimG<__dummy>::get_F_sNaN() { | |
| 300 | typedef float_helper<float, 0x7fc1u> _FloatHelper; | ||
| 300 | typedef float_helper<float, 0x7fa0u> _FloatHelper; | ||
| 301 | 301 | return _FloatHelper::get_from_last_word(); | |
| 302 | 302 | } | |
| 303 | 303 | template <class __dummy> | |
| … | … | ||
| 317 | 317 | return _FloatHelper::get_from_last_word(); | |
| 318 | 318 | } | |
| 319 | 319 | static double get_qNaN() { | |
| 320 | typedef float_helper<double, 0x7ff1u> _FloatHelper; | ||
| 320 | typedef float_helper<double, 0x7ff8u> _FloatHelper; | ||
| 321 | 321 | return _FloatHelper::get_from_last_word(); | |
| 322 | 322 | } | |
| 323 | 323 | static double get_sNaN() { | |
| 324 | typedef float_helper<double, 0x7ff9u> _FloatHelper; | ||
| 324 | typedef float_helper<double, 0x7ff4u> _FloatHelper; | ||
| 325 | 325 | return _FloatHelper::get_from_last_word(); | |
| 326 | 326 | } | |
| 327 | 327 | }; | |
| … | … | ||
| 347 | 347 | public: | |
| 348 | 348 | static long double get_inf() { | |
| 349 | 349 | # if defined (_STLP_BIG_ENDIAN) | |
| 350 | typedef float_helper<long double, 0x7ff0u> _FloatHelper; | ||
| 350 | typedef float_helper<long double, 0x7fffu> _FloatHelper; | ||
| 351 | 351 | # else | |
| 352 | # if defined(__ia64__) || defined(__x86_64__) || defined(_M_IA64) || defined(_M_AMD64) | ||
| 352 | 353 | typedef float_helper2<long double, 0x8000u, 0x7fffu> _FloatHelper; | |
| 354 | # elif defined(__i386__) || defined(_M_IX86) | ||
| 355 | typedef float_helper2<long double, 0x8000u, 0x7fffu> _FloatHelper; | ||
| 356 | # else | ||
| 357 | typedef float_helper<long double, 0x7fffu> _FloatHelper; | ||
| 358 | # endif | ||
| 353 | 359 | # endif | |
| 354 | 360 | return _FloatHelper::get_from_last_word(); | |
| 355 | 361 | } | |
| 356 | 362 | static long double get_qNaN() { | |
| 363 | # if defined(__ia64__) || defined(__x86_64__) || defined(_M_IA64) || defined(_M_AMD64) | ||
| 364 | union _access | ||
| 365 | { | ||
| 366 | unsigned char b[sizeof(long double)]; | ||
| 367 | long double f; | ||
| 368 | }; | ||
| 369 | _access tmp = { _STLP_ADDITIONAL_OPEN_BRACKET 0, 0, 0, 0, 0, 0, 0, 0xc0, 0xff, 0x7f, 0, 0, 0, 0, 0, 0 _STLP_ADDITIONAL_CLOSE_BRACKET }; | ||
| 370 | return tmp.f; | ||
| 371 | # elif defined(__i386__) || defined(_M_IX86) | ||
| 372 | union _access | ||
| 373 | { | ||
| 374 | unsigned char b[sizeof(long double)]; | ||
| 375 | long double f; | ||
| 376 | }; | ||
| 377 | _access tmp = { _STLP_ADDITIONAL_OPEN_BRACKET 0, 0, 0, 0, 0, 0, 0, 0xc0, 0xff, 0x7f, 0, 0 _STLP_ADDITIONAL_CLOSE_BRACKET }; | ||
| 378 | return tmp.f; | ||
| 379 | # else | ||
| 357 | 380 | # if defined (_STLP_BIG_ENDIAN) | |
| 358 | typedef float_helper<long double, 0x7ff1u> _FloatHelper; | ||
| 381 | typedef float_helper2<long double, 0x8000u, 0x7fffu> _FloatHelper; | ||
| 359 | 382 | # else | |
| 360 | typedef float_helper2<long double, 0xc000u, 0x7fffu> _FloatHelper; | ||
| 383 | typedef float_helper2<long double, 0x8000u, 0x7fffu> _FloatHelper; | ||
| 361 | 384 | # endif | |
| 362 | 385 | return _FloatHelper::get_from_last_word(); | |
| 386 | # endif | ||
| 363 | 387 | } | |
| 364 | 388 | static long double get_sNaN() { | |
| 389 | # if defined(__ia64__) || defined(__x86_64__) || defined(_M_IA64) || defined(_M_AMD64) | ||
| 390 | union _access | ||
| 391 | { | ||
| 392 | unsigned char b[sizeof(long double)]; | ||
| 393 | long double f; | ||
| 394 | }; | ||
| 395 | _access tmp = { _STLP_ADDITIONAL_OPEN_BRACKET 0, 0, 0, 0, 0, 0, 0, 0xa0, 0xff, 0x7f, 0, 0, 0, 0, 0, 0 _STLP_ADDITIONAL_CLOSE_BRACKET }; | ||
| 396 | return tmp.f; | ||
| 397 | # elif defined(__i386__) || defined(_M_IX86) | ||
| 398 | union _access | ||
| 399 | { | ||
| 400 | unsigned char b[sizeof(long double)]; | ||
| 401 | long double f; | ||
| 402 | }; | ||
| 403 | _access tmp = { _STLP_ADDITIONAL_OPEN_BRACKET 0, 0, 0, 0, 0, 0, 0, 0xa0, 0xff, 0x7f, 0, 0 _STLP_ADDITIONAL_CLOSE_BRACKET }; | ||
| 404 | return tmp.f; | ||
| 405 | # else | ||
| 365 | 406 | # if defined (_STLP_BIG_ENDIAN) | |
| 366 | typedef float_helper<long double, 0x7ff9u> _FloatHelper; | ||
| 407 | typedef float_helper2<long double, 0x4000u, 0x7fffu> _FloatHelper; | ||
| 367 | 408 | # else | |
| 368 | typedef float_helper2<long double, 0x9000u, 0x7fffu> _FloatHelper; | ||
| 409 | typedef float_helper2<long double, 0x4000u, 0x7fffu> _FloatHelper; | ||
| 369 | 410 | # endif | |
| 370 | 411 | return _FloatHelper::get_from_last_word(); | |
| 412 | # endif | ||
| 371 | 413 | } | |
| 372 | 414 | }; | |
| 373 | 415 |

