qemu/include
Huang Shiyuan f63e7089b4 tcg/riscv: Add basic support for vector
The RISC-V vector instruction set utilizes the LMUL field to group
multiple registers, enabling variable-length vector registers. This
implementation uses only the first register number of each group while
reserving the other register numbers within the group.

In TCG, each VEC_IR can have 3 types (TCG_TYPE_V64/128/256), and the
host runtime needs to adjust LMUL based on the type to use different
register groups.

This presents challenges for TCG's register allocation. Currently, we
avoid modifying the register allocation part of TCG and only expose the
minimum number of vector registers.

For example, when the host vlen is 64 bits and type is TCG_TYPE_V256, with
LMUL equal to 4, we use 4 vector registers as one register group. We can
use a maximum of 8 register groups, but the V0 register number is reserved
as a mask register, so we can effectively use at most 7 register groups.
Moreover, when type is smaller than TCG_TYPE_V256, only 7 registers are
forced to be used. This is because TCG cannot yet dynamically constrain
registers with type; likewise, when the host vlen is 128 bits and
TCG_TYPE_V256, we can use at most 15 registers.

There is not much pressure on vector register allocation in TCG now, so
using 7 registers is feasible and will not have a major impact on code
generation.

This patch:
1. Reserves vector register 0 for use as a mask register.
2. When using register groups, reserves the additional registers within
   each group.

Signed-off-by: Huang Shiyuan <swung0x48@outlook.com>
Co-authored-by: TANG Tiancheng <tangtiancheng.ttc@alibaba-inc.com>
Signed-off-by: TANG Tiancheng <tangtiancheng.ttc@alibaba-inc.com>
Reviewed-by: Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20241007025700.47259-3-zhiwei_liu@linux.alibaba.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2024-10-22 11:57:25 -07:00
..
authz
block include: Move QemuLockCnt APIs to their own header 2024-10-15 15:16:17 +01:00
chardev chardev/mux: convert size members to unsigned int 2024-10-15 12:26:01 +04:00
crypto crypto: accumulative hashing API 2024-10-10 12:32:59 +01:00
disas disas: Remove CRIS disassembler 2024-10-07 11:33:20 +02:00
exec exec/memop: Remove unused memop_big_endian() helper 2024-10-15 11:55:09 -03:00
fpu
gdbstub gdbstub/helpers: Introduce ldtul_$endian_p() helpers 2024-10-15 11:55:09 -03:00
hw pull-loongarch-20241016 2024-10-17 12:42:23 +01:00
io qio: add support for SO_PEERCRED for socket channel 2024-07-22 13:47:41 +02:00
libdecnumber
migration migration: Remove unused VMSTATE_ARRAY_TEST() macro 2024-06-21 14:37:58 -03:00
monitor monitor: Remove obsolete stubs 2024-06-30 19:51:44 +03:00
net net: Remove deadcode 2024-10-03 17:26:05 +03:00
qapi qerror: QERR_PROPERTY_VALUE_OUT_OF_RANGE is no longer used, drop 2024-10-18 15:03:35 +02:00
qemu Remove some target-specific endianness knowledge from target/. 2024-10-16 20:22:08 +01:00
qom qom: update object_resolve_path*() documentation 2024-10-03 22:04:24 +02:00
scsi
semihosting semihosting: Include missing 'gdbstub/syscalls.h' header 2024-07-22 09:38:01 +01:00
standard-headers linux-headers: update to 6.10-rc1 2024-07-01 17:16:04 -04:00
sysemu KVM: Rename KVMState->nr_slots to nr_slots_max 2024-10-17 19:41:30 +02:00
tcg tcg/riscv: Add basic support for vector 2024-10-22 11:57:25 -07:00
ui ui: refactor using a common qemu_pixman_shareable 2024-10-14 17:34:09 +04:00
user linux-user: Remove support for CRIS target 2024-09-13 20:10:50 +02:00
elf.h
glib-compat.h Bump minimum glib version to v2.66 2024-05-14 12:46:24 +02:00
qemu-io.h
qemu-main.h