Path: blob/main/contrib/arm-optimized-routines/math/test/rtest/intern.h
48375 views
/*1* intern.h2*3* Copyright (c) 1999-2019, Arm Limited.4* SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception5*/67#ifndef mathtest_intern_h8#define mathtest_intern_h910#include <mpfr.h>11#include <mpc.h>1213#include "types.h"14#include "wrappers.h"1516/* Generic function pointer. */17typedef void (*funcptr)(void);1819/* Pointers to test function types. */20typedef int (*testfunc1)(mpfr_t, mpfr_t, mpfr_rnd_t);21typedef int (*testfunc2)(mpfr_t, mpfr_t, mpfr_t, mpfr_rnd_t);22typedef int (*testrred)(mpfr_t, mpfr_t, int *);23typedef char * (*testsemi1)(uint32 *, uint32 *);24typedef char * (*testsemi2)(uint32 *, uint32 *, uint32 *);25typedef char * (*testsemi2f)(uint32 *, uint32 *, uint32 *);26typedef char * (*testldexp)(uint32 *, uint32 *, uint32 *);27typedef char * (*testfrexp)(uint32 *, uint32 *, uint32 *);28typedef char * (*testmodf)(uint32 *, uint32 *, uint32 *);29typedef char * (*testclassify)(uint32 *, uint32 *);30typedef char * (*testclassifyf)(uint32 *, uint32 *);3132typedef int (*testfunc1c)(mpc_t, mpc_t, mpc_rnd_t);33typedef int (*testfunc2c)(mpc_t, mpc_t, mpc_t, mpc_rnd_t);3435typedef int (*testfunc1cr)(mpfr_t, mpc_t, mpfr_rnd_t);3637/* Pointer to a function that generates random test cases. */38typedef void (*casegen)(uint32 *, uint32, uint32);3940/*41* List of testable functions, their types, and their testable range.42*/43enum {44args1, /* afloat-based, one argument */45args1f, /* same as args1 but in single prec */46args2, /* afloat-based, two arguments */47args2f, /* same as args2 but in single prec */48rred, /* afloat-based, one arg, aux return */49rredf, /* same as rred but in single prec */50semi1, /* seminumerical, one argument */51semi1f, /* seminumerical, 1 arg, float */52semi2, /* seminumerical, two arguments */53semi2f, /* seminumerical, 2 args, floats */54t_ldexp, /* dbl * int -> dbl */55t_ldexpf, /* sgl * int -> sgl */56t_frexp, /* dbl -> dbl * int */57t_frexpf, /* sgl -> sgl * int */58t_modf, /* dbl -> dbl * dbl */59t_modff, /* sgl -> sgl * sgl */60classify, /* classify double: dbl -> int */61classifyf, /* classify float: flt -> int */62compare, /* compare doubles, returns int */63comparef, /* compare floats, returns int */6465args1c, /* acomplex-base, one argument */66args2c,67args1fc,68args2fc,69args1cr, /* dbl-complex -> complex */70args1fcr /* sgl-complex -> complex */71};7273typedef struct __testable Testable;74struct __testable {75char *name;76funcptr func;77int type;78wrapperfunc wrappers[MAXWRAPPERS];79casegen cases; /* complex functions use the same casegen for both real and complex args */80uint32 caseparam1, caseparam2;81};8283extern Testable functions[];84extern const int nfunctions;8586extern void init_pi(void);8788int nargs_(Testable* f);8990#endif919293