diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-12-22 10:26:14 -0800 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-12-24 08:32:14 -0800 |
commit | e1b6c141e98034d44d7e9004dc35545b87ebcade (patch) | |
tree | 73cf3f041e7b7b519e475eba0d9326a513a5104b /tcg | |
parent | f3ed3cffb96f96875755ac4b057a15fd50ed0f32 (diff) | |
download | qemu-e1b6c141e98034d44d7e9004dc35545b87ebcade.zip qemu-e1b6c141e98034d44d7e9004dc35545b87ebcade.tar.gz qemu-e1b6c141e98034d44d7e9004dc35545b87ebcade.tar.bz2 |
tcg/optimize: Introduce const value accessors for TempOptInfo
Introduce ti_is_const, ti_const_val, ti_is_const_val.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r-- | tcg/optimize.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c index 26d1c5d..5090f6e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -79,15 +79,29 @@ static inline TempOptInfo *arg_info(TCGArg arg) return ts_info(arg_temp(arg)); } +static inline bool ti_is_const(TempOptInfo *ti) +{ + return ti->is_const; +} + +static inline uint64_t ti_const_val(TempOptInfo *ti) +{ + return ti->val; +} + +static inline bool ti_is_const_val(TempOptInfo *ti, uint64_t val) +{ + return ti_is_const(ti) && ti_const_val(ti) == val; +} + static inline bool ts_is_const(TCGTemp *ts) { - return ts_info(ts)->is_const; + return ti_is_const(ts_info(ts)); } static inline bool ts_is_const_val(TCGTemp *ts, uint64_t val) { - TempOptInfo *ti = ts_info(ts); - return ti->is_const && ti->val == val; + return ti_is_const_val(ts_info(ts), val); } static inline bool arg_is_const(TCGArg arg) |