2 * This file contains macros to update ia32 firm statistics
3 * @author Christian Wuerdig
6 #ifndef _IA32_DBG_STAT_H_
7 #define _IA32_DBG_STAT_H_
10 #include "dbginfo_t.h"
13 #define SIZ(x) sizeof(x)/sizeof((x)[0])
16 * Merge the debug info due to a LEA creation.
18 * @param oldn the node
19 * @param n the new lea
21 #define DBG_OPT_LEA1(oldn, n) \
23 hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_LEA); \
24 __dbg_info_merge_pair(n, oldn, dbg_backend); \
28 * Merge the debug info due to a LEA creation.
30 * @param oldn the node
31 * @param n the new lea
33 #define DBG_OPT_LEA1(oldn, n) \
35 hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_LEA); \
36 __dbg_info_merge_pair(n, oldn, dbg_backend); \
40 * Merge the debug info due to a LEA creation.
42 * @param oldn1 the old node
43 * @param oldn2 an additional old node
44 * @param n the new lea
46 #define DBG_OPT_LEA2(oldn1, oldn2, n) \
51 hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \
52 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \
56 * Merge the debug info due to a LEA creation.
58 * @param oldn1 the old node
59 * @param oldn2 an additional old node
60 * @param oldn3 an additional old node
61 * @param n the new lea
63 #define DBG_OPT_LEA3(oldn1, oldn2, oldn3, n) \
69 hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \
70 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \
74 * Merge the debug info due to a LEA creation.
76 * @param oldn1 the old node
77 * @param oldn2 an additional old node
78 * @param oldn3 an additional old node
79 * @param oldn4 an additional old node
80 * @param n the new lea
82 #define DBG_OPT_LEA4(oldn1, oldn2, oldn3, oldn4, n) \
89 hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \
90 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \
94 * Merge the debug info due to a Load with LEA creation.
97 * @param n the new load
99 #define DBG_OPT_LOAD_LEA(oldn, n) \
101 hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_LOAD_LEA); \
102 __dbg_info_merge_pair(n, oldn, dbg_backend); \
106 * Merge the debug info due to a Store with LEA creation.
108 * @param oldn the lea
109 * @param n the new store
111 #define DBG_OPT_STORE_LEA(oldn, n) \
113 hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_STORE_LEA); \
114 __dbg_info_merge_pair(n, oldn, dbg_backend); \
118 * Merge the debug info due to a source address mode creation.
120 * @param oldn the old load
121 * @param n the new op
123 #define DBG_OPT_AM_S(oldn, n) \
125 hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_AM_S); \
126 __dbg_info_merge_pair(n, oldn, dbg_backend); \
130 * Merge the debug info due to a destination address mode creation.
132 * @param load the old load
133 * @param store yhe old store
134 * @param n the new op
136 #define DBG_OPT_AM_D(load, store, n) \
141 hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_AM_D); \
142 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \
146 * A CJmp was created to save a cmp
148 * @param oldn the old node
150 #define DBG_OPT_CJMP(oldn) \
152 hook_merge_nodes(NULL, 0, &oldn, 1, FS_BE_IA32_CJMP); \
156 #endif /* _IA32_DBG_STAT_H_ */