added updated version of simdmathlibrary-1.0.1

This commit is contained in:
ejcoumans
2007-07-27 18:53:58 +00:00
parent fddd6c5721
commit f360dd27d6
377 changed files with 9928 additions and 6136 deletions

View File

@@ -44,7 +44,7 @@ TESTS = fabsd2 fabsf4 truncf4 divf4 recipd2 divd2 sqrtf4 \
ALL_TESTS = $(TESTS)
INCLUDES_SPU = -I../../
INCLUDES_SPU = -I../../common
CROSS_SPU = spu-
AR_SPU = $(CROSS_SPU)ar
@@ -52,7 +52,7 @@ CC_SPU = $(CROSS_SPU)gcc
CXX_SPU = $(CROSS_SPU)g++
TEST_CMD_SPU =
CFLAGS_SPU=$(INCLUDES_SPU) -O2 -W -Wall
CFLAGS_SPU=$(INCLUDES_SPU) -O2 -W -Wall
LDFLAGS_SPU=-L../ -l$(LIB_BASE) -lm
MAKE_DEFS = \
@@ -99,21 +99,8 @@ check: $(ALL_TESTS)
../$(STATIC_LIB):
cd ../;$(MAKE) $(MAKE_DEFS) $(STATIC_LIB)
%.o: %.c
%.o: %.c ../../common/common-test.h testutils.h
$(CC_SPU) $(CFLAGS_SPU) -c $<
#----------
# C++
#----------
%.o: %.C
$(CXX_SPU) $(CFLAGS_SPU) -c $<
%.o: %.cpp
$(CXX_SPU) $(CFLAGS_SPU) -c $<
%.o: %.cc
$(CXX_SPU) $(CFLAGS_SPU) -c $<
%.o: %.cxx
$(CXX_SPU) $(CFLAGS_SPU) -c $<

View File

@@ -1,201 +0,0 @@
/* SIMD math library - common testsuite part for SPU
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
static inline unsigned int clock()
{
unsigned int ret;
int tmp = 0;
__asm __volatile__ ( "syscall %0,%1,0x2b\n"
: "=r" (ret)
: "r" (tmp)
: "memory" );
return (ret);
}
// Test files begin with TEST_SET_START("your initials","test set description")
// Individual tests begin with TEST_START("name of test")
// and end with TEST_PASS(), TEST_FAIL("reason for failure") or TEST_CHECK(<test to evaluate>)
// Or you can run a test encapsulated in a function with:
// TEST_FUNCTION("name of test", function(), "reason for failure")
//
// The clock starts when you call TEST_START and stops with TEST_PASS, TEST_FAIL or TEST_CHECK
// After a start there can be several PASS, FAIL or CHECK calls, each one counts as a test, time is measured from the prior call
//
char
*__initials, // Test owner's initials
*__description, // short descriptive name for this test set
*__name, // name of the currently running test
*__set_id; // id of the the test set
int
// __zip=0,
__success=1, // set to 0 if any tests failed
__count, // Total number of tests run
__passed; // Total number of tests passed
unsigned int
__ttemp,
__time, // For timing tests (usually start time of last test)
__ttime; // Cumulative test runtime NOT counting runtime of the TEST macros
// TEST_SET_START
// Call at the start of a set of related tests to identify them
// Prints a "start of set banner message"
// set_id - unique test set identifyer a time in the format yyyymmddhhmmss followed by your initials ie: 20040716104615GAC
// initials - your initials
// description - brief descriptive name for this test set
#define TEST_SET_START(set_id,initials,description) \
do { \
__set_id=set_id; \
__initials=initials; \
__description=description; \
__count=0; \
__passed=0; \
__time=0; \
__ttime=0; \
printf("0\t%s\t%d\t%s\tSTART\tpassed\ttotal\ttime\t%s\tunique test id \t%s\n",__FILE__,__LINE__,__initials,__set_id, __description); \
} while(0)
// TEST_START
// Begins a test, and starts the clock
// name - brief name for this test
#define TEST_START(name) \
do { \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__time) : "r" (0) : "memory" ); \
__name=name; \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__time) : "r" (0) : "memory" ); \
} while(0)
// TEST_PASS
// Indicates the test passed
// test_id - unique test ID number, same format as the set_id number
// This should match the id provided to the matching TEST_FAIL call
#define TEST_PASS(test_id) \
do { \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__ttemp) : "r" (0) : "memory" ); \
__time=__ttemp-__time; \
__ttime+=__time; \
__count++; \
__passed++; \
printf("1\t%s\t%d\t%s\tPASS\t%d\t%d\t%d\t%s\t%s\t%s\n",__FILE__,__LINE__,__initials,__passed,__count,__time,__set_id,test_id,__name); \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__time) : "r" (0) : "memory" ); \
} while(0)
// __time=clock();
// __asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__time) : "r" (__zip) : "memory" );
// __asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__ttemp) : "r" (__zip) : "memory" );
// TEST_FAIL
// Indicates the test failed
// test_id - unique test ID number, same format as the set_id number
// This should match the id provided to the matching TEST_PASS call
// why - brief description of why it failed
#define TEST_FAIL(test_id,why,error_code) \
do { \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__ttemp) : "r" (0) : "memory" ); \
__time=__ttemp-__time; \
__ttime+=__time; \
__count++; \
__success=0; \
printf("1\t%s\t%d\t%s\tFAIL\t%d\t%d\t%d\t%s\t%s\t%s\tFAILED BECAUSE: %s\t%d\n",__FILE__,__LINE__,__initials,__passed,__count,__time,__set_id,test_id,__name,why,error_code); \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__time) : "r" (0) : "memory" ); \
} while(0)
// TEST_CHECK
// Passes or fails the test after evaluating the "test" argument (just like assert but without terminating the program)
// The clock is immediately stopped so the time required to evaluate "test" will NOT be included in the reported time
// If the test failed, the reason will be printed as FAILED BECAUSE: check (value of "test") failed
// test_id - unique test ID number, same format as the set_id number
// test - expression evaluating to true/false
#define TEST_CHECK(test_id,test,error_code) \
do { \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__ttemp) : "r" (0) : "memory" ); \
__time=__ttemp-__time; \
__ttime+=__time; \
__count++; \
if(test) \
{ \
__passed++; \
printf("1\t%s\t%d\t%s\tPASS\t%d\t%d\t%d\t%s\t%s\t%s\n",__FILE__,__LINE__,__initials,__passed,__count,__time,__set_id,test_id,__name); \
} \
else \
{ \
__success=0; \
printf("1\t%s\t%d\t%s\tFAIL\t%d\t%d\t%d\t%s\t%s\t%s\tFAILED BECAUSE: check %s failed\t%d\n",__FILE__,__LINE__,__initials,__passed,__count,__time,__set_id,test_id,__name,#test,error_code); \
} \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__time) : "r" (0) : "memory" ); \
} while(0)
// TEST_FUNCTION
// Runs a test encapsulated in a function that returns 0 if the test passed and an error number if it failed
// The clock is started on calling the function and stopped as soon as it returns so the branching logic will not be included in the time
// test_id - unique test ID number, same format as the set_id number
// name - brief name for the test
// func - function invocation (should include parenthesis, may have arguments)
// why - brief description to print if the test fails
#define TEST_FUNCTION(test_id,name,func,why) \
do { \
TEST_START(name); \
int result=func; \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__ttemp) : "r" (0) : "memory" ); \
__time=__ttemp-__time; \
__ttime+=__time; \
__count++; \
if(result==0) \
{ \
__passed++; \
printf("1\t%s\t%d\t%s\tPASS\t%d\t%d\t%d\t%s\t%s\t%s\n",__FILE__,__LINE__,__initials,__passed,__count,__time,__set_id,test_id,__name); \
} \
else \
{ \
__success=0; \
printf("1\t%s\t%d\t%s\tFAIL\t%d\t%d\t%d\t%s\t%s\t%s\tFAILED BECAUSE: %s\t%d\n",__FILE__,__LINE__,__initials,__passed,__count,__time,__set_id,test_id,__name,why,result); \
} \
__asm __volatile__ ( "syscall %0,%1,0x2b\n" : "=r" (__time) : "r" (0) : "memory" ); \
} while(0)
// TEST_SET_DONE
// Ends a set of tests, prints out the closing banner (OK if all tests pass, PROBLEM if any fail)
// Also prints count of tests passed, tests run and total time
#define TEST_SET_DONE() \
do { \
printf("9\t%s\t%d\t%s\t%s\t%d\t%d\t%d\t%s\tunique test id \t%s\n",__FILE__,__LINE__,__initials,(__count==__passed)?"OK":"PROBLEM",__passed,__count,__ttime,__set_id,__description); \
} while(0)
// TEST_EXIT
// Call this ONCE at the very end of the test program, it calls "exit" to return
// EXIT_SUCCESS if all tests passed or EXIT_FAILURE if any tests failed.
// This allows the makefile/shell script running the tests to know which ones failed
#define TEST_EXIT() \
do { \
if(__success) \
exit(0); \
else \
exit(-1); \
} while (0)

View File

@@ -59,13 +59,13 @@ int main()
unsigned long long i8d = 0x61f25e39867b0a9eull;
unsigned long long i8r = 0x1403088aa08482f2ull;
double x0n = hide_double(-1.0/0.0); // -Inf/ Inf == NaN
double x0d = hide_double(1.0/0.0);
double x0n = hide_double(-HUGE_VAL); // -Inf/ Inf == NaN
double x0d = hide_double(HUGE_VAL);
double x1n = hide_double(0.0); // 0 / 0 == NaN
double x1d = hide_double(-0.0);
double x2n = hide_double(0.0/0.0); // NaN / 2 == NaN
double x2n = hide_double(nan("")); // NaN / 2 == NaN
double x2d = hide_double(2.0);
double x3n = hide_double(make_double(i3n));

View File

@@ -46,8 +46,8 @@ int main()
double x1p = hide_double(83532.96153153);
double x2n = hide_double(-0.0000000013152);
double x2p = hide_double(0.0000000013152);
double x3n = hide_double(-1.0/0.0);
double x3p = hide_double(1.0/0.0);
double x3n = hide_double(-HUGE_VAL);
double x3p = hide_double(HUGE_VAL);
vec_double2 x0n_v = spu_splats(x0n);
vec_double2 x0p_v = spu_splats(x0p);

View File

@@ -76,16 +76,16 @@ int main()
double x5min = hide_double(5.0e-324);
double x5max = hide_double(1.0e-323);
double x5dim = hide_double(1.0e-323 - 5.0e-324);
double x5dim = hide_double(1.0e-323) - hide_double(5.0e-324);
double x6min = hide_double(DBL_MAX);
double x6max = hide_double(1.0/0.0);
double x6max = hide_double(HUGE_VAL);
double x7min = hide_double(-1.0/0.0);
double x7min = hide_double(-HUGE_VAL);
double x7max = hide_double(19355.03);
double x8min = hide_double(-1.0/0.0);
double x8max = hide_double(1.0/0.0);
double x8min = hide_double(-HUGE_VAL);
double x8max = hide_double(HUGE_VAL);
vec_double2 x0min_v = spu_splats(x0min);
vec_double2 x0max_v = spu_splats(x0max);

View File

@@ -1,173 +0,0 @@
/* Common part of testsuite for SPU SIMD Math library
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _FLOATINGPOINT_TESTS_H_
#define _FLOATINGPOINT_TESTS_H_
#if __PPC__
#include <altivec.h>
#define vec_uchar16 vector unsigned char
#define vec_char16 vector signed char
#define vec_ushort8 vector unsigned short
#define vec_short8 vector signed short
#define vec_uint4 vector unsigned int
#define vec_int4 vector signed int
#define vec_ullong2 vector unsigned long long
#define vec_llong2 vector signed long long
#define vec_float4 vector float
#define vec_double2 vector double
#else
#if __SPU__
#include <spu_intrinsics.h>
#endif
#endif
// To avoid type punning warnings (for printing in hex notation, doing bit-diff etc)
typedef union {
double d;
unsigned char uc[8];
unsigned int ui[2];
unsigned long long int ull;
} sce_math_alt_double;
typedef union {
float f;
unsigned char uc[4];
unsigned int ui;
} sce_math_alt_float;
#if (__PPC__ || __SPU__)
typedef union {
vec_int4 vsi;
int si[4];
} sce_math_alt_vec_int4;
typedef union {
vec_uint4 vui;
int ui[4];
} sce_math_alt_vec_uint4;
typedef union {
vec_float4 vf;
float sf[4];
unsigned int ui[4];
} sce_math_alt_vec_float4;
#endif
#if __SPU__
typedef union {
double sd[2];
vec_double2 vd;
unsigned long long int ui[2];
} sce_math_alt_vec_double2;
#endif
#if __PPC__
static inline vec_int4 bitdiff4(vec_float4 ref, vec_float4 vals) {
vec_int4 refi = (vec_int4)ref;
vec_int4 valsi = (vec_int4)vals;
vec_int4 diff = vec_sub(refi, valsi);
vec_int4 negdiff = vec_sub(((vec_int4)0), diff);
return vec_sel(negdiff, diff, vec_cmpgt(diff, ((vec_int4)0) ));
}
static inline int bitdiff(float ref, float val) {
sce_math_alt_float aref, aval;
aref.f = ref;
aval.f = val;
int diff = aref.ui - aval.ui;
return (diff>0)?diff:-diff;
}
static inline vec_int4 bitmatch4(vec_float4 ref, vec_float4 vals) {
vec_int4 refi = (vec_int4)ref;
vec_int4 valsi = (vec_int4)vals;
vec_int4 diff = vec_sub(refi, valsi);
vec_int4 negdiff = vec_sub(((vec_int4)0), diff);
diff = vec_sel(negdiff, diff, vec_cmpgt(diff, ((vec_int4)0) ));
vec_float4 logdiff = vec_loge(vec_ctf(diff,0));
return vec_sub(((vec_int4)32), vec_cts(vec_ceil(logdiff),0));
}
static inline int bitmatch(float ref, float val) {
sce_math_alt_vec_float4 aref, aval;
sce_math_alt_vec_int4 adiff;
aref.sf[0] = ref;
aval.sf[0] = val;
adiff.vsi = bitmatch4(aref.vf, aval.vf);
return adiff.si[0];
}
#else
#if __SPU__
static inline vec_int4 bitdiff4(vec_float4 ref, vec_float4 vals) {
vec_int4 refi = (vec_int4)ref;
vec_int4 valsi = (vec_int4)vals;
vec_int4 diff = spu_sub(refi, valsi);
vec_int4 negdiff = spu_sub(spu_splats((int)0), diff);
return spu_sel(negdiff, diff, (vec_uchar16)spu_cmpgt(diff, 0));
}
static inline int bitdiff(float ref, float val) {
return spu_extract(bitdiff4(spu_promote(ref,0), spu_promote(val,0)), 0);
}
static inline vec_int4 bitmatch4(vec_float4 ref, vec_float4 vals) {
vec_int4 refi = (vec_int4)ref;
vec_int4 valsi = (vec_int4)vals;
vec_int4 diff = spu_sub(refi, valsi);
vec_int4 negdiff = spu_sub(spu_splats((int)0), diff);
return (vec_int4)spu_cntlz(spu_sel(negdiff, diff, (vec_uchar16)spu_cmpgt(diff, 0)));
}
static inline int bitmatch(float ref, float val) {
return spu_extract(bitmatch4(spu_promote(ref,0), spu_promote(val,0)), 0);
}
#else
inline int bitdiff(sce_math_alt_float ref, sce_math_alt_float val) {
int diff = ref.ui - val.ui;
return((diff>0)?diff:-diff);
}
inline int bitmatch(sce_math_alt_float ref, sce_math_alt_float val) {
int diff, i;
unsigned int udiff;
diff = ref.ui - val.ui;
udiff = (diff>0) ? diff : -diff;
i = 32;
while(udiff != 0) {
i = i-1;
udiff = udiff >> 1;
}
return udiff;
}
#endif // __SPU__
#endif // __PPC__
#endif // _FLOATINGPOINT_TESTS_H_

View File

@@ -76,7 +76,7 @@ int main()
double z2 = hide_double(-0.0);
double x3 = hide_double(1.0);
double y3 = hide_double(1.0/0.0);
double y3 = hide_double(HUGE_VAL);
double z3 = hide_double(-1.0);
double x4 = norm_max;

View File

@@ -81,13 +81,13 @@ int main()
double x5max = hide_double(1.0e-323);
double x6min = norm_max;
double x6max = hide_double(1.0/0.0);
double x6max = hide_double(HUGE_VAL);
double x7min = hide_double(-1.0/0.0);
double x7min = hide_double(-HUGE_VAL);
double x7max = hide_double(19355.03);
double x8min = hide_double(-1.0/0.0);
double x8max = hide_double(1.0/0.0);
double x8min = hide_double(-HUGE_VAL);
double x8max = hide_double(HUGE_VAL);
double x9min = denorm_max;
double x9max = norm_min;

View File

@@ -45,7 +45,7 @@ int main()
long long r0 = FP_NAN;
// -Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
long long r1 = FP_INFINITE;
// -Dmax
@@ -97,7 +97,7 @@ int main()
long long r13 = FP_NORMAL;
// +Inf
double x14 = hide_double( 1.0/0.0);
double x14 = hide_double(HUGE_VAL);
long long r14 = FP_INFINITE;
//+Nan
@@ -117,11 +117,11 @@ int main()
vec_llong2 r18_v = (vec_llong2) {FP_NAN, FP_NORMAL};
// Compound
vec_double2 x19_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 x19_v = (vec_double2) {HUGE_VAL, -nan("") };
vec_llong2 r19_v = (vec_llong2) {FP_INFINITE, FP_NAN};
// Compound
vec_double2 x20_v = (vec_double2) { -1.0e-999, -1.0/0.0} ;
vec_double2 x20_v = (vec_double2) { -1.0e-999, -HUGE_VAL} ;
vec_llong2 r20_v = (vec_llong2) {FP_ZERO, FP_INFINITE};
vec_double2 x0_v = spu_splats(x0);

View File

@@ -40,11 +40,11 @@ int main()
TEST_SET_START("20060828000000AAN","AAN", "fpclassifyf4");
// -Nan
float x0 = hide_float(-nan(""));
float x0 = hide_float(-NANF);
int r0 = FP_NORMAL;
// -Inf
float x1 = hide_float(-1.0/0.0);
float x1 = hide_float(-HUGE_VALF);
int r1 = FP_NORMAL;
// -Smax
@@ -96,11 +96,11 @@ int main()
int r13 = FP_NORMAL;
// +Inf
float x14 = hide_float( 1.0/0.0);
float x14 = hide_float(HUGE_VALF);
int r14 = FP_NORMAL;
//+Nan
float x15 = hide_float( nan(""));
float x15 = hide_float(NANF);
int r15 = FP_NORMAL;
// Compound

View File

@@ -36,14 +36,6 @@
#include "common-test.h"
#include "testutils.h"
#ifndef DBL_INF
#define DBL_INF ((long long)0x7FF0000000000000ull)
#endif
#ifndef DBL_NAN
#define DBL_NAN ((long long)0x7FF8000000000000ull)
#endif
int main()
{
TEST_SET_START("20060907000000AAN","AAN", "frexpd2");
@@ -57,7 +49,7 @@ int main()
//long long e0 = 0;
// -Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
double r1 = x1;
//long long e1 = 0;
@@ -172,7 +164,7 @@ int main()
long long e23 = 1024;
// +Inf
double x24 = hide_double( 1.0/0.0 );
double x24 = hide_double(HUGE_VAL);
double r24 = x24;
//long long e24 = 0;
@@ -199,14 +191,14 @@ int main()
// Compound
vec_llong2 keep29_v = exp_v;
vec_double2 x29_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 r29_v = (vec_double2) { 1.0/0.0, nan("") };
vec_double2 x29_v = (vec_double2) { HUGE_VAL, -nan("") };
vec_double2 r29_v = (vec_double2) { HUGE_VAL, nan("") };
vec_llong2 e29_v = (vec_llong2) { spu_extract(exp_v, 0), spu_extract(exp_v, 1) };
// Compound
vec_llong2 keep30_v = exp_v;
vec_double2 x30_v = (vec_double2) { -1.2e-99, -1.0/0.0 } ;
vec_double2 r30_v = (vec_double2) { hide_double(make_double(0xBFE4FF632B6A83E4ull)), -1.0/0.0 };
vec_double2 x30_v = (vec_double2) { -1.2e-99, -HUGE_VAL } ;
vec_double2 r30_v = (vec_double2) { hide_double(make_double(0xBFE4FF632B6A83E4ull)), -HUGE_VAL };
vec_llong2 e30_v = (vec_llong2) { -328, spu_extract(exp_v, 1) };
vec_llong2 keep0_v = exp_v;

View File

@@ -47,7 +47,7 @@ int main()
int e0 = 129;
// -Norm (IEEE-754: -Inf)
float x1 = hide_float(-1.0/0.0);
float x1 = hide_float(-HUGE_VALF);
float r1 = hide_float(make_float(0xBF7FFFFF));
int e1 = 129;
@@ -162,7 +162,7 @@ int main()
int e23 = 129;
//+Norm (IEEE-754: +Inf)
float x24 = hide_float( 1.0/0.0);
float x24 = hide_float(HUGE_VALF);
float r24 = hide_float(make_float(0x3F7FFFFF));
int e24 = 129;
@@ -187,12 +187,12 @@ int main()
vec_int4 e28_v = (vec_int4) { 129, 20, 0, 22 };
// Compound
vec_float4 x29_v = (vec_float4) { 1.0/0.0, 1.0e-99, -5.53856231e-27, make_float(0xFFC00000) };
vec_float4 x29_v = (vec_float4) { HUGE_VALF, 1.0e-99, -5.53856231e-27, make_float(0xFFC00000) };
vec_float4 r29_v = (vec_float4) { make_float(0x3F7FFFFF), 0.0, make_float(0xBF5B67B2), make_float(0xBF400000) };
vec_int4 e29_v = (vec_int4) { 129, 0, -87, 129 };
// Compound
vec_float4 x30_v = (vec_float4) { 1.2e-57, -1.2e-19, 3.045784e-18, -1.0/0.0 } ;
vec_float4 x30_v = (vec_float4) { 1.2e-57, -1.2e-19, 3.045784e-18, -HUGE_VALF } ;
vec_float4 r30_v = (vec_float4) { 0.0, make_float(0xBF0DABC6 ), make_float(0x3F60BD3C), make_float(0xBF7FFFFF) };
vec_int4 e30_v = (vec_int4) { 0, -62, -58, 129 };

View File

@@ -54,7 +54,7 @@ int main()
double r1 = hide_double( nan(""));
//-Inf, -QNaN
double x2 = hide_double(-1.0/0.0);
double x2 = hide_double(-HUGE_VAL);
double y2 = hide_double(make_double(0xFFFFFFFFFFFFFFFFull));
double r2 = hide_double( nan(""));
@@ -70,13 +70,13 @@ int main()
//-Norm, -Inf
double x5 = hide_double(-168.97345223013);
double y5 = hide_double(-1.0/0.0);
double r5 = hide_double( 1.0/0.0);
double y5 = hide_double(-HUGE_VAL);
double r5 = hide_double(HUGE_VAL);
//+Inf, -Inf
double x6 = hide_double( 1.0/0.0);
double y6 = hide_double(-1.0/0.0);
double r6 = hide_double( 1.0/0.0);
double x6 = hide_double(HUGE_VAL);
double y6 = hide_double(-HUGE_VAL);
double r6 = hide_double(HUGE_VAL);
//-Norm, -0
double x7 = hide_double(-168.97345223013);
@@ -159,9 +159,9 @@ int main()
double r22 = hide_double(468729.8610289);
//+Inf, +Ovf
double x23 = hide_double( 1.0/0.0);
double y23 = hide_double( 1.0e999);
double r23 = hide_double( 1.0/0.0);
double x23 = hide_double(HUGE_VAL);
double y23 = hide_double(1.0e999);
double r23 = hide_double(HUGE_VAL);
//+Norm, +QNaN
double x24 = hide_double(264.345643345);
@@ -169,7 +169,7 @@ int main()
double r24 = hide_double( nan(""));
//+Inf, +QNaN
double x25 = hide_double( 1.0/0.0);
double x25 = hide_double(HUGE_VAL);
double y25 = hide_double(nan(""));
double r25 = hide_double(nan(""));

View File

@@ -30,19 +30,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
#ifndef FP_ILOGB0
#define FP_ILOGB0 ((int)0x80000001)
#endif
#ifndef FP_ILOGBNAN
#define FP_ILOGBNAN ((int)0x7FFFFFFF)
#endif
int main()
{
TEST_SET_START("20060904000000AAN","AAN", "ilogbd2");
@@ -52,7 +46,7 @@ int main()
long long r0 = (long long)FP_ILOGBNAN;
// -Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
long long r1 = (long long)FP_ILOGB0;
// -Dmax
@@ -144,7 +138,7 @@ int main()
long long r23 = 1023ll;
// +Inf
double x24 = hide_double( 1.0/0.0);
double x24 = hide_double(HUGE_VAL);
long long r24 = (long long)FP_ILOGB0;
//+Nan
@@ -164,11 +158,11 @@ int main()
vec_llong2 r28_v = (vec_llong2) { FP_ILOGBNAN, 21ll };
// Compound
vec_double2 x29_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 x29_v = (vec_double2) { HUGE_VAL, -nan("") };
vec_llong2 r29_v = (vec_llong2) { FP_ILOGB0, FP_ILOGBNAN };
// Compound
vec_double2 x30_v = (vec_double2) { -1.2e-99, -1.0/0.0 } ;
vec_double2 x30_v = (vec_double2) { -1.2e-99, -HUGE_VAL } ;
vec_llong2 r30_v = (vec_llong2) { -329ll, FP_ILOGB0 };
vec_double2 x0_v = spu_splats(x0);

View File

@@ -31,16 +31,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
#ifndef FP_ILOGB0
#define FP_ILOGB0 ((int)0x80000001)
#endif
int main()
{
TEST_SET_START("20060904000000AAN","AAN", "ilogbf4");
@@ -50,7 +47,7 @@ int main()
int r0 = 128;
// -Norm (IEEE-754: -Inf)
float x1 = hide_float(-1.0/0.0);
float x1 = hide_float(-HUGE_VALF);
int r1 = 128;
// -Smax
@@ -142,7 +139,7 @@ int main()
int r23 = 128;
//+Norm (IEEE-754: +Inf)
float x24 = hide_float( 1.0/0.0);
float x24 = hide_float( HUGE_VALF);
int r24 = 128;
//+Norm (IEEE-754: +Nan)
@@ -162,11 +159,11 @@ int main()
vec_int4 r28_v = (vec_int4) { 128, 19, FP_ILOGB0, 21 };
// Compound
vec_float4 x29_v = (vec_float4) { 1.0/0.0, 1.0e-99, -5.53856231e-27, make_float(0xFFC00000) };
vec_float4 x29_v = (vec_float4) { HUGE_VALF, 1.0e-99, -5.53856231e-27, make_float(0xFFC00000) };
vec_int4 r29_v = (vec_int4) { 128, FP_ILOGB0, -88, 128 };
// Compound
vec_float4 x30_v = (vec_float4) { 1.2e-57, -1.2e-19, 3.045784e-18, -1.0/0.0 } ;
vec_float4 x30_v = (vec_float4) { 1.2e-57, -1.2e-19, 3.045784e-18, -HUGE_VALF } ;
vec_int4 r30_v = (vec_int4) { FP_ILOGB0, -63, -59, 128 };
vec_float4 x0_v = spu_splats(x0);

View File

@@ -45,7 +45,7 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
// -Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0x0000000000000000ull;
// -Dmax
@@ -97,7 +97,7 @@ int main()
unsigned long long r13 = 0x0000000000000000ull;
// +Inf
double x14 = hide_double( 1.0/0.0);
double x14 = hide_double( HUGE_VAL);
unsigned long long r14 = 0x0000000000000000ull;
//+Nan
@@ -117,11 +117,11 @@ int main()
vec_ullong2 r18_v = (vec_ullong2) {0x0000000000000000ull, 0x0000000000000000ull};
// Compound
vec_double2 x19_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 x19_v = (vec_double2) { HUGE_VAL, -nan("") };
vec_ullong2 r19_v = (vec_ullong2) {0x0000000000000000ull, 0x0000000000000000ull};
// Compound
vec_double2 x20_v = (vec_double2) { -1.0e-999, -1.0/0.0} ;
vec_double2 x20_v = (vec_double2) { -1.0e-999, -HUGE_VAL} ;
vec_ullong2 r20_v = (vec_ullong2) {0xffffffffffffffffull, 0x0000000000000000ull};
vec_double2 x0_v = spu_splats(x0);

View File

@@ -40,11 +40,11 @@ int main()
TEST_SET_START("20060830000000AAN","AAN", "is0denormf4");
// -Nan
float x0 = hide_float(-nan(""));
float x0 = hide_float(-NANF);
unsigned int r0 = 0x00000000;
// -Inf
float x1 = hide_float(-1.0/0.0);
float x1 = hide_float(-HUGE_VALF);
unsigned int r1 = 0x00000000;
// -Smax
@@ -96,11 +96,11 @@ int main()
unsigned int r13 = 0x00000000;
// +Inf
float x14 = hide_float( 1.0/0.0);
float x14 = hide_float( HUGE_VALF);
unsigned int r14 = 0x00000000;
//+Nan
float x15 = hide_float( nan(""));
float x15 = hide_float(NANF);
unsigned int r15 = 0x00000000;
// Compound

View File

@@ -46,18 +46,18 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
//+Inf > -Inf
double x1 = hide_double( 1.0/0.0);
double y1 = hide_double(-1.0/0.0);
double x1 = hide_double( HUGE_VAL);
double y1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0x0000000000000000ull;
//-Inf < -Dmax
double x2 = hide_double(-1.0/0.0);
double x2 = hide_double(-HUGE_VAL);
double y2 = hide_double(-DBL_MAX);
unsigned long long r2 = 0x0000000000000000ull;
//-Norm > -Inf
double x3 = hide_double(-67418234.34256245);
double y3 = hide_double(-1.0/0.0);
double y3 = hide_double(-HUGE_VAL);
unsigned long long r3 = 0x0000000000000000ull;
//-Norm < -Denorm
@@ -131,7 +131,7 @@ int main()
unsigned long long r17 = 0x0000000000000000ull;
//+Inf > +Dmax
double x18 = hide_double( 1.0/0.0);
double x18 = hide_double(HUGE_VAL);
double y18 = hide_double(DBL_MAX);
unsigned long long r18 = 0x0000000000000000ull;

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -43,8 +44,8 @@ int main()
float y0 = hide_float( 0.0f);
unsigned int r0 = 0xffffffff;
float x1 = hide_float( 1.0/0.0); //+Smax
float y1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(FLT_MAX); //+Smax
float y1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0x00000000;
float x2 = hide_float(-0.0000000013152f);
@@ -75,7 +76,7 @@ int main()
float y8 = hide_float(2353705.31415f);
unsigned int r8 = 0x00000000;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
float y9 = hide_float(9.43574552184f);
unsigned int r9 = 0x00000000;

View File

@@ -45,7 +45,7 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
// -Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0x0000000000000000ull;
// -Dmax
@@ -97,7 +97,7 @@ int main()
unsigned long long r13 = 0xffffffffffffffffull;
// +Inf
double x14 = hide_double( 1.0/0.0);
double x14 = hide_double(HUGE_VAL);
unsigned long long r14 = 0x0000000000000000ull;
//+Nan
@@ -117,11 +117,11 @@ int main()
vec_ullong2 r18_v = (vec_ullong2) {0x0000000000000000ull, 0xffffffffffffffffull};
// Compound
vec_double2 x19_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 x19_v = (vec_double2) { HUGE_VAL, -nan("") };
vec_ullong2 r19_v = (vec_ullong2) {0x0000000000000000ull, 0x0000000000000000ull};
// Compound
vec_double2 x20_v = (vec_double2) { -1.0e-999, -1.0/0.0} ;
vec_double2 x20_v = (vec_double2) { -1.0e-999, -HUGE_VAL} ;
vec_ullong2 r20_v = (vec_ullong2) {0xffffffffffffffffull, 0x0000000000000000ull};
vec_double2 x0_v = spu_splats(x0);

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -42,7 +43,7 @@ int main()
float x0 = hide_float(-0.0f);
unsigned int r0 = 0xffffffff;
float x1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0xffffffff;
float x2 = hide_float(-0.0000000013152f);
@@ -66,7 +67,7 @@ int main()
float x8 = hide_float(2353705.31415f);
unsigned int r8 = 0xffffffff;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
unsigned int r9 = 0xffffffff;
vec_float4 x0_v = spu_splats(x0);

View File

@@ -46,18 +46,18 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
//+Inf > -Inf
double x1 = hide_double( 1.0/0.0);
double y1 = hide_double(-1.0/0.0);
double x1 = hide_double( HUGE_VAL);
double y1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0xffffffffffffffffull;
//-Inf < -Dmax
double x2 = hide_double(-1.0/0.0);
double x2 = hide_double(-HUGE_VAL);
double y2 = hide_double(-DBL_MAX);
unsigned long long r2 = 0x0000000000000000ull;
//-Norm > -Inf
double x3 = hide_double(-67418234.34256245);
double y3 = hide_double(-1.0/0.0);
double y3 = hide_double(-HUGE_VAL);
unsigned long long r3 = 0xffffffffffffffffull;
//-Norm < -Denorm
@@ -131,7 +131,7 @@ int main()
unsigned long long r17 = 0x0000000000000000ull;
//+Inf > +Dmax
double x18 = hide_double( 1.0/0.0);
double x18 = hide_double(HUGE_VAL);
double y18 = hide_double(DBL_MAX);
unsigned long long r18 = 0xffffffffffffffffull;

View File

@@ -46,18 +46,18 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
//+Inf > -Inf
double x1 = hide_double( 1.0/0.0);
double y1 = hide_double(-1.0/0.0);
double x1 = hide_double( HUGE_VAL);
double y1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0xffffffffffffffffull;
//-Inf < -Dmax
double x2 = hide_double(-1.0/0.0);
double x2 = hide_double(-HUGE_VAL);
double y2 = hide_double(-DBL_MAX);
unsigned long long r2 = 0x0000000000000000ull;
//-Norm > -Inf
double x3 = hide_double(-67418234.34256245);
double y3 = hide_double(-1.0/0.0);
double y3 = hide_double(-HUGE_VAL);
unsigned long long r3 = 0xffffffffffffffffull;
//-Norm < -Denorm
@@ -131,7 +131,7 @@ int main()
unsigned long long r17 = 0x0000000000000000ull;
//+Inf > +Dmax
double x18 = hide_double( 1.0/0.0);
double x18 = hide_double(HUGE_VAL);
double y18 = hide_double(DBL_MAX);
unsigned long long r18 = 0xffffffffffffffffull;

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -43,8 +44,8 @@ int main()
float y0 = hide_float( 0.0f);
unsigned int r0 = 0xffffffff;
float x1 = hide_float( 1.0/0.0); //+Smax
float y1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(FLT_MAX); //+Smax
float y1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0xffffffff;
float x2 = hide_float(-0.0000000013152f);
@@ -56,14 +57,14 @@ int main()
unsigned int r3 = 0xffffffff;
float x4 = hide_float(-83532.96153153f);
float y4 = hide_float(-1e-999); //-Smin
float y4 = hide_float(-FLT_MIN); //-Smin
unsigned int r4 = 0x00000000;
float x5 = hide_float(-321.01234567f);
float y5 = hide_float(876543.12345f);
unsigned int r5 = 0x00000000;
float x6 = hide_float( 1e-999); // Smin
float x6 = hide_float(FLT_MIN); // Smin
float y6 = hide_float(0.0031529324f);
unsigned int r6 = 0x00000000;
@@ -75,7 +76,7 @@ int main()
float y8 = hide_float(2353705.31415f);
unsigned int r8 = 0x00000000;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
float y9 = hide_float(9.43574552184f);
unsigned int r9 = 0xffffffff;

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -43,8 +44,8 @@ int main()
float y0 = hide_float( 0.0f);
unsigned int r0 = 0x00000000;
float x1 = hide_float( 1.0/0.0); //+Smax
float y1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(FLT_MAX); //+Smax
float y1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0xffffffff;
float x2 = hide_float(-0.0000000013152f);
@@ -56,14 +57,14 @@ int main()
unsigned int r3 = 0x00000000;
float x4 = hide_float(-83532.96153153f);
float y4 = hide_float(-1e-999); //-Smin
float y4 = hide_float(-FLT_MIN); //-Smin
unsigned int r4 = 0x00000000;
float x5 = hide_float(-321.01234567f);
float y5 = hide_float(876543.12345f);
unsigned int r5 = 0x00000000;
float x6 = hide_float( 1e-999); // Smin
float x6 = hide_float(FLT_MIN); // Smin
float y6 = hide_float(0.0031529324f);
unsigned int r6 = 0x00000000;
@@ -75,7 +76,7 @@ int main()
float y8 = hide_float(2353705.31415f);
unsigned int r8 = 0x00000000;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
float y9 = hide_float(9.43574552184f);
unsigned int r9 = 0xffffffff;

View File

@@ -45,7 +45,7 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
// -Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0xffffffffffffffffull;
// -Dmax
@@ -97,7 +97,7 @@ int main()
unsigned long long r13 = 0x0000000000000000ull;
// +Inf
double x14 = hide_double( 1.0/0.0);
double x14 = hide_double(HUGE_VAL);
unsigned long long r14 = 0xffffffffffffffffull;
//+Nan
@@ -117,11 +117,11 @@ int main()
vec_ullong2 r18_v = (vec_ullong2) {0x0000000000000000ull, 0xffffffffffffffffull};
// Compound
vec_double2 x19_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 x19_v = (vec_double2) { HUGE_VAL, -nan("") };
vec_ullong2 r19_v = (vec_ullong2) {0xffffffffffffffffull, 0x0000000000000000ull};
// Compound
vec_double2 x20_v = (vec_double2) { -1.0e999, -1.0/0.0} ;
vec_double2 x20_v = (vec_double2) { -1.0e999, -HUGE_VAL} ;
vec_ullong2 r20_v = (vec_ullong2) {0xffffffffffffffffull, 0xffffffffffffffffull};
vec_double2 x0_v = spu_splats(x0);

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -42,7 +43,7 @@ int main()
float x0 = hide_float(-0.0f);
unsigned int r0 = 0x00000000;
float x1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0x00000000;
float x2 = hide_float(-0.0000000013152f);
@@ -66,7 +67,7 @@ int main()
float x8 = hide_float(2353705.31415f);
unsigned int r8 = 0x00000000;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
unsigned int r9 = 0x00000000;
vec_float4 x0_v = spu_splats(x0);

View File

@@ -47,18 +47,18 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
//+Inf > -Inf
double x1 = hide_double( 1.0/0.0);
double y1 = hide_double(-1.0/0.0);
double x1 = hide_double( HUGE_VAL);
double y1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0x0000000000000000ull;
//-Inf < -Dmax
double x2 = hide_double(-1.0/0.0);
double x2 = hide_double(-HUGE_VAL);
double y2 = hide_double(-DBL_MAX);
unsigned long long r2 = 0xffffffffffffffffull;
//-Norm > -Inf
double x3 = hide_double(-67418234.34256245);
double y3 = hide_double(-1.0/0.0);
double y3 = hide_double(-HUGE_VAL);
unsigned long long r3 = 0x0000000000000000ull;
//-Norm < -Denorm
@@ -132,7 +132,7 @@ int main()
unsigned long long r17 = 0xffffffffffffffffull;
//+Inf > +Dmax
double x18 = hide_double( 1.0/0.0);
double x18 = hide_double(HUGE_VAL);
double y18 = hide_double(DBL_MAX);
unsigned long long r18 = 0x0000000000000000ull;

View File

@@ -46,18 +46,18 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
//+Inf > -Inf
double x1 = hide_double( 1.0/0.0);
double y1 = hide_double(-1.0/0.0);
double x1 = hide_double( HUGE_VAL);
double y1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0x0000000000000000ull;
//-Inf < -Dmax
double x2 = hide_double(-1.0/0.0);
double x2 = hide_double(-HUGE_VAL);
double y2 = hide_double(-DBL_MAX);
unsigned long long r2 = 0xffffffffffffffffull;
//-Norm > -Inf
double x3 = hide_double(-67418234.34256245);
double y3 = hide_double(-1.0/0.0);
double y3 = hide_double(-HUGE_VAL);
unsigned long long r3 = 0x0000000000000000ull;
//-Norm < -Denorm
@@ -131,7 +131,7 @@ int main()
unsigned long long r17 = 0xffffffffffffffffull;
//+Inf > +Dmax
double x18 = hide_double( 1.0/0.0);
double x18 = hide_double(HUGE_VAL);
double y18 = hide_double(DBL_MAX);
unsigned long long r18 = 0x0000000000000000ull;

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -43,8 +44,8 @@ int main()
float y0 = hide_float( 0.0f);
unsigned int r0 = 0xffffffff;
float x1 = hide_float( 1.0/0.0); //+Smax
float y1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(FLT_MAX); //+Smax
float y1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0x00000000;
float x2 = hide_float(-0.0000000013152f);
@@ -56,14 +57,14 @@ int main()
unsigned int r3 = 0xffffffff;
float x4 = hide_float(-83532.96153153f);
float y4 = hide_float(-1e-999); //-Smin
float y4 = hide_float(-FLT_MIN); //-Smin
unsigned int r4 = 0xffffffff;
float x5 = hide_float(-321.01234567f);
float y5 = hide_float(876543.12345f);
unsigned int r5 = 0xffffffff;
float x6 = hide_float( 1e-999); // Smin
float x6 = hide_float(FLT_MIN); // Smin
float y6 = hide_float(0.0031529324f);
unsigned int r6 = 0xffffffff;
@@ -75,7 +76,7 @@ int main()
float y8 = hide_float(2353705.31415f);
unsigned int r8 = 0xffffffff;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
float y9 = hide_float(9.43574552184f);
unsigned int r9 = 0x00000000;

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -43,8 +44,8 @@ int main()
float y0 = hide_float( 0.0f);
unsigned int r0 = 0x00000000;
float x1 = hide_float( 1.0/0.0); //+Smax
float y1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(FLT_MAX); //+Smax
float y1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0x00000000;
float x2 = hide_float(-0.0000000013152f);
@@ -56,14 +57,14 @@ int main()
unsigned int r3 = 0x00000000;
float x4 = hide_float(-83532.96153153f);
float y4 = hide_float(-1e-999); //-Smin
float y4 = hide_float(-FLT_MIN); //-Smin
unsigned int r4 = 0xffffffff;
float x5 = hide_float(-321.01234567f);
float y5 = hide_float(876543.12345f);
unsigned int r5 = 0xffffffff;
float x6 = hide_float( 1e-999); // Smin
float x6 = hide_float(FLT_MIN); // Smin
float y6 = hide_float(0.0031529324f);
unsigned int r6 = 0xffffffff;
@@ -75,7 +76,7 @@ int main()
float y8 = hide_float(2353705.31415f);
unsigned int r8 = 0xffffffff;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
float y9 = hide_float(9.43574552184f);
unsigned int r9 = 0x00000000;

View File

@@ -46,18 +46,18 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
//+Inf > -Inf
double x1 = hide_double( 1.0/0.0);
double y1 = hide_double(-1.0/0.0);
double x1 = hide_double( HUGE_VAL);
double y1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0xffffffffffffffffull;
//-Inf < -Dmax
double x2 = hide_double(-1.0/0.0);
double x2 = hide_double(-HUGE_VAL);
double y2 = hide_double(-DBL_MAX);
unsigned long long r2 = 0xffffffffffffffffull;
//-Norm > -Inf
double x3 = hide_double(-67418234.34256245);
double y3 = hide_double(-1.0/0.0);
double y3 = hide_double(-HUGE_VAL);
unsigned long long r3 = 0xffffffffffffffffull;
//-Norm < -Denorm
@@ -131,7 +131,7 @@ int main()
unsigned long long r17 = 0xffffffffffffffffull;
//+Inf > +Dmax
double x18 = hide_double( 1.0/0.0);
double x18 = hide_double(HUGE_VAL);
double y18 = hide_double(DBL_MAX);
unsigned long long r18 = 0xffffffffffffffffull;

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -43,8 +44,8 @@ int main()
float y0 = hide_float( 0.0f);
unsigned int r0 = 0x00000000;
float x1 = hide_float( 1.0/0.0); //+Smax
float y1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float( FLT_MAX); //+Smax
float y1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0xffffffff;
float x2 = hide_float(-0.0000000013152f);
@@ -75,7 +76,7 @@ int main()
float y8 = hide_float(2353705.31415f);
unsigned int r8 = 0xffffffff;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
float y9 = hide_float(9.43574552184f);
unsigned int r9 = 0xffffffff;

View File

@@ -46,7 +46,7 @@ int main()
unsigned long long r0 = 0xffffffffffffffffull;
// -Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0x0000000000000000ull;
// -Dmax
@@ -98,7 +98,7 @@ int main()
unsigned long long r13 = 0xffffffffffffffffull;
// +Inf
double x14 = hide_double( 1.0/0.0);
double x14 = hide_double(HUGE_VAL);
unsigned long long r14 = 0x0000000000000000ull;
//+Nan
@@ -118,11 +118,11 @@ int main()
vec_ullong2 r18_v = (vec_ullong2) {0xffffffffffffffffull, 0x0000000000000000ull};
// Compound
vec_double2 x19_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 x19_v = (vec_double2) { HUGE_VAL, -nan("") };
vec_ullong2 r19_v = (vec_ullong2) {0x0000000000000000ull, 0xffffffffffffffffull};
// Compound
vec_double2 x20_v = (vec_double2) { make_double(0x7FF8000000000000ull), -1.0/0.0} ;
vec_double2 x20_v = (vec_double2) { make_double(0x7FF8000000000000ull), -HUGE_VAL} ;
vec_ullong2 r20_v = (vec_ullong2) {0xffffffffffffffffull, 0x0000000000000000ull};
vec_double2 x0_v = spu_splats(x0);

View File

@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -41,7 +42,7 @@ int main()
float x0 = hide_float(-0.0f);
unsigned int r0 = 0x00000000;
float x1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0x00000000;
float x2 = hide_float(-0.0000000013152f);
@@ -65,7 +66,7 @@ int main()
float x8 = hide_float(2353705.31415f);
unsigned int r8 = 0x00000000;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
unsigned int r9 = 0x00000000;
vec_float4 x0_v = spu_splats(x0);

View File

@@ -45,7 +45,7 @@ int main()
unsigned long long r0 = 0x0000000000000000ull;
// -Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0x0000000000000000ull;
// -Dmax
@@ -97,7 +97,7 @@ int main()
unsigned long long r13 = 0xffffffffffffffffull;
// +Inf
double x14 = hide_double( 1.0/0.0);
double x14 = hide_double(HUGE_VAL);
unsigned long long r14 = 0x0000000000000000ull;
//+Nan
@@ -117,11 +117,11 @@ int main()
vec_ullong2 r18_v = (vec_ullong2) {0x0000000000000000ull, 0xffffffffffffffffull};
// Compound
vec_double2 x19_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 x19_v = (vec_double2) { HUGE_VAL, -nan("") };
vec_ullong2 r19_v = (vec_ullong2) {0x0000000000000000ull, 0x0000000000000000ull};
// Compound
vec_double2 x20_v = (vec_double2) { -1.0e-999, -1.0/0.0} ;
vec_double2 x20_v = (vec_double2) { -1.0e-999, -HUGE_VAL};
vec_ullong2 r20_v = (vec_ullong2) {0x0000000000000000ull, 0x0000000000000000ull};
vec_double2 x0_v = spu_splats(x0);

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -42,7 +43,7 @@ int main()
float x0 = hide_float(-0.0f);
unsigned int r0 = 0x00000000;
float x1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0xffffffff;
float x2 = hide_float( 0.0f);
@@ -57,7 +58,7 @@ int main()
float x5 = hide_float(876543.12345f);
unsigned int r5 = 0xffffffff;
float x6 = hide_float( 1e-999); // Smin
float x6 = hide_float(1e-999); // Smin
unsigned int r6 = 0x00000000;
float x7 = hide_float(5172.2845321f);
@@ -66,7 +67,7 @@ int main()
float x8 = hide_float(2353705.31415f);
unsigned int r8 = 0xffffffff;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
unsigned int r9 = 0xffffffff;
vec_float4 x0_v = spu_splats(x0);

View File

@@ -46,12 +46,12 @@ int main()
unsigned long long r0 = 0xffffffffffffffffull;
//+Inf, -Inf
double x1 = hide_double( 1.0/0.0);
double y1 = hide_double(-1.0/0.0);
double x1 = hide_double( HUGE_VAL);
double y1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0x0000000000000000ull;
//-Inf, -QNaN
double x2 = hide_double(-1.0/0.0);
double x2 = hide_double(-HUGE_VAL);
double y2 = hide_double(make_double(0xFFFFFFFFFFFFFFFFull));
unsigned long long r2 = 0xffffffffffffffffull;
@@ -67,7 +67,7 @@ int main()
//-Norm, -Inf
double x5 = hide_double(-168.97345223013);
double y5 = hide_double(-1.0/0.0);
double y5 = hide_double(-HUGE_VAL);
unsigned long long r5 = 0x0000000000000000ull;
//-QNaN, -Norm
@@ -131,12 +131,12 @@ int main()
unsigned long long r17 = 0x0000000000000000ull;
//+Inf, +Ovf
double x18 = hide_double( 1.0/0.0);
double x18 = hide_double( HUGE_VAL);
double y18 = hide_double( 1.0e999);
unsigned long long r18 = 0x0000000000000000ull;
//+Inf, +QNaN
double x19 = hide_double( 1.0/0.0);
double x19 = hide_double( HUGE_VAL);
double y19 = hide_double(nan(""));
unsigned long long r19 = 0xffffffffffffffffull;

View File

@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
@@ -43,8 +44,8 @@ int main()
float y0 = hide_float( 0.0f);
unsigned int r0 = 0x00000000;
float x1 = hide_float( 1.0/0.0); //+Smax
float y1 = hide_float(-1.0/0.0); //-Smax
float x1 = hide_float( FLT_MAX); //+Smax
float y1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0x00000000;
float x2 = hide_float(-0.0000000013152f);
@@ -75,7 +76,7 @@ int main()
float y8 = hide_float(2353705.31415f);
unsigned int r8 = 0x00000000;
float x9 = hide_float( 1.0/0.0); // Smax
float x9 = hide_float(FLT_MAX); // Smax
float y9 = hide_float(9.43574552184f);
unsigned int r9 = 0x00000000;

View File

@@ -66,11 +66,11 @@ int main()
// unsigned long long i11 = 0x7FFFFFFFFFFFFDFFull; //limit
// unsigned long long i12 = 0xFFFFFFFFFFFFFDFFull; //limit
// double x0 = hide_double(-1.0/0.0); // -Inf
// double x1 = hide_double(1.0/0.0); // Inf
// double x0 = hide_double(-HUGE_VAL); // -Inf
// double x1 = hide_double(HUGE_VAL); // Inf
double x2 = hide_double(0.0); // +0
double x3 = hide_double(-0.0); // -0
// double x4 = hide_double(0.0/0.0); // NaN -> NaN
// double x4 = hide_double(nan("")); // NaN -> NaN
double x5 = hide_double( 0.5);
double x6 = hide_double(-0.5);
double x7 = hide_double( 0.4999999999999999); // 0

View File

@@ -47,7 +47,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
//#include <fenv.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
@@ -71,11 +70,11 @@ int main()
// unsigned long i11 = 0x49fffffful; //2097151.875000
// unsigned long i12 = 0x4a7ffffful; //4194303.750000
// float x0 = hide_float(-1.0/0.0); // -Inf
// float x1 = hide_float(1.0/0.0); // Inf
// float x0 = hide_float(-FLT_MAX); // -Inf
// float x1 = hide_float(FLT_MAX); // Inf
float x2 = hide_float(0.0); // +0
float x3 = hide_float(-0.0); // -0
// float x4 = hide_float(0.0/0.0); // NaN -> NaN
// float x4 = hide_float(NANF); // NaN -> NaN
float x5 = hide_float( 0.5);
float x6 = hide_float(-0.5);
float x7 = hide_float(-0.499999);

View File

@@ -46,7 +46,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
//#include <fenv.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
@@ -60,11 +59,11 @@ int main()
// unsigned long long i11 = 0x7FFFFFFFFFFFFDFFull; //limit
// unsigned long long i12 = 0xFFFFFFFFFFFFFDFFull; //limit
// double x0 = hide_double(-1.0/0.0); // -Inf
// double x1 = hide_double(1.0/0.0); // Inf
// double x0 = hide_double(-HUGE_VAL); // -Inf
// double x1 = hide_double(HUGE_VAL); // Inf
double x2 = hide_double(0.0); // +0
double x3 = hide_double(-0.0); // -0
// double x4 = hide_double(0.0/0.0); // NaN -> NaN
// double x4 = hide_double(nan("")); // NaN -> NaN
double x5 = hide_double( 0.5);
double x6 = hide_double(-0.5);
double x7 = hide_double( 0.4999999999999999); // 0

View File

@@ -49,7 +49,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
//#include <fenv.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
@@ -73,11 +72,11 @@ int main()
// unsigned long i11 = 0x49fffffful; //2097151.875000
// unsigned long i12 = 0x4a7ffffful; //4194303.750000
// float x0 = hide_float(-1.0/0.0); // -Inf
// float x1 = hide_float(1.0/0.0); // Inf
// float x0 = hide_float(-FLT_MAX); // -Inf
// float x1 = hide_float(FLT_MAX); // Inf
float x2 = hide_float(0.0); // +0
float x3 = hide_float(-0.0); // -0
// float x4 = hide_float(0.0/0.0); // NaN -> NaN
// float x4 = hide_float(NANF); // NaN -> NaN
float x5 = hide_float( 0.5);
float x6 = hide_float(-0.5);
float x7 = hide_float(-0.499999);

View File

@@ -35,18 +35,6 @@
#include "common-test.h"
#include "testutils.h"
#ifndef HUGE_VALL
#define HUGE_VALL __builtin_huge_vall ()
#endif
#ifndef DBL_INF
#define DBL_INF ((long long)0x7FF0000000000000ull)
#endif
#ifndef DBL_NAN
#define DBL_NAN ((long long)0x7FF8000000000000ull)
#endif
int main()
{
TEST_SET_START("20060905000000AAN","AAN", "logbd2");
@@ -56,8 +44,8 @@ int main()
double r0 = hide_double( nan(""));
// -Inf
double x1 = hide_double(-1.0/0.0);
double r1 = hide_double(make_double(DBL_INF));
double x1 = hide_double(-HUGE_VAL);
double r1 = hide_double(HUGE_VAL);
// -Dmax
double x2 = hide_double(-DBL_MAX);
@@ -77,19 +65,19 @@ int main()
// -Unf
double x6 = hide_double(-1.0e-999);
double r6 = make_double(-((unsigned long long)HUGE_VALL));
double r6 = hide_double(-HUGE_VAL);
// -0
double x7 = hide_double(-0.0);
double r7 = make_double(-((unsigned long long)HUGE_VALL));
double r7 = hide_double(-HUGE_VAL);
// 0
double x8 = hide_double( 0.0);
double r8 = make_double(-((unsigned long long)HUGE_VALL));
double r8 = hide_double(-HUGE_VAL);
// +Unf
double x9 = hide_double( 1.0e-999);
double r9 = make_double(-((unsigned long long)HUGE_VALL));
double r9 = hide_double(-HUGE_VAL);
// +Denorm
double x10 = hide_double( 2.40e-310);
@@ -148,8 +136,8 @@ int main()
double r23 = 1023.0;
// +Inf
double x24 = hide_double( 1.0/0.0);
double r24 = hide_double(make_double(DBL_INF));
double x24 = hide_double(HUGE_VAL);
double r24 = hide_double(HUGE_VAL);
//+Nan
double x25 = hide_double( nan(""));
@@ -157,7 +145,7 @@ int main()
// Compound
vec_double2 x26_v = (vec_double2) { -2.561286432e-317, -1.0e-999 };
vec_double2 r26_v = (vec_double2) { -1052.0, make_double(-((unsigned long long)HUGE_VALL)) };
vec_double2 r26_v = (vec_double2) { -1052.0, hide_double(-HUGE_VAL) };
// Compound
vec_double2 x27_v = (vec_double2) { 345.27533, -8.673e-310 };
@@ -168,12 +156,12 @@ int main()
vec_double2 r28_v = (vec_double2) { nan(""), 21.0 };
// Compound
vec_double2 x29_v = (vec_double2) { 1.0/0.0, -nan("") };
vec_double2 r29_v = (vec_double2) { make_double(DBL_INF), nan("") };
vec_double2 x29_v = (vec_double2) { HUGE_VAL, -nan("") };
vec_double2 r29_v = (vec_double2) { HUGE_VAL, nan("") };
// Compound
vec_double2 x30_v = (vec_double2) { -1.2e-99, -1.0/0.0 } ;
vec_double2 r30_v = (vec_double2) { -329.0, make_double(DBL_INF) };
vec_double2 x30_v = (vec_double2) { -1.2e-99, -HUGE_VAL } ;
vec_double2 r30_v = (vec_double2) { -329.0, HUGE_VAL };
vec_double2 x0_v = spu_splats(x0);
vec_double2 r0_v = spu_splats(r0);

View File

@@ -37,10 +37,6 @@
#include "common-test.h"
#include "testutils.h"
#ifndef HUGE_VALF
#define HUGE_VALF __builtin_huge_valf ()
#endif
int main()
{
TEST_SET_START("20060905000000AAN","AAN", "logbf4");
@@ -50,7 +46,7 @@ int main()
float r0 = 128.0f;
// -Norm (IEEE-754: -Inf)
float x1 = hide_float(-1.0/0.0);
float x1 = hide_float(-HUGE_VALF);
float r1 = 128.0f;
// -Smax
@@ -67,27 +63,27 @@ int main()
// -Denorm
float x5 = hide_float(make_float(0x807AAAAA));
float r5 = (float)-HUGE_VALF;
float r5 = -HUGE_VALF;
// -Unf
float x6 = hide_float(-1.0e-999);
float r6 = (float)-HUGE_VALF;
float r6 = -HUGE_VALF;
// -0
float x7 = hide_float(-0.0);
float r7 = (float)-HUGE_VALF;
float r7 = -HUGE_VALF;
// 0
float x8 = hide_float( 0.0);
float r8 = (float)-HUGE_VALF;
float r8 = -HUGE_VALF;
// +Unf
float x9 = hide_float( 1.0e-999);
float r9 = (float)-HUGE_VALF;
float r9 = -HUGE_VALF;
// +Denorm
float x10 = hide_float(make_float(0x007AAAAA));
float r10 = (float)-HUGE_VALF;
float r10 = -HUGE_VALF;
// +Smin
float x11 = hide_float(make_float(0x00800000));
@@ -142,7 +138,7 @@ int main()
float r23 = 128.0f;
//+Norm (IEEE-754: +Inf)
float x24 = hide_float( 1.0/0.0);
float x24 = hide_float(HUGE_VALF);
float r24 = 128.0f;
//+Norm (IEEE-754: +Nan)
@@ -162,11 +158,11 @@ int main()
vec_float4 r28_v = (vec_float4) { 128.0f, 19.0f, -HUGE_VALF, 21.0f };
// Compound
vec_float4 x29_v = (vec_float4) { 1.0/0.0, 1.0e-99, -5.53856231e-27, make_float(0xFFC00000) };
vec_float4 x29_v = (vec_float4) { HUGE_VALF, 1.0e-99, -5.53856231e-27, make_float(0xFFC00000) };
vec_float4 r29_v = (vec_float4) { 128.0f, -HUGE_VALF, -88.0f, 128.0f };
// Compound
vec_float4 x30_v = (vec_float4) { 1.2e-57, -1.2e-19, 3.045784e-18, -1.0/0.0 } ;
vec_float4 x30_v = (vec_float4) { 1.2e-57, -1.2e-19, 3.045784e-18, -HUGE_VALF } ;
vec_float4 r30_v = (vec_float4) { -HUGE_VALF, -63.0f, -59.0f, 128.0f };
vec_float4 x0_v = spu_splats(x0);

View File

@@ -45,8 +45,8 @@ int main()
double x1p = hide_double(83532.96153153);
double x2n = hide_double(-0.0000000013152);
double x2p = hide_double(0.0000000013152);
double x3n = hide_double(-1.0/0.0);
double x3p = hide_double(1.0/0.0);
double x3n = hide_double(-HUGE_VAL);
double x3p = hide_double(HUGE_VAL);
vec_double2 x0n_v = spu_splats(x0n);
vec_double2 x0p_v = spu_splats(x0p);

View File

@@ -53,11 +53,11 @@ int main()
unsigned long long i12 = 0x1ac4d062d451c99dull;
unsigned long long i12r = 0x6518994c26ebbb3eull;
double x0 = hide_double(-1.0/0.0); // -Inf
double x1 = hide_double(1.0/0.0); // Inf
double x0 = hide_double(-HUGE_VAL); // -Inf
double x1 = hide_double(HUGE_VAL); // Inf
double x2 = hide_double(0.0); // 0
double x3 = hide_double(-0.0); // -0
double x4 = hide_double(0.0/0.0); // NaN
double x4 = hide_double(nan("")); // NaN
double x5 = hide_double(2.0);
double x5r = hide_double(0.5);
double x6 = hide_double(make_double(i6));

View File

@@ -116,8 +116,6 @@ int main()
vec_float4 x5d_v = spu_splats(x5d);
vec_float4 x5r_v = spu_splats(x5r);
float res;
int quo;
vec_float4 res_v;
vec_int4 quo_v;
@@ -140,26 +138,6 @@ int main()
res_v = remquof4(x5n_v, x5d_v, &quo_v);
TEST_CHECK("20060912170038NM", allequal_ulps_float4( res_v, x5r_v, 1 ), 0);
TEST_CHECK("20060912170138NM", allequal_int4( quo_v, spu_splats((int)i5q) ), 0);
TEST_START("remquof");
res = remquof(x0n, x0d, &quo);
TEST_CHECK("20060912170041NM", ulpDiff_f( res, x0r ) <= 1, 0);
TEST_CHECK("20060912170141NM", (quo == (int)i0q), 0);
res = remquof(x1n, x1d, &quo);
TEST_CHECK("20060912170042NM", ulpDiff_f( res, x1r ) <= 1, 0);
TEST_CHECK("20060912170142NM", (quo == (int)i1q), 0);
res = remquof(x2n, x2d, &quo);
TEST_CHECK("20060912170043NM", ulpDiff_f( res, x2r ) <= 1, 0);
TEST_CHECK("20060912170143NM", (quo == (int)i2q), 0);
res = remquof(x3n, x3d, &quo);
TEST_CHECK("20060912170048NM", ulpDiff_f( res, x3r ) <= 1, 0);
TEST_CHECK("20060912170144NM", (quo == (int)i3q), 0);
res = remquof(x4n, x4d, &quo);
TEST_CHECK("20060912170049NM", ulpDiff_f( res, x4r ) <= 1, 0);
TEST_CHECK("20060912170149NM", (quo == (int)i4q), 0);
res = remquof(x5n, x5d, &quo);
TEST_CHECK("20060912170050NM", ulpDiff_f( res, x5r ) <= 1, 0);
TEST_CHECK("20060912170150NM", (quo == (int)i5q), 0);
TEST_SET_DONE();

View File

@@ -52,11 +52,11 @@ int main()
unsigned long long i11 = 0x1aabc083c5c26227ull;
unsigned long long i11r = 0x52912e543817fabbull;
double x0 = hide_double(-1.0/0.0); // -Inf -> NaN
double x1 = hide_double(1.0/0.0); // Inf -> +0
double x0 = hide_double(-HUGE_VAL); // -Inf -> NaN
double x1 = hide_double(HUGE_VAL); // Inf -> +0
double x2 = hide_double(0.0); // +0 -> Inf
double x3 = hide_double(-0.0); // -0 -> -Inf
double x4 = hide_double(0.0/0.0); // NaN -> NaN
double x4 = hide_double(nan("")); // NaN -> NaN
double x5 = hide_double(4.0);
double x5r = hide_double(0.5);
double x6 = hide_double(make_double(i6));

View File

@@ -45,7 +45,7 @@ int main()
unsigned long long r0 = 0xffffffffffffffffull;
//-Inf
double x1 = hide_double(-1.0/0.0);
double x1 = hide_double(-HUGE_VAL);
unsigned long long r1 = 0xffffffffffffffffull;
//-Smax
@@ -97,7 +97,7 @@ int main()
unsigned long long r13 = 0x0000000000000000ull;
//+Inf
double x14 = hide_double( 1.0/0.0);
double x14 = hide_double(HUGE_VAL);
unsigned long long r14 = 0x0000000000000000ull;
//+NaN

View File

@@ -41,11 +41,11 @@ int main()
TEST_SET_START("20060829000000AAN","AAN", "signbitf4");
//-Nan
float x0 = hide_float(-nan(""));
float x0 = hide_float(-NANF);
unsigned int r0 = 0xffffffff;
//-Inf
float x1 = hide_float(-1.0/0.0);
float x1 = hide_float(-HUGE_VAL);
unsigned int r1 = 0xffffffff;
//-Smax
@@ -97,11 +97,11 @@ int main()
unsigned int r13 = 0x00000000;
//+Inf
float x14 = hide_float( 1.0/0.0);
float x14 = hide_float(HUGE_VAL);
unsigned int r14 = 0x00000000;
//+NaN
float x15 = hide_float( nan(""));
float x15 = hide_float(NANF);
unsigned int r15 = 0x00000000;
vec_float4 x0_v = spu_splats(x0);

View File

@@ -54,11 +54,11 @@ int main()
unsigned long long i11 = 0x1aabc083c5c26227ull;
unsigned long long i11r = 0x2d4dcce790f64a35ull;
double x0 = hide_double(-1.0/0.0); // -Inf -> NaN
double x1 = hide_double(1.0/0.0); // Inf -> Inf
double x0 = hide_double(-HUGE_VAL); // -Inf -> NaN
double x1 = hide_double(HUGE_VAL); // Inf -> Inf
double x2 = hide_double(0.0); // +0 -> +0
double x3 = hide_double(-0.0); // -0 -> -0
double x4 = hide_double(0.0/0.0); // NaN -> NaN
double x4 = hide_double(nan("")); // NaN -> NaN
double x5 = hide_double(4.0);
double x5r = hide_double(2.0);
double x6 = hide_double(make_double(i6));

View File

@@ -105,7 +105,7 @@ vec_uint4 bitDiff_f4(vec_float4 ref, vec_float4 vals) {
vec_int4 diff = spu_sub(refi, valsi);
vec_int4 negdiff = spu_sub(spu_splats((int)0), diff);
return spu_sub((vec_uint4)spu_splats(32), spu_cntlz(spu_sel(negdiff, diff, (vec_uchar16)spu_cmpgt(diff, 0))));
return spu_sub((vec_uint4)spu_splats(32), spu_cntlz(spu_sel(negdiff, diff, spu_cmpgt(diff, 0))));
}
unsigned int bitDiff_f(float ref, float val) {
@@ -156,7 +156,7 @@ vec_uint4 ulpDiff_f4(vec_float4 ref, vec_float4 vals) {
vec_int4 diff = spu_sub(refi, valsi);
vec_int4 negdiff = spu_sub(spu_splats((int)0), diff);
return (vec_uint4)(spu_sel(negdiff, diff, (vec_uchar16)spu_cmpgt(diff, 0)));
return (vec_uint4)(spu_sel(negdiff, diff, spu_cmpgt(diff, 0)));
}
unsigned int ulpDiff_f(float ref, float val) {

View File

@@ -32,7 +32,9 @@
#ifndef _TESTUTILS_H_
#include "floatingpoint_tests.h"
#include <spu_intrinsics.h>
#define NANF __builtin_nanf("")
extern unsigned int hide_uint( unsigned int x );
extern int hide_int( int x );