Path: blob/main/contrib/arm-optimized-routines/math/include/test_sig.h
48254 views
/*1* Macros for emitting various ulp/bench entries based on function signature2*3* Copyright (c) 2024, Arm Limited.4* SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception.5*/67#define TEST_DECL_SF1(fun) float fun##f (float);8#define TEST_DECL_SF2(fun) float fun##f (float, float);9#define TEST_DECL_SD1(fun) double fun (double);10#define TEST_DECL_SD2(fun) double fun (double, double);1112#define TEST_DECL_VF1(fun) \13float32x4_t VPCS_ATTR V_NAME_F1 (fun##f) (float32x4_t);14#define TEST_DECL_VF2(fun) \15float32x4_t VPCS_ATTR V_NAME_F2 (fun##f) (float32x4_t, float32x4_t);16#define TEST_DECL_VD1(fun) VPCS_ATTR float64x2_t V_NAME_D1 (fun) (float64x2_t);17#define TEST_DECL_VD2(fun) \18VPCS_ATTR float64x2_t V_NAME_D2 (fun) (float64x2_t, float64x2_t);1920#define TEST_DECL_SVF1(fun) \21svfloat32_t SV_NAME_F1 (fun) (svfloat32_t, svbool_t);22#define TEST_DECL_SVF2(fun) \23svfloat32_t SV_NAME_F2 (fun) (svfloat32_t, svfloat32_t, svbool_t);24#define TEST_DECL_SVD1(fun) \25svfloat64_t SV_NAME_D1 (fun) (svfloat64_t, svbool_t);26#define TEST_DECL_SVD2(fun) \27svfloat64_t SV_NAME_D2 (fun) (svfloat64_t, svfloat64_t, svbool_t);2829/* For building the routines, emit function prototype from TEST_SIG. This30ensures that the correct signature has been chosen (wrong one will be a31compile error). TEST_SIG is defined differently by various components of the32build system to emit entries in the wrappers and entries for mathbench and33ulp. */34#ifndef _TEST_SIG35# if defined(EMIT_ULP_FUNCS)36# define _TEST_SIG(v, t, a, f, ...) TEST_SIG _Z##v##t##a (f)37# elif defined(EMIT_ULP_WRAPPERS)38# define _TEST_SIG(v, t, a, f, ...) TEST_SIG Z##v##N##t##a##_WRAP (f)39# elif defined(EMIT_MATHBENCH_FUNCS)40# define _TEST_SIG(v, t, a, f, ...) TEST_SIG _Z##v##t##a (f, ##__VA_ARGS__)41# else42# define _TEST_SIG(v, t, a, f, ...) TEST_DECL_##v##t##a (f)43# endif44#endif4546#define TEST_SIG(...) _TEST_SIG (__VA_ARGS__)474849