diff options
Diffstat (limited to 'contrib/arm-optimized-routines/math/test/rtest')
10 files changed, 54 insertions, 11 deletions
diff --git a/contrib/arm-optimized-routines/math/test/rtest/dotest.c b/contrib/arm-optimized-routines/math/test/rtest/dotest.c index 6be79e1df0d1..dd8ceb068141 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/dotest.c +++ b/contrib/arm-optimized-routines/math/test/rtest/dotest.c @@ -1,8 +1,8 @@ /* * dotest.c - actually generate mathlib test cases * - * Copyright (c) 1999-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * Copyright (c) 1999-2024, Arm Limited. + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #include <stdio.h> @@ -18,6 +18,35 @@ #define MPFR_PREC 96 /* good enough for float or double + a few extra bits */ +#if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0) +int +mpfr_tanpi (mpfr_t ret, const mpfr_t arg, mpfr_rnd_t rnd) +{ + MPFR_DECL_INIT (frd, MPFR_PREC); + mpfr_const_pi (frd, GMP_RNDN); + mpfr_mul (frd, frd, arg, GMP_RNDN); + return mpfr_tan (ret, frd, GMP_RNDN); +} + +int +mpfr_sinpi (mpfr_t ret, const mpfr_t arg, mpfr_rnd_t rnd) +{ + MPFR_DECL_INIT (frd, MPFR_PREC); + mpfr_const_pi (frd, GMP_RNDN); + mpfr_mul (frd, frd, arg, GMP_RNDN); + return mpfr_sin (ret, frd, GMP_RNDN); +} + +int +mpfr_cospi (mpfr_t ret, const mpfr_t arg, mpfr_rnd_t rnd) +{ + MPFR_DECL_INIT (frd, MPFR_PREC); + mpfr_const_pi (frd, GMP_RNDN); + mpfr_mul (frd, frd, arg, GMP_RNDN); + return mpfr_cos (ret, frd, GMP_RNDN); +} +#endif + extern int lib_fo, lib_no_arith, ntests; /* @@ -454,6 +483,7 @@ void universal_wrapper(wrapperctx *ctx) } } +/* clang-format off */ Testable functions[] = { /* * Trig functions: sin, cos, tan. We test the core function @@ -479,6 +509,18 @@ Testable functions[] = { cases_uniform_float, 0x39800000, 0x41800000}, {"sincosf_cosf", (funcptr)mpfr_cos, args1f, {NULL}, cases_uniform_float, 0x39800000, 0x41800000}, + {"sinpi", (funcptr)mpfr_sinpi, args1, {NULL}, + cases_uniform, 0x3e400000, 0x40300000}, + {"sinpif", (funcptr)mpfr_sinpi, args1f, {NULL}, + cases_uniform_float, 0x39800000, 0x41800000}, + {"cospi", (funcptr)mpfr_cospi, args1, {NULL}, + cases_uniform, 0x3e400000, 0x40300000}, + {"cospif", (funcptr)mpfr_cospi, args1f, {NULL}, + cases_uniform_float, 0x39800000, 0x41800000}, + {"tanpi", (funcptr)mpfr_tanpi, args1, {NULL}, + cases_uniform, 0x3e400000, 0x40300000}, + {"tanpif", (funcptr)mpfr_tanpi, args1f, {NULL}, + cases_uniform_float, 0x39800000, 0x41800000}, /* * Inverse trig: asin, acos. Between 1 and -1, of course. acos * goes down to 2^-54, asin to 2^-27. @@ -708,6 +750,7 @@ Testable functions[] = { {"tgammaf", (funcptr)mpfr_gamma, args1f, {NULL}, cases_uniform_float, 0x2f800000, 0x43000000}, {"tgamma", (funcptr)mpfr_gamma, args1, {NULL}, cases_uniform, 0x3c000000, 0x40800000}, }; +/* clang-format on */ const int nfunctions = ( sizeof(functions)/sizeof(*functions) ); diff --git a/contrib/arm-optimized-routines/math/test/rtest/intern.h b/contrib/arm-optimized-routines/math/test/rtest/intern.h index 12a9c749e18e..3ebd7ddaf85d 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/intern.h +++ b/contrib/arm-optimized-routines/math/test/rtest/intern.h @@ -2,7 +2,7 @@ * intern.h * * Copyright (c) 1999-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #ifndef mathtest_intern_h diff --git a/contrib/arm-optimized-routines/math/test/rtest/main.c b/contrib/arm-optimized-routines/math/test/rtest/main.c index 0d8ead891320..3d533c946f79 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/main.c +++ b/contrib/arm-optimized-routines/math/test/rtest/main.c @@ -2,7 +2,7 @@ * main.c * * Copyright (c) 1999-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #include <assert.h> diff --git a/contrib/arm-optimized-routines/math/test/rtest/random.c b/contrib/arm-optimized-routines/math/test/rtest/random.c index 56123966b8c4..1de32580b733 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/random.c +++ b/contrib/arm-optimized-routines/math/test/rtest/random.c @@ -2,7 +2,7 @@ * random.c - random number generator for producing mathlib test cases * * Copyright (c) 1998-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #include "types.h" diff --git a/contrib/arm-optimized-routines/math/test/rtest/random.h b/contrib/arm-optimized-routines/math/test/rtest/random.h index b4b22df82a3d..0b477d72b234 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/random.h +++ b/contrib/arm-optimized-routines/math/test/rtest/random.h @@ -2,7 +2,7 @@ * random.h - header for random.c * * Copyright (c) 2009-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #include "types.h" diff --git a/contrib/arm-optimized-routines/math/test/rtest/semi.c b/contrib/arm-optimized-routines/math/test/rtest/semi.c index c9f0daf76508..70a7844a48d6 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/semi.c +++ b/contrib/arm-optimized-routines/math/test/rtest/semi.c @@ -2,7 +2,7 @@ * semi.c: test implementations of mathlib seminumerical functions * * Copyright (c) 1999-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #include <stdio.h> diff --git a/contrib/arm-optimized-routines/math/test/rtest/semi.h b/contrib/arm-optimized-routines/math/test/rtest/semi.h index 17dc4158fb51..7a1444e55d28 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/semi.h +++ b/contrib/arm-optimized-routines/math/test/rtest/semi.h @@ -2,7 +2,7 @@ * semi.h: header for semi.c * * Copyright (c) 1999-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #ifndef test_semi_h diff --git a/contrib/arm-optimized-routines/math/test/rtest/types.h b/contrib/arm-optimized-routines/math/test/rtest/types.h index 53cd557fa4cf..e15b4e06a0d4 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/types.h +++ b/contrib/arm-optimized-routines/math/test/rtest/types.h @@ -2,7 +2,7 @@ * types.h * * Copyright (c) 2005-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #ifndef mathtest_types_h diff --git a/contrib/arm-optimized-routines/math/test/rtest/wrappers.c b/contrib/arm-optimized-routines/math/test/rtest/wrappers.c index de45ac5768d0..441017192ab4 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/wrappers.c +++ b/contrib/arm-optimized-routines/math/test/rtest/wrappers.c @@ -2,7 +2,7 @@ * wrappers.c - wrappers to modify output of MPFR/MPC test functions * * Copyright (c) 2014-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ #include <assert.h> diff --git a/contrib/arm-optimized-routines/math/test/rtest/wrappers.h b/contrib/arm-optimized-routines/math/test/rtest/wrappers.h index 7b09c85a59f1..0a8a58777d8a 100644 --- a/contrib/arm-optimized-routines/math/test/rtest/wrappers.h +++ b/contrib/arm-optimized-routines/math/test/rtest/wrappers.h @@ -2,7 +2,7 @@ * wrappers.h - wrappers to modify output of MPFR/MPC test functions * * Copyright (c) 2014-2019, Arm Limited. - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ typedef struct { |