]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/loongarch: Add CRC feature flag and use it to gate CRC instructions
authorWANG Rui <wangrui@loongson.cn>
Fri, 18 Apr 2025 08:21:01 +0000 (16:21 +0800)
committerSong Gao <gaosong@loongson.cn>
Thu, 24 Apr 2025 02:46:31 +0000 (10:46 +0800)
commit256df51e727235b3d5e937ca2784c45663c00f59
tree3c07a9b1e3a9dbf3d7ac9768b356e61639272c25
parenta9d3d1dff6f9e1544e8a84e74645b8e4fe08c0ad
target/loongarch: Add CRC feature flag and use it to gate CRC instructions

This patch replaces the obsolete IOCSR_BRD bit with CRC in cpucfg1[25],
in both LA464 and LA132 CPU initialization functions. The corresponding
field macro in `cpu.h` is updated to reflect this change.

Additionally, the availability macro `avail_CRC()` is introduced in
`translate.h` to check the CRC feature flag.

All CRC-related instruction translations are updated to be gated by
the new CRC feature flag instead of hardcoded CPU features.

This ensures correctness and configurability when enabling CRC
instructions based on hardware capabilities.

Signed-off-by: WANG Rui <wangrui@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250418082103.447780-2-wangrui@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
target/loongarch/cpu.c
target/loongarch/cpu.h
target/loongarch/tcg/insn_trans/trans_extra.c.inc
target/loongarch/translate.h