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); \
29 * Merge the debug info due to a LEA creation.
31 * @param oldn1 the old node
32 * @param oldn2 an additional old node
33 * @param n the new lea
35 #define DBG_OPT_LEA2(oldn1, oldn2, n) \
40 hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \
41 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \
45 * Merge the debug info due to a LEA creation.
47 * @param oldn1 the old node
48 * @param oldn2 an additional old node
49 * @param oldn3 an additional old node
50 * @param n the new lea
52 #define DBG_OPT_LEA3(oldn1, oldn2, oldn3, n) \
58 hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \
59 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \
63 * Merge the debug info due to a LEA creation.
65 * @param oldn1 the old node
66 * @param oldn2 an additional old node
67 * @param oldn3 an additional old node
68 * @param oldn4 an additional old node
69 * @param n the new lea
71 #define DBG_OPT_LEA4(oldn1, oldn2, oldn3, oldn4, n) \
78 hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \
79 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \
83 * Merge the debug info due to a Load with LEA creation.
86 * @param n the new load
88 #define DBG_OPT_LOAD_LEA(oldn, n) \
90 hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_LOAD_LEA); \
91 __dbg_info_merge_pair(n, oldn, dbg_backend); \
95 * Merge the debug info due to a Store with LEA creation.
98 * @param n the new store
100 #define DBG_OPT_STORE_LEA(oldn, n) \
102 hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_STORE_LEA); \
103 __dbg_info_merge_pair(n, oldn, dbg_backend); \
107 * Merge the debug info due to a source address mode creation.
109 * @param oldn the old load
110 * @param n the new op
112 #define DBG_OPT_AM_S(oldn, n) \
114 hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_AM_S); \
115 __dbg_info_merge_pair(n, oldn, dbg_backend); \
119 * Merge the debug info due to a destination address mode creation.
121 * @param load the old load
122 * @param store yhe old store
123 * @param n the new op
125 #define DBG_OPT_AM_D(load, store, n) \
130 hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_AM_D); \
131 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \
134 #endif /* _IA32_DBG_STAT_H_ */