Replace the TARGET_LONG_BITS alias in tcg-op-gvec.h with a static inline. The duplicate follows tl_is_64() and casts through tcg_i64_from_tl and tcg_i32_from_tl.
Signed-off-by: Yonggang Luo <[email protected]> --- include/tcg/tcg-op-gvec.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/include/tcg/tcg-op-gvec.h b/include/tcg/tcg-op-gvec.h index d82ba6dfaac..96e73178558 100644 --- a/include/tcg/tcg-op-gvec.h +++ b/include/tcg/tcg-op-gvec.h @@ -9,17 +9,16 @@ #define TCG_TCG_OP_GVEC_H #include "tcg/tcg-op-gvec-common.h" +#include "tcg/tcg-op-mem.h" -#ifndef TARGET_LONG_BITS -#error must include QEMU headers -#endif - -#if TARGET_LONG_BITS == 64 -#define tcg_gen_gvec_dup_tl tcg_gen_gvec_dup_i64 -#elif TARGET_LONG_BITS == 32 -#define tcg_gen_gvec_dup_tl tcg_gen_gvec_dup_i32 -#else -# error -#endif +static inline void tcg_gen_gvec_dup_tl(unsigned vece, uint32_t dofs, + uint32_t s, uint32_t m, TCGv c) +{ + if (tl_is_64()) { + tcg_gen_gvec_dup_i64(vece, dofs, s, m, tcg_i64_from_tl(c)); + } else { + tcg_gen_gvec_dup_i32(vece, dofs, s, m, tcg_i32_from_tl(c)); + } +} #endif -- 2.52.0.windows.1
