mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
target/riscv: Merge m/vsstatus and m/vsstatush into one uint64_t unit
mstatus/mstatush and vsstatus/vsstatush are two halved for RISCV32. This patch expands mstatus and vsstatus to uint64_t instead of target_ulong so that it can be saved as one unit and reduce some ifdefs in the code. Signed-off-by: Yifei Jiang <jiangyifei@huawei.com> Signed-off-by: Yipeng Yin <yinyipeng1@huawei.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20201026115530.304-2-jiangyifei@huawei.com
This commit is contained in:
parent
4e1e3003fb
commit
284d697c74
6 changed files with 41 additions and 74 deletions
|
@ -4,10 +4,10 @@
|
|||
#define TARGET_RISCV_CPU_BITS_H
|
||||
|
||||
#define get_field(reg, mask) (((reg) & \
|
||||
(target_ulong)(mask)) / ((mask) & ~((mask) << 1)))
|
||||
#define set_field(reg, mask, val) (((reg) & ~(target_ulong)(mask)) | \
|
||||
(((target_ulong)(val) * ((mask) & ~((mask) << 1))) & \
|
||||
(target_ulong)(mask)))
|
||||
(uint64_t)(mask)) / ((mask) & ~((mask) << 1)))
|
||||
#define set_field(reg, mask, val) (((reg) & ~(uint64_t)(mask)) | \
|
||||
(((uint64_t)(val) * ((mask) & ~((mask) << 1))) & \
|
||||
(uint64_t)(mask)))
|
||||
|
||||
/* Floating point round mode */
|
||||
#define FSR_RD_SHIFT 5
|
||||
|
@ -381,19 +381,8 @@
|
|||
#define MSTATUS_TVM 0x00100000 /* since: priv-1.10 */
|
||||
#define MSTATUS_TW 0x20000000 /* since: priv-1.10 */
|
||||
#define MSTATUS_TSR 0x40000000 /* since: priv-1.10 */
|
||||
#if defined(TARGET_RISCV64)
|
||||
#define MSTATUS_GVA 0x4000000000ULL
|
||||
#define MSTATUS_MPV 0x8000000000ULL
|
||||
#elif defined(TARGET_RISCV32)
|
||||
#define MSTATUS_GVA 0x00000040
|
||||
#define MSTATUS_MPV 0x00000080
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_RISCV32
|
||||
# define MSTATUS_MPV_ISSET(env) get_field(env->mstatush, MSTATUS_MPV)
|
||||
#else
|
||||
# define MSTATUS_MPV_ISSET(env) get_field(env->mstatus, MSTATUS_MPV)
|
||||
#endif
|
||||
|
||||
#define MSTATUS64_UXL 0x0000000300000000ULL
|
||||
#define MSTATUS64_SXL 0x0000000C00000000ULL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue