From: Richard Henderson Date: Sun, 22 Dec 2024 18:26:14 +0000 (-0800) Subject: tcg/optimize: Introduce const value accessors for TempOptInfo X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e1b6c141e98034d44d7e9004dc35545b87ebcade;p=qemu.git tcg/optimize: Introduce const value accessors for TempOptInfo Introduce ti_is_const, ti_const_val, ti_is_const_val. Signed-off-by: Richard Henderson --- diff --git a/tcg/optimize.c b/tcg/optimize.c index 26d1c5d4a1..5090f6e759 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)