summaryrefslogtreecommitdiff
path: root/tests/mpc-tests.h
diff options
context:
space:
mode:
authorthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-10-31 17:10:40 +0000
committerthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-10-31 17:10:40 +0000
commit58569080d8c48bd49b1695f547c7c02fe9796084 (patch)
tree7d17bbb7682b124b168732c0f1ab7eb00052167d /tests/mpc-tests.h
parent33d1d210f37534ab949f9a4f9191d9b1963f4951 (diff)
downloadmpc-58569080d8c48bd49b1695f547c7c02fe9796084.tar.gz
mpc-tests.h: Add a new field for function properties to struct mpc_function; add field initialization to macro DECL_XX_FUNC; add a general macro DECL_FUNC replacing DECL_XX_FUNC macros that will be removed; add an identifier FUNC_PROP_SYMETRIC.
read_data.c: Use the symetry for CCC functions (halves data set). tadd.c: Declare mpc_add as a symetric function. git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@275 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/mpc-tests.h')
-rw-r--r--tests/mpc-tests.h48
1 files changed, 38 insertions, 10 deletions
diff --git a/tests/mpc-tests.h b/tests/mpc-tests.h
index 6e724d2..5fe71d6 100644
--- a/tests/mpc-tests.h
+++ b/tests/mpc-tests.h
@@ -117,72 +117,100 @@ typedef enum
CUUC /* output: mpc_t, inputs: (ulong, ulong, mpc_t) */
} func_type;
+/* properties */
+#define FUNC_PROP_NONE 0
+#define FUNC_PROP_SYMETRIC 1
+
typedef struct
{
func_ptr pointer;
func_type type;
char * name;
+ int properties;
} mpc_function;
+#define DECL_FUNC(_ftype, _fvar, _func) \
+ mpc_function _fvar; \
+ _fvar.pointer._ftype = _func; \
+ _fvar.type = _ftype; \
+ _fvar.name = QUOTE (_func); \
+ _fvar.properties = FUNC_PROP_NONE;
+
#define DECL_CC_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.CC = (func); \
(fvar).type = CC; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
#define DECL_V_CC_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.V_CC = (func); \
(fvar).type = V_CC; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
#define DECL_FC_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.FC = (func); \
(fvar).type = FC; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
#define DECL_CFC_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.CFC = (func); \
(fvar).type = CFC; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
#define DECL_CCF_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.CCF = (func); \
(fvar).type = CCF; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
+
#define DECL_CCC_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.CCC = (func); \
(fvar).type = CCC; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
+
#define DECL_CCU_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.CCU = (func); \
(fvar).type = CCU; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
+
#define DECL_CUC_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.CUC = (func); \
(fvar).type = CUC; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
+
#define DECL_CCS_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.CCS = (func); \
(fvar).type = CCS; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
+
#define DECL_CUUC_FUNC(fvar, func) \
mpc_function (fvar); \
(fvar).pointer.CUUC = (func); \
(fvar).type = CUUC; \
- (fvar).name = QUOTE (func);
+ (fvar).name = QUOTE (func); \
+ (fvar).properties = 0;
+
/* tgeneric(mpc_function, prec_min, prec_max, step, exp_max) checks rounding
with random numbers: