diff options
author | marha <marha@users.sourceforge.net> | 2012-07-02 08:51:35 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-07-02 08:51:35 +0200 |
commit | fcc2cc7dabb46c39a76351fc12da4e9ad9d1d817 (patch) | |
tree | bcc60a76e7cc205710b91c67ff700c26886ea3e8 /mesalib/src/gallium/auxiliary/util/u_format_tests.c | |
parent | 393178cdbca247c6ad077f7dab9a97d6817c625c (diff) | |
parent | fdef5bff99e6079f64bc6b91c91b42195c85adeb (diff) | |
download | vcxsrv-fcc2cc7dabb46c39a76351fc12da4e9ad9d1d817.tar.gz vcxsrv-fcc2cc7dabb46c39a76351fc12da4e9ad9d1d817.tar.bz2 vcxsrv-fcc2cc7dabb46c39a76351fc12da4e9ad9d1d817.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
pixman/pixman/pixman-sse2.c
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_format_tests.c')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_format_tests.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_format_tests.c b/mesalib/src/gallium/auxiliary/util/u_format_tests.c index fc29d8d48..457fda6c8 100644 --- a/mesalib/src/gallium/auxiliary/util/u_format_tests.c +++ b/mesalib/src/gallium/auxiliary/util/u_format_tests.c @@ -26,6 +26,9 @@ **************************************************************************/ +#include <float.h> + +#include "pipe/p_config.h" #include "u_memory.h" #include "u_format_tests.h" @@ -63,6 +66,9 @@ {{ 0, 0, 0, 0}, { 0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}} +#define NAN (0.0 / 0.0) +#define INF (1.0 / 0.0) + /** * Test cases. * @@ -876,7 +882,39 @@ util_format_test_cases[] = * Half float formats */ - {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x0000), UNPACKED_1x1( 0.0, 0.0, 0.0, 1.0)}, + /* Minimum positive normal */ + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x0400), UNPACKED_1x1( 6.10352E-5, 0.0, 0.0, 1.0)}, + + /* Max denormal */ + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x03FF), UNPACKED_1x1( 6.09756E-5, 0.0, 0.0, 1.0)}, + + /* Minimum positive denormal */ + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x0001), UNPACKED_1x1( 5.96046E-8, 0.0, 0.0, 1.0)}, + + /* Min representable value */ + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0xfbff), UNPACKED_1x1( -65504.0, 0.0, 0.0, 1.0)}, + + /* Max representable value */ + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7bff), UNPACKED_1x1( 65504.0, 0.0, 0.0, 1.0)}, + +#if !defined(PIPE_CC_MSVC) + + /* NaNs */ + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7c01), UNPACKED_1x1( NAN, 0.0, 0.0, 1.0)}, + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0xfc01), UNPACKED_1x1( -NAN, 0.0, 0.0, 1.0)}, + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7fff), UNPACKED_1x1( NAN, 0.0, 0.0, 1.0)}, + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0xffff), UNPACKED_1x1( -NAN, 0.0, 0.0, 1.0)}, + + /* Inf */ + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7c00), UNPACKED_1x1( INF, 0.0, 0.0, 1.0)}, + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0xfc00), UNPACKED_1x1( -INF, 0.0, 0.0, 1.0)}, + +#endif + + /* Zero, ignore sign */ + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0x7fff), PACKED_1x16(0x8000), UNPACKED_1x1( -0.0, 0.0, 0.0, 1.0)}, + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0x7fff), PACKED_1x16(0x0000), UNPACKED_1x1( 0.0, 0.0, 0.0, 1.0)}, + {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x3c00), UNPACKED_1x1( 1.0, 0.0, 0.0, 1.0)}, {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0xbc00), UNPACKED_1x1( -1.0, 0.0, 0.0, 1.0)}, |