math: add fenv test and new 'add' function in gen
[libc-test] / src / math / gen / mp.c
index 48492c1..be2ed39 100644 (file)
@@ -123,7 +123,7 @@ static void genf(struct t *p, mpfr_t my, int t, int r)
 
        t = adjust(mr, my, t, r);
        p->y = mpfr_get_flt(mr, r);
-       p->e = eflags(isnan(p->x) || isnan(p->x2));
+       p->e = eflags(isnan(p->x) || isnan(p->x2) || isnan(p->x3));
        i = eulpf(p->y);
        if (!isfinite(p->y)) {
                p->dy = 0;
@@ -193,7 +193,7 @@ static void gend(struct t *p, mpfr_t my, int t, int r)
 
        t = adjust(mr, my, t, r);
        p->y = mpfr_get_d(mr, r);
-       p->e = eflags(isnan(p->x) || isnan(p->x2));
+       p->e = eflags(isnan(p->x) || isnan(p->x2) || isnan(p->x3));
        i = eulp(p->y);
        if (!isfinite(p->y)) {
                p->dy = 0;
@@ -268,7 +268,7 @@ static void genl(struct t *p, mpfr_t my, int t, int r)
 
        t = adjust(mr, my, t, r);
        p->y = mpfr_get_ld(mr, r);
-       p->e = eflags(isnan(p->x) || isnan(p->x2));
+       p->e = eflags(isnan(p->x) || isnan(p->x2) || isnan(p->x3));
        i = eulpl(p->y);
        if (!isfinite(p->y)) {
                p->dy = 0;
@@ -391,6 +391,8 @@ static int wrap_pow10(mpfr_t my, const mpfr_t mx, mpfr_rnd_t r)
        return mpfr_ui_pow(my, 10, mx, r);
 }
 
+int mpadd(struct t *t) { return mpd2(t, mpfr_add); }
+
 int mpacos(struct t *t) { return mpd1(t, mpfr_acos); }
 int mpacosf(struct t *t) { return mpf1(t, mpfr_acos); }
 int mpacosl(struct t *t) { return mpl1(t, mpfr_acos); }