aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-04-12 16:57:24 +0000
committerMike Frysinger <vapier@gentoo.org>2010-04-12 16:57:24 +0000
commit58f03a4028987eef6b222b41d49e1f5781510b7c (patch)
tree8623abb0680c651ac001b3b9eede3d48cb2b5579 /sim
parent21cf617c69031111357d78c1fe10746fe5ef4f6e (diff)
downloadfsf-binutils-gdb-58f03a4028987eef6b222b41d49e1f5781510b7c.zip
fsf-binutils-gdb-58f03a4028987eef6b222b41d49e1f5781510b7c.tar.gz
fsf-binutils-gdb-58f03a4028987eef6b222b41d49e1f5781510b7c.tar.bz2
sim: add helper macros for branch profiling
The profile code has a lot of helper macros already, but none yet for the branch profiling code. So add ones for the basic functions -- taken and untaken branches. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim')
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/sim-profile.h16
2 files changed, 21 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 4e0aaf0b..71f4613 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,10 @@
2010-04-12 Mike Frysinger <vapier@gentoo.org>
+ * sim-profile.h (PROFILE_BRANCH_TAKEN, PROFILE_BRANCH_UNTAKEN): New
+ defines.
+
+2010-04-12 Mike Frysinger <vapier@gentoo.org>
+
* dv-core.c (dv_core_descriptor): Add NULL initializer.
* dv-glue.c (hw_glue_ports, dv_glue_descriptor): Likewise.
* dv-pal.c (hw_pal_ports, dv_pal_descriptor): Likewise.
diff --git a/sim/common/sim-profile.h b/sim/common/sim-profile.h
index 315a79f..c35fe0c 100644
--- a/sim/common/sim-profile.h
+++ b/sim/common/sim-profile.h
@@ -290,6 +290,22 @@ do { \
#define PROFILE_COUNT_CORE(cpu, addr, size, map)
#endif /* ! core */
+#if WITH_PROFILE_MODEL_P
+#define PROFILE_BRANCH_TAKEN(cpu) \
+do { \
+ if (PROFILE_MODEL_P (cpu)) \
+ ++ PROFILE_MODEL_TAKEN_COUNT (CPU_PROFILE_DATA (cpu)); \
+} while (0)
+#define PROFILE_BRANCH_UNTAKEN(cpu) \
+do { \
+ if (PROFILE_MODEL_P (cpu)) \
+ ++ PROFILE_MODEL_UNTAKEN_COUNT (CPU_PROFILE_DATA (cpu)); \
+} while (0)
+#else
+#define PROFILE_BRANCH_TAKEN(cpu)
+#define PROFILE_BRANCH_UNTAKEN(cpu)
+#endif /* ! model */
+
/* Misc. utilities. */
extern void sim_profile_print_bar (SIM_DESC, unsigned int, unsigned int, unsigned int);