[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 07/12] target/arm: Introduce store_cpu_field_constant() helper
From: |
Richard Henderson |
Subject: |
[PULL v2 07/12] target/arm: Introduce store_cpu_field_constant() helper |
Date: |
Tue, 2 Nov 2021 14:25:14 -0400 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Similarly to the store_cpu_field() helper which takes a TCG
temporary, store its value to the CPUState, introduce the
store_cpu_field_constant() helper which store a constant to
CPUState (without using any TCG temporary).
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211029231834.2476117-3-f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-a32.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/arm/translate-a32.h b/target/arm/translate-a32.h
index 88f15df60e..17af8dc95a 100644
--- a/target/arm/translate-a32.h
+++ b/target/arm/translate-a32.h
@@ -70,6 +70,9 @@ static inline void store_cpu_offset(TCGv_i32 var, int offset)
#define store_cpu_field(var, name) \
store_cpu_offset(var, offsetof(CPUARMState, name))
+#define store_cpu_field_constant(val, name) \
+ tcg_gen_st_i32(tcg_constant_i32(val), cpu_env, offsetof(CPUARMState, name))
+
/* Create a new temporary and set it to the value of a CPU register. */
static inline TCGv_i32 load_reg(DisasContext *s, int reg)
{
--
2.25.1
- [PULL v2 03/12] hw/arm: Attach MMC to quanta-gbs-bmc, (continued)
- [PULL v2 03/12] hw/arm: Attach MMC to quanta-gbs-bmc, Richard Henderson, 2021/11/02
- [PULL v2 01/12] hw/sd: add nuvoton MMC, Richard Henderson, 2021/11/02
- [PULL v2 02/12] hw/arm: Add Nuvoton SD module to board, Richard Henderson, 2021/11/02
- [PULL v2 04/12] tests/qtest/libqos: add SDHCI commands, Richard Henderson, 2021/11/02
- [PULL v2 08/12] target/arm: Use the constant variant of store_cpu_field() when possible, Richard Henderson, 2021/11/02
- [PULL v2 10/12] target/arm: Use tcg_constant_i32() in gen_rev16(), Richard Henderson, 2021/11/02
- [PULL v2 11/12] hw/arm/virt: Rename default_bus_bypass_iommu, Richard Henderson, 2021/11/02
- [PULL v2 09/12] target/arm: Use tcg_constant_i64() in do_sat_addsub_64(), Richard Henderson, 2021/11/02
- [PULL v2 12/12] hvf: arm: Ignore cache operations on MMIO, Richard Henderson, 2021/11/02
- [PULL v2 07/12] target/arm: Introduce store_cpu_field_constant() helper,
Richard Henderson <=
- Re: [PULL v2 00/12] target/arm patch queue, Richard Henderson, 2021/11/03