tcg: Introduce the 'z' constraint for a hardware zero register
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 10 Feb 2025 00:01:38 +0000 (16:01 -0800)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 18 Feb 2025 16:29:03 +0000 (08:29 -0800)
commit6b8abd244b9355bc840bc14182aae9043f86f2f6
tree249a49c7b129191fff562078d2139fa368690e60
parentbf455ec50b6fea15b4d2493059365bf94c706273
tcg: Introduce the 'z' constraint for a hardware zero register

For loongarch, mips, riscv and sparc, a zero register is
available all the time.  For aarch64, register index 31
depends on context: sometimes it is the stack pointer,
and sometimes it is the zero register.

Introduce a new general-purpose constraint which maps 0
to TCG_REG_ZERO, if defined.  This differs from existing
constant constraints in that const_arg[*] is recorded as
false, indicating that the value is in a register.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
docs/devel/tcg-ops.rst
include/tcg/tcg.h
tcg/aarch64/tcg-target.h
tcg/loongarch64/tcg-target.h
tcg/mips/tcg-target.h
tcg/riscv/tcg-target.h
tcg/sparc64/tcg-target.h
tcg/tcg.c