Commit bef768149bb891a2bf959d610b3945eb4b54bc19

qNaN/sNaN fix for long double

Quick and dirty fix, based on normal code
in mainstream (491611c and 9b4a29b).

Note, that sNaN not work properly for long double
in 32-bit mode of x86, but fine in 64-bit mode.
See comments in commits 491611c and 9b4a29b.
  
292292}
293293template <class __dummy>
294294float _STLP_CALL _LimG<__dummy>::get_F_qNaN() {
295 typedef float_helper<float, 0x7f81u> _FloatHelper;
295 typedef float_helper<float, 0x7fc0u> _FloatHelper;
296296 return _FloatHelper::get_from_last_word();
297297}
298298template <class __dummy>
299299float _STLP_CALL _LimG<__dummy>::get_F_sNaN() {
300 typedef float_helper<float, 0x7fc1u> _FloatHelper;
300 typedef float_helper<float, 0x7fa0u> _FloatHelper;
301301 return _FloatHelper::get_from_last_word();
302302}
303303template <class __dummy>
317317 return _FloatHelper::get_from_last_word();
318318 }
319319 static double get_qNaN() {
320 typedef float_helper<double, 0x7ff1u> _FloatHelper;
320 typedef float_helper<double, 0x7ff8u> _FloatHelper;
321321 return _FloatHelper::get_from_last_word();
322322 }
323323 static double get_sNaN() {
324 typedef float_helper<double, 0x7ff9u> _FloatHelper;
324 typedef float_helper<double, 0x7ff4u> _FloatHelper;
325325 return _FloatHelper::get_from_last_word();
326326 }
327327};
347347public:
348348 static long double get_inf() {
349349# if defined (_STLP_BIG_ENDIAN)
350 typedef float_helper<long double, 0x7ff0u> _FloatHelper;
350 typedef float_helper<long double, 0x7fffu> _FloatHelper;
351351# else
352# if defined(__ia64__) || defined(__x86_64__) || defined(_M_IA64) || defined(_M_AMD64)
352353 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
353359# endif
354360 return _FloatHelper::get_from_last_word();
355361 }
356362 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
357380# if defined (_STLP_BIG_ENDIAN)
358 typedef float_helper<long double, 0x7ff1u> _FloatHelper;
381 typedef float_helper2<long double, 0x8000u, 0x7fffu> _FloatHelper;
359382# else
360 typedef float_helper2<long double, 0xc000u, 0x7fffu> _FloatHelper;
383 typedef float_helper2<long double, 0x8000u, 0x7fffu> _FloatHelper;
361384# endif
362385 return _FloatHelper::get_from_last_word();
386# endif
363387 }
364388 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
365406# if defined (_STLP_BIG_ENDIAN)
366 typedef float_helper<long double, 0x7ff9u> _FloatHelper;
407 typedef float_helper2<long double, 0x4000u, 0x7fffu> _FloatHelper;
367408# else
368 typedef float_helper2<long double, 0x9000u, 0x7fffu> _FloatHelper;
409 typedef float_helper2<long double, 0x4000u, 0x7fffu> _FloatHelper;
369410# endif
370411 return _FloatHelper::get_from_last_word();
412# endif
371413 }
372414};
373415