This commit defines TCG_TARGET_REG_BITS based on the value of TCG_VADDR_BITS. For non-wasm hosts, TCG_VADDR_BITS matches the pointer size, so this change preserves the original behaviour. For the wasm host, this change enables support for 64bit guests.
Signed-off-by: Kohei Tokunaga <ktokunaga.m...@gmail.com> --- tcg/tci/tcg-target-reg-bits.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/tci/tcg-target-reg-bits.h b/tcg/tci/tcg-target-reg-bits.h index dcb1a203f8..0e5db44e22 100644 --- a/tcg/tci/tcg-target-reg-bits.h +++ b/tcg/tci/tcg-target-reg-bits.h @@ -7,9 +7,9 @@ #ifndef TCG_TARGET_REG_BITS_H #define TCG_TARGET_REG_BITS_H -#if UINTPTR_MAX == UINT32_MAX +#if TCG_VADDR_BITS == 32 # define TCG_TARGET_REG_BITS 32 -#elif UINTPTR_MAX == UINT64_MAX +#elif TCG_VADDR_BITS == 64 # define TCG_TARGET_REG_BITS 64 #else # error Unknown pointer size for tci target -- 2.43.0