diff options
author | Tristan Gingold <gingold@adacore.com> | 2011-02-15 09:39:54 +0100 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@petalogix.com> | 2011-02-16 15:35:32 +0100 |
commit | 630ecca0da959e65acad1ee0bf3a631bbb7ee052 (patch) | |
tree | 652b76a9ac152d84a288cf738f93ec96d80881bb /target-ppc | |
parent | 459505a2647a5197cb60ad48a05917f6d8e52695 (diff) |
Handle icount for powerpc tbl/tbu/decr load and store.
Handle option '-icount X' on powerpc targets.
Signed-off-by: Tristan Gingold <gingold@adacore.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/translate_init.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index dfcd94980f..7c08b1cb09 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -154,12 +154,26 @@ static void spr_read_ureg (void *opaque, int gprn, int sprn) #if !defined(CONFIG_USER_ONLY) static void spr_read_decr (void *opaque, int gprn, int sprn) { + if (use_icount) { + gen_io_start(); + } gen_helper_load_decr(cpu_gpr[gprn]); + if (use_icount) { + gen_io_end(); + gen_stop_exception(opaque); + } } static void spr_write_decr (void *opaque, int sprn, int gprn) { + if (use_icount) { + gen_io_start(); + } gen_helper_store_decr(cpu_gpr[gprn]); + if (use_icount) { + gen_io_end(); + gen_stop_exception(opaque); + } } #endif @@ -167,12 +181,26 @@ static void spr_write_decr (void *opaque, int sprn, int gprn) /* Time base */ static void spr_read_tbl (void *opaque, int gprn, int sprn) { + if (use_icount) { + gen_io_start(); + } gen_helper_load_tbl(cpu_gpr[gprn]); + if (use_icount) { + gen_io_end(); + gen_stop_exception(opaque); + } } static void spr_read_tbu (void *opaque, int gprn, int sprn) { + if (use_icount) { + gen_io_start(); + } gen_helper_load_tbu(cpu_gpr[gprn]); + if (use_icount) { + gen_io_end(); + gen_stop_exception(opaque); + } } __attribute__ (( unused )) @@ -190,12 +218,26 @@ static void spr_read_atbu (void *opaque, int gprn, int sprn) #if !defined(CONFIG_USER_ONLY) static void spr_write_tbl (void *opaque, int sprn, int gprn) { + if (use_icount) { + gen_io_start(); + } gen_helper_store_tbl(cpu_gpr[gprn]); + if (use_icount) { + gen_io_end(); + gen_stop_exception(opaque); + } } static void spr_write_tbu (void *opaque, int sprn, int gprn) { + if (use_icount) { + gen_io_start(); + } gen_helper_store_tbu(cpu_gpr[gprn]); + if (use_icount) { + gen_io_end(); + gen_stop_exception(opaque); + } } __attribute__ (( unused )) |