+++ /dev/null
-#!/bin/sh
-
-QMKSPEC=$1
-VERBOSE=$2
-SRCDIR=$3
-OUTDIR=$4
-
-# debuggery
-[ "$VERBOSE" = "yes" ] && echo "Determining floating point word-order... ($*)"
-
-# build and run a test program
-test -d "$OUTDIR/config.tests/unix/doubleformat" || mkdir -p "$OUTDIR/config.tests/unix/doubleformat"
-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/config.tests/unix/doubleformat/doubleformattest.pro" -o "$OUTDIR/config.tests/unix/doubleformat/Makefile" >/dev/null 2>&1
-cd "$OUTDIR/config.tests/unix/doubleformat"
-
-DOUBLEFORMAT="UNKNOWN"
-[ "$VERBOSE" = "yes" ] && $MAKE || $MAKE >/dev/null 2>&1
-
-if [ -f ./doubleformattest ]; then
- : # nop
-else
- [ "$VERBOSE" = "yes" ] && echo "Unknown floating point format!"
- exit 2
-fi
-
-# LE: strings | grep 0123ABCD0123ABCD
-# BE: strings | grep DCBA3210DCBA3210
-#
-# LE arm-swapped-dword-order: strings | grep ABCD0123ABCD0123
-# BE arm-swapped-dword-order: strings | grep 3210DCBA3210DCBA (untested)
-
-
-if strings ./doubleformattest | grep "0123ABCD0123ABCD" >/dev/null 2>&1; then
- [ "$VERBOSE" = "yes" ] && echo " Normal little endian format"
- DOUBLEFORMAT="LITTLE"
-elif strings ./doubleformattest | grep "ABCD0123ABCD0123" >/dev/null 2>&1; then
- [ "$VERBOSE" = "yes" ] && echo " Swapped little endian format"
- DOUBLEFORMAT="LITTLESWAPPED"
-elif strings ./doubleformattest | grep "DCBA3210DCBA3210" >/dev/null 2>&1; then
- [ "$VERBOSE" = "yes" ] && echo " Normal big endian format"
- DOUBLEFORMAT="BIG"
-elif strings ./doubleformattest | grep "3210DCBA3210DCBA" >/dev/null 2>&1; then
- [ "$VERBOSE" = "yes" ] && echo " Swapped big endian format"
- DOUBLEFORMAT="BIGSWAPPED"
-fi
-
-# done
-if [ "$DOUBLEFORMAT" = "LITTLE" ]; then
- [ "$VERBOSE" = "yes" ] && echo "Using little endian."
- exit 10
-elif [ "$DOUBLEFORMAT" = "BIG" ]; then
- [ "$VERBOSE" = "yes" ] && echo "Using big endian."
- exit 11
-elif [ "$DOUBLEFORMAT" = "LITTLESWAPPED" ]; then
- [ "$VERBOSE" = "yes" ] && echo "Using swapped little endian."
- exit 12
-elif [ "$DOUBLEFORMAT" = "BIGSWAPPED" ]; then
- [ "$VERBOSE" = "yes" ] && echo "Using swapped big endian."
- exit 13
-else
- [ "$VERBOSE" = "yes" ] && echo "Unknown floating point format!"
- exit 99
-fi
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*
-
-LE: strings | grep 0123ABCD0123ABCD
-BE: strings | grep DCBA3210DCBA3210
-
-LE arm-swapped-dword-order: strings | grep ABCD0123ABCD0123
-BE arm-swapped-dword-order: strings | grep 3210DCBA3210DCBA (untested)
-
-tested on x86, arm-le (gp), aix
-
-*/
-
-#include <stdlib.h>
-
-// equals static char c [] = "0123ABCD0123ABCD\0\0\0\0\0\0\0"
-static double d [] = { 710524581542275055616.0, 710524581542275055616.0, 0.0 };
-
-int main(int argc, char **argv)
-{
- // make sure the linker doesn't throw away the arrays
- double *d2 = (double *) d;
- if (argc > 3)
- d[1] += 1;
- return d2[0] + d[2] + atof(argv[1]);
-}
+++ /dev/null
-SOURCES = doubleformattest.cpp
-CONFIG -= qt dylib
-mac:CONFIG -= app_bundle
CFG_ACCESSIBILITY=auto
CFG_ENDIAN=auto
CFG_HOST_ENDIAN=auto
-CFG_DOUBLEFORMAT=auto
-CFG_ARMFPA=auto
CFG_IWMMXT=no
CFG_NEON=auto
CFG_CLOCK_GETTIME=auto
VAL=no
;;
#Qt style yes options
- -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-wayland|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-declarative-debug|-javascript-jit|-rpath|-force-pkg-config|-icu|-force-asserts|-testcocoon)
+ -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-wayland|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-declarative-debug|-javascript-jit|-rpath|-force-pkg-config|-icu|-force-asserts|-testcocoon)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
VAL=yes
;;
UNKNOWN_OPT=yes
fi
;;
- armfpa)
- if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
- CFG_ARMFPA="$VAL"
- else
- UNKNOWN_OPT=yes
- fi
- ;;
opengl)
if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
[ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
[-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-gui]
[-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
[-no-sse3] [-no-ssse3] [-no-sse4.1] [-no-sse4.2] [-no-avx] [-no-neon]
- [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa]
+ [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info]
[-no-phonon-backend] [-phonon-backend] [-no-media-backend] [-media-backend]
[-no-audio-backend] [-audio-backend]
[-no-javascript-jit] [-javascript-jit] [-no-declarative-debug] [-declarative-debug]
-feature-<feature> .. Compile in <feature>. The available features
are described in src/corelib/global/qfeatures.txt
- -armfpa ............. Target platform uses the ARM-FPA floating point format.
- -no-armfpa .......... Target platform does not use the ARM-FPA floating point format.
-
- The floating point format is usually autodetected by configure. Use this
- to override the detected value.
-
-little-endian ...... Target platform is little endian (LSB first).
-big-endian ......... Target platform is big endian (MSB first).
fi
fi
-if [ "$CFG_ARMFPA" != "auto" ]; then
- if [ "$CFG_ARMFPA" = "yes" ]; then
- if [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
- CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
- else
- CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
- fi
- else
- CFG_DOUBLEFORMAT="normal"
- fi
-fi
-
-
-if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then
- if [ "$PLATFORM_QPA" = "yes" ]; then
- CFG_DOUBLEFORMAT=normal
- else
- "$unixtests/doubleformat.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
- F="$?"
- if [ "$F" -eq 10 ] && [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
- CFG_DOUBLEFORMAT=normal
- elif [ "$F" -eq 11 ] && [ "$CFG_ENDIAN" = "Q_BIG_ENDIAN" ]; then
- CFG_DOUBLEFORMAT=normal
- elif [ "$F" -eq 10 ]; then
- CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE"
- elif [ "$F" -eq 11 ]; then
- CFG_DOUBLEFORMAT="Q_DOUBLE_BIG"
- elif [ "$F" -eq 12 ]; then
- CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
- CFG_ARMFPA="yes"
- elif [ "$F" -eq 13 ]; then
- CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
- CFG_ARMFPA="yes"
- else
- echo
- echo "The system floating point format could not be detected."
- echo "This may cause data to be generated in a wrong format"
- echo "Turn on verbose messaging (-v) to see the final report."
- # we do not fail on this since this is a new test, and if it fails,
- # the old behavior should be correct in most cases
- CFG_DOUBLEFORMAT=normal
- fi
- fi
-fi
-
HAVE_STL=no
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
HAVE_STL=yes
fi
echo "#endif" >>"$outpath/src/corelib/global/qconfig.h.new"
-if [ "$CFG_DOUBLEFORMAT" != "normal" ]; then
- cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
-/* Non-IEEE double format */
-#define Q_DOUBLE_LITTLE "01234567"
-#define Q_DOUBLE_BIG "76543210"
-#define Q_DOUBLE_LITTLE_SWAPPED "45670123"
-#define Q_DOUBLE_BIG_SWAPPED "32107654"
-#define Q_DOUBLE_FORMAT $CFG_DOUBLEFORMAT
-EOF
-fi
-if [ "$CFG_ARMFPA" = "yes" ]; then
- if [ "$CFG_ARCH" != "$CFG_HOST_ARCH" ]; then
- cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
-#ifndef QT_BOOTSTRAPPED
-# define QT_ARMFPA
-#endif
-EOF
- else
- echo "#define QT_ARMFPA" >>"$outpath/src/corelib/global/qconfig.h.new"
- fi
-fi
-
CFG_ARCH_STR=`echo $CFG_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
CFG_HOST_ARCH_STR=`echo $CFG_HOST_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
static const union { unsigned char c[8]; double d; } qt_be_inf_bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
static const union { unsigned char c[8]; double d; } qt_le_inf_bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
-static const union { unsigned char c[8]; double d; } qt_armfpa_inf_bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } };
static inline double qt_inf()
{
-#ifdef QT_ARMFPA
- return qt_armfpa_inf_bytes.d;
-#else
return (QSysInfo::ByteOrder == QSysInfo::BigEndian
? qt_be_inf_bytes.d
: qt_le_inf_bytes.d);
-#endif
}
// Signaling NAN
static const union { unsigned char c[8]; double d; } qt_be_snan_bytes = { { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } };
static const union { unsigned char c[8]; double d; } qt_le_snan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } };
-static const union { unsigned char c[8]; double d; } qt_armfpa_snan_bytes = { { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 } };
static inline double qt_snan()
{
-#ifdef QT_ARMFPA
- return qt_armfpa_snan_bytes.d;
-#else
return (QSysInfo::ByteOrder == QSysInfo::BigEndian
? qt_be_snan_bytes.d
: qt_le_snan_bytes.d);
-#endif
}
// Quiet NAN
static const union { unsigned char c[8]; double d; } qt_be_qnan_bytes = { { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 } };
static const union { unsigned char c[8]; double d; } qt_le_qnan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0xff } };
-static const union { unsigned char c[8]; double d; } qt_armfpa_qnan_bytes = { { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 } };
static inline double qt_qnan()
{
-#ifdef QT_ARMFPA
- return qt_armfpa_qnan_bytes.d;
-#else
return (QSysInfo::ByteOrder == QSysInfo::BigEndian
? qt_be_qnan_bytes.d
: qt_le_qnan_bytes.d);
-#endif
}
#else // Q_CC_MIPS
static const unsigned char qt_be_inf_bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
static const unsigned char qt_le_inf_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
-static const unsigned char qt_armfpa_inf_bytes[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 };
static inline double qt_inf()
{
const unsigned char *bytes;
-#ifdef QT_ARMFPA
- bytes = qt_armfpa_inf_bytes;
-#else
bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian
? qt_be_inf_bytes
: qt_le_inf_bytes);
-#endif
union { unsigned char c[8]; double d; } returnValue;
qMemCopy(returnValue.c, bytes, sizeof(returnValue.c));
// Signaling NAN
static const unsigned char qt_be_snan_bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
static const unsigned char qt_le_snan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
-static const unsigned char qt_armfpa_snan_bytes[] = { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 };
static inline double qt_snan()
{
const unsigned char *bytes;
-#ifdef QT_ARMFPA
- bytes = qt_armfpa_snan_bytes;
-#else
bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian
? qt_be_snan_bytes
: qt_le_snan_bytes);
-#endif
union { unsigned char c[8]; double d; } returnValue;
qMemCopy(returnValue.c, bytes, sizeof(returnValue.c));
// Quiet NAN
static const unsigned char qt_be_qnan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 };
static const unsigned char qt_le_qnan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff };
-static const unsigned char qt_armfpa_qnan_bytes[] = { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 };
static inline double qt_qnan()
{
const unsigned char *bytes;
-#ifdef QT_ARMFPA
- bytes = qt_armfpa_qnan_bytes;
-#else
bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian
? qt_be_qnan_bytes
: qt_le_qnan_bytes);
-#endif
union { unsigned char c[8]; double d; } returnValue;
qMemCopy(returnValue.c, bytes, sizeof(returnValue.c));
static inline bool qt_is_inf(double d)
{
uchar *ch = (uchar *)&d;
-#ifdef QT_ARMFPA
- return (ch[3] & 0x7f) == 0x7f && ch[2] == 0xf0;
-#else
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
return (ch[0] & 0x7f) == 0x7f && ch[1] == 0xf0;
} else {
return (ch[7] & 0x7f) == 0x7f && ch[6] == 0xf0;
}
-#endif
}
static inline bool qt_is_nan(double d)
{
uchar *ch = (uchar *)&d;
-#ifdef QT_ARMFPA
- return (ch[3] & 0x7f) == 0x7f && ch[2] > 0xf0;
-#else
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
return (ch[0] & 0x7f) == 0x7f && ch[1] > 0xf0;
} else {
return (ch[7] & 0x7f) == 0x7f && ch[6] > 0xf0;
}
-#endif
}
static inline bool qt_is_finite(double d)
{
uchar *ch = (uchar *)&d;
-#ifdef QT_ARMFPA
- return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0xf0) != 0xf0;
-#else
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0xf0) != 0xf0;
} else {
return (ch[7] & 0x7f) != 0x7f || (ch[6] & 0xf0) != 0xf0;
}
-#endif
}
static inline bool qt_is_inf(float d)
return *this;
}
-#if defined(Q_DOUBLE_FORMAT)
-#define Q_DF(x) Q_DOUBLE_FORMAT[(x)] - '0'
-#endif
-
/*!
\overload
f = 0.0;
CHECK_STREAM_PRECOND(*this)
-#ifndef Q_DOUBLE_FORMAT
if (dev->read((char *)&f, 8) != 8) {
f = 0.0;
setStatus(ReadPastEnd);
f = x.val1;
}
}
-#else
- //non-standard floating point format
- union {
- double val1;
- char val2[8];
- } x;
- char *p = x.val2;
- char b[8];
- if (dev->read(b, 8) == 8) {
- if (noswap) {
- *p++ = b[Q_DF(0)];
- *p++ = b[Q_DF(1)];
- *p++ = b[Q_DF(2)];
- *p++ = b[Q_DF(3)];
- *p++ = b[Q_DF(4)];
- *p++ = b[Q_DF(5)];
- *p++ = b[Q_DF(6)];
- *p = b[Q_DF(7)];
- } else {
- *p++ = b[Q_DF(7)];
- *p++ = b[Q_DF(6)];
- *p++ = b[Q_DF(5)];
- *p++ = b[Q_DF(4)];
- *p++ = b[Q_DF(3)];
- *p++ = b[Q_DF(2)];
- *p++ = b[Q_DF(1)];
- *p = b[Q_DF(0)];
- }
- f = x.val1;
- } else {
- setStatus(ReadPastEnd);
- }
-#endif
return *this;
}
}
CHECK_STREAM_WRITE_PRECOND(*this)
-#ifndef Q_DOUBLE_FORMAT
if (noswap) {
if (dev->write((char *)&f, sizeof(double)) != sizeof(double))
q_status = WriteFailed;
if (dev->write((char *)&x.val2, sizeof(double)) != sizeof(double))
q_status = WriteFailed;
}
-#else
- union {
- double val1;
- char val2[8];
- } x;
- x.val1 = f;
- char *p = x.val2;
- char b[8];
- if (noswap) {
- b[Q_DF(0)] = *p++;
- b[Q_DF(1)] = *p++;
- b[Q_DF(2)] = *p++;
- b[Q_DF(3)] = *p++;
- b[Q_DF(4)] = *p++;
- b[Q_DF(5)] = *p++;
- b[Q_DF(6)] = *p++;
- b[Q_DF(7)] = *p;
- } else {
- b[Q_DF(7)] = *p++;
- b[Q_DF(6)] = *p++;
- b[Q_DF(5)] = *p++;
- b[Q_DF(4)] = *p++;
- b[Q_DF(3)] = *p++;
- b[Q_DF(2)] = *p++;
- b[Q_DF(1)] = *p++;
- b[Q_DF(0)] = *p;
- }
- if (dev->write(b, 8) != 8)
- q_status = WriteFailed;
-#endif
return *this;
}
#error Exactly one of IEEE_BIG_OR_LITTLE_ENDIAN, VAX, or IBM should be defined.
#endif
-static inline ULong _getWord0(const NEEDS_VOLATILE double x)
+static inline ULong getWord0(const NEEDS_VOLATILE double x)
{
const NEEDS_VOLATILE uchar *ptr = reinterpret_cast<const NEEDS_VOLATILE uchar *>(&x);
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
}
}
-static inline void _setWord0(NEEDS_VOLATILE double *x, ULong l)
+static inline void setWord0(NEEDS_VOLATILE double *x, ULong l)
{
NEEDS_VOLATILE uchar *ptr = reinterpret_cast<NEEDS_VOLATILE uchar *>(x);
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
}
}
-static inline ULong _getWord1(const NEEDS_VOLATILE double x)
+static inline ULong getWord1(const NEEDS_VOLATILE double x)
{
const NEEDS_VOLATILE uchar *ptr = reinterpret_cast<const NEEDS_VOLATILE uchar *>(&x);
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
return (ptr[3]<<24) + (ptr[2]<<16) + (ptr[1]<<8) + ptr[0];
}
}
-static inline void _setWord1(NEEDS_VOLATILE double *x, ULong l)
+static inline void setWord1(NEEDS_VOLATILE double *x, ULong l)
{
NEEDS_VOLATILE uchar *ptr = reinterpret_cast<uchar NEEDS_VOLATILE *>(x);
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
}
}
-static inline ULong getWord0(const NEEDS_VOLATILE double x)
-{
-#ifdef QT_ARMFPA
- return _getWord1(x);
-#else
- return _getWord0(x);
-#endif
-}
-
-static inline void setWord0(NEEDS_VOLATILE double *x, ULong l)
-{
-#ifdef QT_ARMFPA
- _setWord1(x, l);
-#else
- _setWord0(x, l);
-#endif
-}
-
-static inline ULong getWord1(const NEEDS_VOLATILE double x)
-{
-#ifdef QT_ARMFPA
- return _getWord0(x);
-#else
- return _getWord1(x);
-#endif
-}
-
-static inline void setWord1(NEEDS_VOLATILE double *x, ULong l)
-{
-#ifdef QT_ARMFPA
- _setWord0(x, l);
-#else
- _setWord1(x, l);
-#endif
-}
-
static inline void Storeinc(ULong *&a, const ULong &b, const ULong &c)
{
inline bool isZero(double d)
{
uchar *ch = (uchar *)&d;
-#ifdef QT_ARMFPA
- return !(ch[3] & 0x7F || ch[2] || ch[1] || ch[0] || ch[7] || ch[6] || ch[5] || ch[4]);
-#else
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
return !(ch[0] & 0x7F || ch[1] || ch[2] || ch[3] || ch[4] || ch[5] || ch[6] || ch[7]);
} else {
return !(ch[7] & 0x7F || ch[6] || ch[5] || ch[4] || ch[3] || ch[2] || ch[1] || ch[0]);
}
-#endif
}
// Removes thousand-group separators in "C" locale.
{
double negativeZero( 0.0 ); // Initialise to zero.
uchar *ptr = (uchar *)&negativeZero;
-#ifdef QT_ARMFPA
- ptr[3] = 0x80;
-#else
ptr[QSysInfo::ByteOrder == QSysInfo::BigEndian ? 0 : 7] = 0x80;
-#endif
QString s = QString::number(negativeZero);
QCOMPARE(s, QString("0"));
}
# error "Q_BYTE_ORDER not defined"
# endif
-# ifdef QT_ARMFPA
- buff[0] = data->bytes[4];
- buff[1] = data->bytes[5];
- buff[2] = data->bytes[6];
- buff[3] = data->bytes[7];
- buff[4] = data->bytes[0];
- buff[5] = data->bytes[1];
- buff[6] = data->bytes[2];
- buff[7] = data->bytes[3];
-# elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+# if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
for (uint i = 0; i < 8; ++i)
buff[i] = data->bytes[i];
# else
// the second member of the union
static const union { unsigned char c[8]; double d; } qt_be_inf_bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
static const union { unsigned char c[8]; double d; } qt_le_inf_bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
-static const union { unsigned char c[8]; double d; } qt_armfpa_inf_bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } };
static inline double qt_inf()
{
-#ifdef QT_ARMFPA
- return qt_armfpa_inf_bytes.d;
-#else
return (QSysInfo::ByteOrder == QSysInfo::BigEndian
? qt_be_inf_bytes.d
: qt_le_inf_bytes.d);
-#endif
}
#else
static const unsigned char qt_be_inf_bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
static const unsigned char qt_le_inf_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
-static const unsigned char qt_armfpa_inf_bytes[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 };
static inline double qt_inf()
{
const uchar *bytes;
-#ifdef QT_ARMFPA
- bytes = qt_armfpa_inf_bytes;
-#else
bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian
? qt_be_inf_bytes
: qt_le_inf_bytes);
-#endif
union { uchar c[8]; double d; } returnValue;
memcpy(returnValue.c, bytes, sizeof(returnValue.c));