Hi Sébastien
On 16 September 2015 at 22:47, Sébastien Villemot <[email protected]> wrote:
> It builds, but I am not sure it works.
I wrote the attached test program and built openspecfun on amd64,
armhf and ppc64el.
All versions output the same results.
> There is some low level stuff in
> the rem_pio2/ directory. For example, in rem_pio2/fpmath.h, there is
> this comment: "Currently assumes Intel platform", followed by an
> alternative that seems to assume either amd64 or i386.
Note that if the platform is neither x86_64 nor i386, then neither
amd64_fpmath.h nor i386_fpmath.h is included.
In fact, the things that are defined in these headers don't seem to be
used anywhere in rem_pio2, and removing them didn't seem to have any
effect on the results.
Please consider again allowing builds on all architectures.
Regards
Graham
#include <stdio.h>
#include <math.h>
#include "../openspecfun-0.4/rem_pio2/math_private.h"
void test__ieee754_rem_pio2(void)
{
double pi, x, y[2];
int i;
printf("__ieee754_rem_pio2()\n");
pi = 4 * atan(1);
for(i = 0; i < 17; i++) {
x = 2 * pi * i / 16;
__ieee754_rem_pio2(x, y);
printf("x=%f, y[0]=%f, y[1]=%f\n", x, y[0], y[1]);
}
}
void test__ieee754_rem_pio2f(void)
{
double pi, x, y;
int i;
printf("__ieee754_rem_pio2f()\n");
pi = 4 * atan(1);
for(i = 0; i < 17; i++) {
x = 2 * pi * i / 16;
__ieee754_rem_pio2f(x, &y);
printf("x=%f, y=%f\n", x, y);
}
}
void test__kernel_rem_pio2(void)
{
double pi, x[1], y[4];
int i, e0, nx, prec;
printf("__kernel_rem_pio2()\n");
pi = 4 * atan(1);
e0 = 0;
nx = 1;
prec = 1;
for(i = 1; i < 17; i++) {
x[0] = 2 * pi * i / 16;
__kernel_rem_pio2(x, y, e0, nx, prec);
printf("x[0]=%f, y[0]=%f\n", x[0], y[0]);
}
}
void main(void)
{
test__ieee754_rem_pio2();
test__ieee754_rem_pio2f();
test__kernel_rem_pio2();
}