summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBassam Tabbara <bassam@symform.com>2016-09-02 17:19:04 -0700
committerBassam Tabbara <bassam@symform.com>2016-09-13 12:24:25 -0700
commit87f0d4395dbfe0ae559e964668b71f85819378a0 (patch)
tree3566aad3cb41128a71a1a3f8602e181accdafdf2 /include
parent22352ca094e242d7c93a2ed822f89a07eeb34c1a (diff)
downloadgf-complete-87f0d4395dbfe0ae559e964668b71f85819378a0.tar.gz
Add support for printing functions selected in gf_init
There is currently no way to figure out which functions were selected during gf_init and as a result of SIMD options. This is not even possible in gdb since most functions are static. This commit adds a new macro SET_FUNCTION that records the name of the function selected during init inside the gf_internal structure. This macro only works when DEBUG_FUNCTIONS is defined during compile. Otherwise the code works exactly as it did before this change. The names of selected functions will be used during testing of SIMD runtime detection. All calls such as: gf->multiply.w32 = gf_w16_shift_multiply; need to be replaced with the following: SET_FUNCTION(gf,multiply,w32,gf_w16_shift_multiply) Also added a new flag to tools/gf_methods that will print the names of functions selected during gf_init.
Diffstat (limited to 'include')
-rw-r--r--include/gf_int.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/gf_int.h b/include/gf_int.h
index 32866f4..0356920 100644
--- a/include/gf_int.h
+++ b/include/gf_int.h
@@ -30,8 +30,24 @@ typedef struct {
int arg2;
gf_t *base_gf;
void *private;
+#ifdef DEBUG_FUNCTIONS
+ const char *multiply;
+ const char *divide;
+ const char *inverse;
+ const char *multiply_region;
+ const char *extract_word;
+#endif
} gf_internal_t;
+#ifdef DEBUG_FUNCTIONS
+#define SET_FUNCTION(gf,method,size,func) \
+ { (gf)->method.size = (func); \
+ ((gf_internal_t*)(gf)->scratch)->method = #func; }
+#else
+#define SET_FUNCTION(gf,method,size,func) \
+ (gf)->method.size = (func);
+#endif
+
extern int gf_w4_init (gf_t *gf);
extern int gf_w4_scratch_size(int mult_type, int region_type, int divide_type, int arg1, int arg2);