[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/12] tcg: Drop gen_io_end()
From: |
Mark Cave-Ayland |
Subject: |
[PULL 02/12] tcg: Drop gen_io_end() |
Date: |
Wed, 8 Sep 2021 12:54:41 +0100 |
From: Peter Maydell <peter.maydell@linaro.org>
Now we have removed all the uses of gen_io_end() from target frontends,
the only callsite is inside gen_tb_start(). Inline the code there,
and remove the reference to it from the documentation.
While we are inlining the code, switch it to use tcg_constant_i32()
so we don't have to manually create and destroy a TCG temporary.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210724134902.7785-3-peter.maydell@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
docs/devel/tcg-icount.rst | 3 ---
include/exec/gen-icount.h | 27 ++++++++++-----------------
2 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/docs/devel/tcg-icount.rst b/docs/devel/tcg-icount.rst
index 8d67b6c076..50c8e8dabc 100644
--- a/docs/devel/tcg-icount.rst
+++ b/docs/devel/tcg-icount.rst
@@ -92,6 +92,3 @@ When the translator is handling an instruction of this kind:
}
* it must end the TB immediately after this instruction
-
-Note that some older front-ends call a "gen_io_end()" function:
-this is obsolete and should not be used.
diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h
index 467529d84c..610cba58fe 100644
--- a/include/exec/gen-icount.h
+++ b/include/exec/gen-icount.h
@@ -17,22 +17,6 @@ static inline void gen_io_start(void)
tcg_temp_free_i32(tmp);
}
-/*
- * cpu->can_do_io is cleared automatically at the beginning of
- * each translation block. The cost is minimal and only paid
- * for -icount, plus it would be very easy to forget doing it
- * in the translator. Therefore, backends only need to call
- * gen_io_start.
- */
-static inline void gen_io_end(void)
-{
- TCGv_i32 tmp = tcg_const_i32(0);
- tcg_gen_st_i32(tmp, cpu_env,
- offsetof(ArchCPU, parent_obj.can_do_io) -
- offsetof(ArchCPU, env));
- tcg_temp_free_i32(tmp);
-}
-
static inline void gen_tb_start(const TranslationBlock *tb)
{
TCGv_i32 count;
@@ -64,7 +48,16 @@ static inline void gen_tb_start(const TranslationBlock *tb)
tcg_gen_st16_i32(count, cpu_env,
offsetof(ArchCPU, neg.icount_decr.u16.low) -
offsetof(ArchCPU, env));
- gen_io_end();
+ /*
+ * cpu->can_do_io is cleared automatically here at the beginning of
+ * each translation block. The cost is minimal and only paid for
+ * -icount, plus it would be very easy to forget doing it in the
+ * translator. Doing it here means we don't need a gen_io_end() to
+ * go with gen_io_start().
+ */
+ tcg_gen_st_i32(tcg_constant_i32(0), cpu_env,
+ offsetof(ArchCPU, parent_obj.can_do_io) -
+ offsetof(ArchCPU, env));
}
tcg_temp_free_i32(count);
--
2.20.1
- [PULL 00/12] qemu-sparc queue 20210908, Mark Cave-Ayland, 2021/09/08
- [PULL 01/12] target/sparc: Drop use of gen_io_end(), Mark Cave-Ayland, 2021/09/08
- [PULL 02/12] tcg: Drop gen_io_end(),
Mark Cave-Ayland <=
- [PULL 03/12] sun4m: fix setting CPU id when more than one CPU is present, Mark Cave-Ayland, 2021/09/08
- [PULL 04/12] escc: checkpatch fixes, Mark Cave-Ayland, 2021/09/08
- [PULL 05/12] escc: reset register values to zero in escc_reset(), Mark Cave-Ayland, 2021/09/08
- [PULL 06/12] escc: introduce escc_soft_reset_chn() for software reset, Mark Cave-Ayland, 2021/09/08
- [PULL 07/12] escc: introduce escc_hard_reset_chn() for hardware reset, Mark Cave-Ayland, 2021/09/08
- [PULL 08/12] escc: implement soft reset as described in the datasheet, Mark Cave-Ayland, 2021/09/08
- [PULL 09/12] escc: implement hard reset as described in the datasheet, Mark Cave-Ayland, 2021/09/08
- [PULL 10/12] escc: remove register changes from escc_reset_chn(), Mark Cave-Ayland, 2021/09/08
- [PULL 11/12] escc: re-use escc_reset_chn() for soft reset, Mark Cave-Ayland, 2021/09/08
- [PULL 12/12] escc: fix STATUS_SYNC bit in R_STATUS register, Mark Cave-Ayland, 2021/09/08