Fixup divider save_restore for floating point too; improve tests (#405)
- The divider state needs to be saved for __aeabi_ddiv, __aeabi_fdiv, __aeabi_dtan and __aeabi_ftan or they won't work in interrupts *(probably not used much youd hope), or on an RTOS context switch - Refactored code out for the integer and floating point cases - Improved the floating point 'tests' in passing to check more return values against GCC implementations - Added floating point usage to the IRQ nesting test case
This commit is contained in:
@ -11,15 +11,19 @@ add_executable(pico_double_test
|
||||
)
|
||||
|
||||
|
||||
#todo split out variants with different flags
|
||||
target_compile_definitions(pico_float_test PRIVATE
|
||||
PICO_USE_CRT_PRINTF=1 # want full precision output
|
||||
# PICO_FLOAT_PROPAGATE_NANS=1
|
||||
# PICO_DIVIDER_DISABLE_INTERRUPTS=1
|
||||
)
|
||||
|
||||
#todo split out variants with different flags
|
||||
target_compile_definitions(pico_double_test PRIVATE
|
||||
PICO_USE_CRT_PRINTF=1 # want full precision output
|
||||
PICO_FLOAT_PROPAGATE_NANS=1
|
||||
PICO_DOUBLE_PROPAGATE_NANS=1
|
||||
#PICO_DOUBLE_PROPAGATE_NANS=1
|
||||
#PICO_DIVIDER_DISABLE_INTERRUPTS=1
|
||||
)
|
||||
|
||||
# handy for testing we aren't pulling in extra stuff
|
||||
|
@ -282,6 +282,51 @@ int test_dcmpun() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define assert_nan(a) assert(isnan(a))
|
||||
#define check_nan(a) ({ assert_nan(a); a; })
|
||||
|
||||
double __aeabi_i2d(int32_t);
|
||||
double __aeabi_ui2d(int32_t);
|
||||
double __aeabi_l2d(int64_t);
|
||||
double __aeabi_ul2d(int64_t);
|
||||
int32_t __aeabi_d2iz(double);
|
||||
int64_t __aeabi_d2lz(double);
|
||||
double __aeabi_dmul(double, double);
|
||||
double __aeabi_ddiv(double, double);
|
||||
#if LIB_PICO_DOUBLE_PICO
|
||||
double __real___aeabi_i2d(int);
|
||||
double __real___aeabi_ui2d(int);
|
||||
double __real___aeabi_l2d(int64_t);
|
||||
double __real___aeabi_ul2d(int64_t);
|
||||
double __real___aeabi_dmul(double, double);
|
||||
double __real___aeabi_ddiv(double, double);
|
||||
int32_t __real___aeabi_d2iz(double);
|
||||
int64_t __real___aeabi_d2lz(double);
|
||||
double __real_sqrt(double);
|
||||
double __real_cos(double);
|
||||
double __real_sin(double);
|
||||
double __real_tan(double);
|
||||
double __real_exp(double);
|
||||
double __real_log(double);
|
||||
double __real_atan2(double, double);
|
||||
double __real_pow(double, double);
|
||||
double __real_trunc(double);
|
||||
double __real_ldexp(double, int);
|
||||
double __real_fmod(double, double);
|
||||
|
||||
#define EPSILON 1e-9
|
||||
#define assert_close(a, b) assert(((b - a) < EPSILON || (a - b) < EPSILON) || (isinf(a) && isinf(b) && (a < 0) == (b < 0)))
|
||||
#define check1(func,p0) ({ typeof(p0) r = func(p0), r2 = __CONCAT(__real_, func)(p0); assert(r == r2); r; })
|
||||
#define check2(func,p0,p1) ({ typeof(p0) r = func(p0,p1), r2 = __CONCAT(__real_, func)(p0,p1); assert(r == r2); r; })
|
||||
#define check_close1(func,p0) ({ typeof(p0) r = func(p0), r2 = __CONCAT(__real_, func)(p0); if (isnan(p0)) assert_nan(r); else assert_close(r, r2); r; })
|
||||
#define check_close2(func,p0,p1) ({ typeof(p0) r = func(p0,p1), r2 = __CONCAT(__real_, func)(p0,p1); if (isnan(p0) || isnan(p1)) assert_nan(r); else assert_close(r, r2); r; })
|
||||
#else
|
||||
#define check1(func,p0) func(p0)
|
||||
#define check2(func,p0,p1) func(p0,p1)
|
||||
#define check_close1(func,p0) func(p0)
|
||||
#define check_close2(func,p0,p1) func(p0,p1)
|
||||
#endif
|
||||
|
||||
double aa = 0.5;
|
||||
double bb = 1;
|
||||
|
||||
@ -305,14 +350,18 @@ int main() {
|
||||
#if 1
|
||||
for (double x = 0; x < 3; x++) {
|
||||
printf("\n ----- %g\n", x);
|
||||
printf("SQRT %10.18g\n", sqrt(x));
|
||||
printf("COS %10.18g\n", cos(x));
|
||||
printf("SIN %10.18g\n", sin(x));
|
||||
printf("TAN %10.18g\n", tan(x));
|
||||
printf("ATAN2 %10.18g\n", atan2(x, 10));
|
||||
printf("ATAN2 %10.18g\n", atan2(10, x));
|
||||
printf("EXP %10.18g\n", exp(x));
|
||||
printf("LN %10.18g\n", log(x));
|
||||
printf("SQRT %10.18g\n", check_close1(sqrt, x));
|
||||
printf("COS %10.18g\n", check_close1(cos, x));
|
||||
printf("SIN %10.18g\n", check_close1(sin, x));
|
||||
printf("TAN %10.18g\n", check_close1(tan, x));
|
||||
printf("ATAN2 %10.18g\n", check_close2(atan2, x, 10.0));
|
||||
printf("ATAN2 %10.18g\n", check_close2(atan2, 10.0, x));
|
||||
printf("EXP %10.18g\n", check_close1(exp, x));
|
||||
printf("LN %10.18g\n", check_close1(log, x));
|
||||
printf("POW %10.18f\n", check_close2(pow, x, x));
|
||||
printf("TRUNC %10.18f\n", check_close1(trunc, x));
|
||||
printf("LDEXP %10.18f\n", check_close2(ldexp, x, x));
|
||||
printf("FMOD %10.18f\n", check_close2(fmod, x, 3.0f));
|
||||
double s, c;
|
||||
sincos(x, &s, &c);
|
||||
printf("SINCOS %10.18f %10.18f\n", s, c);
|
||||
@ -325,22 +374,21 @@ int main() {
|
||||
#if PICO_DOUBLE_PROPAGATE_NANS
|
||||
{
|
||||
float x = NAN;
|
||||
printf("NANO %10.18f\n", x);
|
||||
printf("SQRT %10.18f\n", sqrt(x));
|
||||
printf("COS %10.18f\n", cos(x));
|
||||
printf("SIN %10.18f\n", sin(x));
|
||||
printf("TAN %10.18f\n", tan(x));
|
||||
printf("ATAN2 %10.18f\n", atan2(x, 10));
|
||||
printf("ATAN2 %10.18f\n", atan2(10, x));
|
||||
printf("EXP %10.18f\n", exp(x));
|
||||
printf("LN %10.18f\n", log(x));
|
||||
printf("POW %10.18f\n", pow(x, x));
|
||||
printf("TRUNC %10.18f\n", trunc(x));
|
||||
printf("LDEXP %10.18f\n", ldexp(x, x));
|
||||
printf("FMOD %10.18f\n", fmod(x, 3.0f));
|
||||
printf("SQRT %10.18g\n", check_close1(sqrt, x));
|
||||
printf("COS %10.18g\n", check_close1(cos, x));
|
||||
printf("SIN %10.18g\n", check_close1(sin, x));
|
||||
printf("TAN %10.18g\n", check_close1(tan, x));
|
||||
printf("ATAN2 %10.18g\n", check_close2(atan2, x, 10.0));
|
||||
printf("ATAN2 %10.18g\n", check_close2(atan2, 10.0, x));
|
||||
printf("EXP %10.18g\n", check_close1(exp, x));
|
||||
printf("LN %10.18g\n", check_close1(log, x));
|
||||
printf("POW %10.18f\n", check_nan(pow(x, x)));
|
||||
printf("TRUNC %10.18f\n", check_nan(trunc(x)));
|
||||
printf("LDEXP %10.18f\n", check_nan(ldexp(x, x)));
|
||||
printf("FMOD %10.18f\n", check_nan(fmod(x, 3.0f)));
|
||||
double s, c;
|
||||
sincos(x, &s, &c);
|
||||
printf("SINCOS %10.18f %10.18f\n", s, c);
|
||||
printf("SINCOS %10.18f %10.18f\n", check_nan(s), check_nan(c));
|
||||
|
||||
for(int j=0;j<2;j++) {
|
||||
for (int i = 1; i < 4; i++) {
|
||||
@ -372,17 +420,21 @@ int main() {
|
||||
// }
|
||||
for (int32_t x = -1; x; x <<= 1) {
|
||||
printf("i %d->%f\n", x, (double) x);
|
||||
check1(__aeabi_i2d, x);
|
||||
}
|
||||
for (int32_t x = 1; x; x <<= 1) {
|
||||
printf("i %d->%f\n", x, (double) x);
|
||||
check1(__aeabi_i2d, x);
|
||||
y = x << 1;
|
||||
}
|
||||
for (int64_t x = 1; x; x <<= 1) {
|
||||
printf("i %lld->%f\n", x, (double) x);
|
||||
check1(__aeabi_l2d, x);
|
||||
y = x << 1;
|
||||
}
|
||||
for (int64_t x = -1; x; x <<= 1) {
|
||||
printf("i %lld->%f\n", x, (double) x);
|
||||
check1(__aeabi_l2d, x);
|
||||
y = x << 1;
|
||||
}
|
||||
printf("d %d->%f\n", y, (float) y);
|
||||
@ -392,24 +444,40 @@ int main() {
|
||||
uint32_t y;
|
||||
for(uint32_t x = 1; x; x <<= 1) {
|
||||
printf("u %u->%f\n", x, (double)x);
|
||||
check1(__aeabi_ui2d, x);
|
||||
y = x << 1;
|
||||
}
|
||||
printf("u %u->%f\n", y, (double)y);
|
||||
}
|
||||
for(int64_t x = 1; x !=0; x <<= 1u) {
|
||||
printf("%lld->%f\n", x, (double)x);
|
||||
check1(__aeabi_l2d, x);
|
||||
}
|
||||
for(double x = -4294967296.f * 4294967296.f; x<=-0.5f; x/=2.f) {
|
||||
for(double x = -4294967296.f * 4294967296.f * 2.f; x<=-0.5f; x/=2.f) {
|
||||
printf("d2i64 %f->%lld\n", x, (int64_t)x);
|
||||
if (x < INT64_MIN) {
|
||||
// seems like there is a bug in the gcc version!
|
||||
assert(__aeabi_d2lz(x) == INT64_MIN);
|
||||
} else {
|
||||
check1(__aeabi_d2lz, x);
|
||||
}
|
||||
}
|
||||
for(double x = 4294967296.f * 4294967296.f; x>=0.5f; x/=2.f) {
|
||||
for(double x = 4294967296.f * 4294967296.f * 2.f; x>=0.5f; x/=2.f) {
|
||||
printf("d2i64 %f->%lld\n", x, (int64_t)x);
|
||||
if (x >= INT64_MAX) {
|
||||
// seems like there is a bug in the gcc version!
|
||||
assert(__aeabi_d2lz(x) == INT64_MAX);
|
||||
} else {
|
||||
check1(__aeabi_d2lz, x);
|
||||
}
|
||||
}
|
||||
for(double x = -4294967296.f * 4294967296.f; x<=-0.5f; x/=2.f) {
|
||||
printf("d2i32 %f->%d\n", x, (int32_t)x);
|
||||
check1(__aeabi_d2iz, x);
|
||||
}
|
||||
for(double x = 4294967296.f * 4294967296.f; x>=0.5f; x/=2.f) {
|
||||
printf("d2i32 %f->%d\n", x, (int32_t)x);
|
||||
check1(__aeabi_d2iz, x);
|
||||
}
|
||||
|
||||
for (double x = 1; x < 11; x += 2) {
|
||||
@ -417,6 +485,8 @@ int main() {
|
||||
double g = 1.0 / x;
|
||||
printf("%g %10.18g %10.18g, %10.18g, %10.18g %10.18g\n", x, f, x + 0.37777777777777777777777777777,
|
||||
x - 0.377777777777777777777777777777, g, 123456789.0 / x);
|
||||
check2(__aeabi_dmul, x, x);
|
||||
check2(__aeabi_ddiv, 1.0, x);
|
||||
}
|
||||
|
||||
if (fail ||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <pico/float.h>
|
||||
//#include <pico/float.h>
|
||||
#include "pico/stdlib.h"
|
||||
#include "inttypes.h"
|
||||
|
||||
@ -283,12 +282,58 @@ int test_fcmpun() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define assert_nan(a) assert(isnan(a))
|
||||
#define check_nan(a) ({ assert_nan(a); a; })
|
||||
|
||||
float __aeabi_i2f(int32_t);
|
||||
float __aeabi_ui2f(int32_t);
|
||||
float __aeabi_l2f(int64_t);
|
||||
float __aeabi_ul2f(int64_t);
|
||||
int32_t __aeabi_f2iz(float);
|
||||
int64_t __aeabi_f2lz(float);
|
||||
float __aeabi_fmul(float, float);
|
||||
float __aeabi_fdiv(float, float);
|
||||
#if LIB_PICO_FLOAT_PICO
|
||||
float __real___aeabi_i2f(int);
|
||||
float __real___aeabi_ui2f(int);
|
||||
float __real___aeabi_l2f(int64_t);
|
||||
float __real___aeabi_ul2f(int64_t);
|
||||
float __real___aeabi_fmul(float, float);
|
||||
float __real___aeabi_fdiv(float, float);
|
||||
int32_t __real___aeabi_f2iz(float);
|
||||
int64_t __real___aeabi_f2lz(float);
|
||||
float __real_sqrtf(float);
|
||||
float __real_cosf(float);
|
||||
float __real_sinf(float);
|
||||
float __real_tanf(float);
|
||||
float __real_expf(float);
|
||||
float __real_logf(float);
|
||||
float __real_atan2f(float, float);
|
||||
float __real_powf(float, float);
|
||||
float __real_truncf(float);
|
||||
float __real_ldexpf(float, int);
|
||||
float __real_fmodf(float, float);
|
||||
#define EPSILON 1e-9
|
||||
#define assert_close(a, b) assert(((b - a) < EPSILON || (a - b) < EPSILON) || (isinf(a) && isinf(b) && (a < 0) == (b < 0)))
|
||||
#define check1(func,p0) ({ typeof(p0) r = func(p0), r2 = __CONCAT(__real_, func)(p0); assert(r == r2); r; })
|
||||
#define check2(func,p0,p1) ({ typeof(p0) r = func(p0,p1), r2 = __CONCAT(__real_, func)(p0,p1); assert(r == r2); r; })
|
||||
#define check_close1(func,p0) ({ typeof(p0) r = func(p0), r2 = __CONCAT(__real_, func)(p0); if (isnan(p0)) assert_nan(r); else assert_close(r, r2); r; })
|
||||
#define check_close2(func,p0,p1) ({ typeof(p0) r = func(p0,p1), r2 = __CONCAT(__real_, func)(p0,p1); if (isnan(p0) || isnan(p1)) assert_nan(r); else assert_close(r, r2); r; })
|
||||
#else
|
||||
#define check1(func,p0) func(p0)
|
||||
#define check2(func,p0,p1) func(p0,p1)
|
||||
#define check_close1(func,p0) func(p0)
|
||||
#define check_close2(func,p0,p1) func(p0,p1)
|
||||
#endif
|
||||
|
||||
double aa = 0.5;
|
||||
double bb = 1;
|
||||
|
||||
int main() {
|
||||
setup_default_uart();
|
||||
|
||||
bool fail = false;
|
||||
|
||||
printf("%d\n", aa < bb);
|
||||
for(float a = -1; a <= 1; a++) {
|
||||
for(float b = -1; b <= 1; b++) {
|
||||
@ -341,21 +386,27 @@ int main() {
|
||||
#if 1
|
||||
for (float x = 0; x < 3; x++) {
|
||||
printf("\n ----- %f\n", x);
|
||||
printf("FSQRT %10.18f\n", sqrtf(x));
|
||||
printf("FCOS %10.18f\n", cosf(x));
|
||||
printf("FSIN %10.18f\n", sinf(x));
|
||||
printf("FSQRT %10.18f\n", check_close1(sqrtf, x));
|
||||
printf("FCOS %10.18f\n", check_close1(cosf, x));
|
||||
printf("FSIN %10.18f\n", check_close1(sinf, x));
|
||||
float s, c;
|
||||
sincosf(x, &s, &c);
|
||||
printf("FSINCOS %10.18f %10.18f\n", s, c);
|
||||
printf("FTAN %10.18f\n", tanf(x));
|
||||
printf("FATAN2 %10.18f\n", atan2f(x, 10));
|
||||
printf("FATAN2 %10.18f\n", atan2f(10, x));
|
||||
printf("FEXP %10.18f\n", expf(x));
|
||||
printf("FLN %10.18f\n", logf(x));
|
||||
printf("POWF %10.18f\n", powf(x, x));
|
||||
printf("TRUNCF %10.18f\n", truncf(x));
|
||||
printf("LDEXPF %10.18f\n", ldexpf(x, x));
|
||||
printf("FMODF %10.18f\n", fmodf(x, 3.0f));
|
||||
printf("FTAN %10.18f\n", check_close1(tanf, x));
|
||||
printf("FATAN2 %10.18f\n", check_close2(atan2f, x, 10.f));
|
||||
printf("FATAN2 %10.18f\n", check_close2(atan2f, 10.f, x));
|
||||
printf("FEXP %10.18f\n", check_close1(expf, x));
|
||||
printf("FLN %10.18f\n", check_close1(logf, x));
|
||||
printf("POWF %10.18f\n", check_close2(powf, x, x));
|
||||
printf("TRUNCF %10.18f\n", check_close1(truncf, x));
|
||||
printf("LDEXPF %10.18f\n", check_close2(ldexpf, x, x));
|
||||
printf("FMODF %10.18f\n", check_close2(fmodf, x, 3.0f));
|
||||
sincosf(x, &s, &c);
|
||||
printf("SINCOS %10.18f %10.18f\n", s, c);
|
||||
if (s != sin(x) || c != cos(x)) {
|
||||
printf("SINCOS mismatch\n");
|
||||
fail = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (double x = 0; x < 3; x++) {
|
||||
@ -390,18 +441,25 @@ int main() {
|
||||
// sincosf(x, &s, &c);
|
||||
printf("FSINCOS %10.18f %10.18f\n", s, c);
|
||||
|
||||
for(int i=1; i<4; i++) {
|
||||
char buf[4];
|
||||
sprintf(buf, "%d", i);
|
||||
float f0 = -nanf(buf);
|
||||
double d0 = -nan(buf);
|
||||
// hmm
|
||||
*(uint64_t *)&d0 |= i;
|
||||
*(uint32_t *)&f0 |= i;
|
||||
float f = (float)d0;
|
||||
double d = (double)f0;
|
||||
printf("f2d %08"PRIx32" -> %g %016"PRIx64"\n", *(uint32_t*)&f0, d, *(uint64_t*)&d);
|
||||
printf("d2f %016"PRIx64" -> %f %08"PRIx32"\n", *(uint64_t*)&d0, f, *(uint32_t*)&f);
|
||||
for(int j=0;j<2;j++) {
|
||||
for (int i = 1; i < 4; i++) {
|
||||
char buf[4];
|
||||
sprintf(buf, "%d", i);
|
||||
float f0 = -nanf(buf);
|
||||
double d0 = -nan(buf);
|
||||
// hmm nanf/nan seem to ignore payload
|
||||
*(uint64_t *) &d0 |= i;
|
||||
*(uint32_t *) &f0 |= i;
|
||||
if (j) {
|
||||
// try without top bit set
|
||||
*(uint64_t *) &d0 &= ~0x0008000000000000ull;
|
||||
*(uint32_t *) &f0 &= ~0x00400000u;
|
||||
}
|
||||
float f = (float) d0;
|
||||
double d = (double) f0;
|
||||
printf("f2d %f %08"PRIx32" -> %g %016"PRIx64"\n", f0, *(uint32_t *) &f0, d, *(uint64_t *) &d);
|
||||
printf("d2f %f %016"PRIx64" -> %f %08"PRIx32"\n", d0, *(uint64_t *) &d0, f, *(uint32_t *) &f);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -413,17 +471,21 @@ int main() {
|
||||
// }
|
||||
for (int32_t x = -1; x; x <<= 1) {
|
||||
printf("i %d->%f\n", x, (float) x);
|
||||
check1(__aeabi_i2f, x);
|
||||
}
|
||||
for (int32_t x = 1; x; x <<= 1) {
|
||||
printf("i %d->%f\n", x, (float) x);
|
||||
check1(__aeabi_i2f, x);
|
||||
y = x << 1;
|
||||
}
|
||||
for (int64_t x = 1; x; x <<= 1) {
|
||||
printf("i %lld->%f\n", x, (float) x);
|
||||
check1(__aeabi_l2f, x);
|
||||
y = x << 1;
|
||||
}
|
||||
for (int64_t x = -1; x; x <<= 1) {
|
||||
printf("i %lld->%f\n", x, (float) x);
|
||||
check1(__aeabi_l2f, x);
|
||||
y = x << 1;
|
||||
}
|
||||
printf("d %d->%f\n", y, (float) y);
|
||||
@ -433,40 +495,63 @@ int main() {
|
||||
uint32_t y;
|
||||
for(uint32_t x = 1; x; x <<= 1) {
|
||||
printf("u %u->%f\n", x, (float)x);
|
||||
check1(__aeabi_ui2f, x);
|
||||
y = x << 1;
|
||||
}
|
||||
printf("u %u->%f\n", y, (float)y);
|
||||
}
|
||||
for(int64_t x = 1; x !=0; x <<= 1u) {
|
||||
printf("%lld->%f\n", x, (float)x);
|
||||
check1(__aeabi_l2f, x);
|
||||
}
|
||||
for(float x = -4294967296.f * 4294967296.f; x>=0.5f; x/=2.f) {
|
||||
printf("f %f->%lld\n", x, (int64_t)x);
|
||||
if (x < INT64_MIN) {
|
||||
// seems like there is a bug in the gcc version!
|
||||
assert(__aeabi_f2lz(x) == INT64_MIN);
|
||||
} else {
|
||||
check1(__aeabi_f2lz, x);
|
||||
}
|
||||
}
|
||||
for(float x = 4294967296.f * 4294967296.f * 2.f; x>=0.5f; x/=2.f) {
|
||||
printf("f2i64 %f->%lld\n", x, (int64_t)x);
|
||||
if (x >= INT64_MAX) {
|
||||
// seems like there is a bug in the gcc version!
|
||||
assert(__aeabi_f2lz(x) == INT64_MAX);
|
||||
} else {
|
||||
check1(__aeabi_f2lz, x);
|
||||
}
|
||||
}
|
||||
for(float x = -4294967296.f * 4294967296.f; x<=-0.5f; x/=2.f) {
|
||||
printf("d2i32 %f->%d\n", x, (int32_t)x);
|
||||
check1(__aeabi_f2iz, x);
|
||||
}
|
||||
for(float x = 4294967296.f * 4294967296.f; x>=0.5f; x/=2.f) {
|
||||
printf("f %f->%lld\n", x, (int64_t)x);
|
||||
printf("d2i32 %f->%d\n", x, (int32_t)x);
|
||||
check1(__aeabi_f2iz, x);
|
||||
}
|
||||
for (double x = 1; x < 11; x += 2) {
|
||||
double f = x * x;
|
||||
double g = 1.0 / x;
|
||||
printf("%g %10.18g %10.18g, %10.18g, %10.18g %10.18g\n", x, f, x + 0.37777777777777777777777777777,
|
||||
x - 0.377777777777777777777777777777, g, 123456789.0 / x);
|
||||
|
||||
for (float x = 1; x < 11; x += 2) {
|
||||
float f = x * x;
|
||||
float g = 1.0f / x;
|
||||
printf("%g %10.18g %10.18g, %10.18g, %10.18g %10.18g\n", x, f, x + 0.37777777777777777777777777777f,
|
||||
x - 0.377777777777777777777777777777f, g, 123456789.0f / x);
|
||||
check2(__aeabi_fmul, x, x);
|
||||
check2(__aeabi_fdiv, 1.0f, x);
|
||||
}
|
||||
if (test_cfcmpeq() || test_cfcmple() ||
|
||||
test_fcmpun() || test_cmple_gt() || test_cmplt_ge()) {
|
||||
|
||||
if (fail ||
|
||||
test_cfcmpeq() ||
|
||||
test_cfcmple() ||
|
||||
test_fcmpun() ||
|
||||
test_cmple_gt() ||
|
||||
test_cmplt_ge()) {
|
||||
printf("FAILED\n");
|
||||
return 1;
|
||||
} else {
|
||||
printf("PASSED\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (test_cfcmpeq() || test_cfcmple() ||
|
||||
test_fcmpun() || test_cmple_gt() || test_cmplt_ge()) {
|
||||
printf("FAILED\n");
|
||||
return 1;
|
||||
} else {
|
||||
printf("PASSED\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user