mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
target/riscv: accessors to registers upper part and 128-bit load/store
Get function to retrieve the 64 top bits of a register, stored in the gprh field of the cpu state. Set function that writes the 128-bit value at once. The access to the gprh field can not be protected at compile time to make sure it is accessed only in the 128-bit version of the processor because we have no way to indicate that the misa_mxl_max field is const. The 128-bit ISA adds ldu, lq and sq. We provide support for these instructions. Note that (a) we compute only 64-bit addresses to actually access memory, cowardly utilizing the existing address translation mechanism of QEMU, and (b) we assume for now little-endian memory accesses. Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by: Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-10-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
76a361066f
commit
a2f827ff4f
4 changed files with 163 additions and 10 deletions
|
@ -25,14 +25,17 @@
|
|||
# Immediates:
|
||||
%imm_ci 12:s1 2:5
|
||||
%nzuimm_ciw 7:4 11:2 5:1 6:1 !function=ex_shift_2
|
||||
%uimm_cl_q 10:1 5:2 11:2 !function=ex_shift_4
|
||||
%uimm_cl_d 5:2 10:3 !function=ex_shift_3
|
||||
%uimm_cl_w 5:1 10:3 6:1 !function=ex_shift_2
|
||||
%imm_cb 12:s1 5:2 2:1 10:2 3:2 !function=ex_shift_1
|
||||
%imm_cj 12:s1 8:1 9:2 6:1 7:1 2:1 11:1 3:3 !function=ex_shift_1
|
||||
|
||||
%shimm_6bit 12:1 2:5 !function=ex_rvc_shifti
|
||||
%uimm_6bit_lq 2:4 12:1 6:1 !function=ex_shift_4
|
||||
%uimm_6bit_ld 2:3 12:1 5:2 !function=ex_shift_3
|
||||
%uimm_6bit_lw 2:2 12:1 4:3 !function=ex_shift_2
|
||||
%uimm_6bit_sq 7:4 11:2 !function=ex_shift_4
|
||||
%uimm_6bit_sd 7:3 10:3 !function=ex_shift_3
|
||||
%uimm_6bit_sw 7:2 9:4 !function=ex_shift_2
|
||||
|
||||
|
@ -54,16 +57,20 @@
|
|||
# Formats 16:
|
||||
@cr .... ..... ..... .. &r rs2=%rs2_5 rs1=%rd %rd
|
||||
@ci ... . ..... ..... .. &i imm=%imm_ci rs1=%rd %rd
|
||||
@cl_q ... . ..... ..... .. &i imm=%uimm_cl_q rs1=%rs1_3 rd=%rs2_3
|
||||
@cl_d ... ... ... .. ... .. &i imm=%uimm_cl_d rs1=%rs1_3 rd=%rs2_3
|
||||
@cl_w ... ... ... .. ... .. &i imm=%uimm_cl_w rs1=%rs1_3 rd=%rs2_3
|
||||
@cs_2 ... ... ... .. ... .. &r rs2=%rs2_3 rs1=%rs1_3 rd=%rs1_3
|
||||
@cs_q ... ... ... .. ... .. &s imm=%uimm_cl_q rs1=%rs1_3 rs2=%rs2_3
|
||||
@cs_d ... ... ... .. ... .. &s imm=%uimm_cl_d rs1=%rs1_3 rs2=%rs2_3
|
||||
@cs_w ... ... ... .. ... .. &s imm=%uimm_cl_w rs1=%rs1_3 rs2=%rs2_3
|
||||
@cj ... ........... .. &j imm=%imm_cj
|
||||
@cb_z ... ... ... .. ... .. &b imm=%imm_cb rs1=%rs1_3 rs2=0
|
||||
|
||||
@c_lqsp ... . ..... ..... .. &i imm=%uimm_6bit_lq rs1=2 %rd
|
||||
@c_ldsp ... . ..... ..... .. &i imm=%uimm_6bit_ld rs1=2 %rd
|
||||
@c_lwsp ... . ..... ..... .. &i imm=%uimm_6bit_lw rs1=2 %rd
|
||||
@c_sqsp ... . ..... ..... .. &s imm=%uimm_6bit_sq rs1=2 rs2=%rs2_5
|
||||
@c_sdsp ... . ..... ..... .. &s imm=%uimm_6bit_sd rs1=2 rs2=%rs2_5
|
||||
@c_swsp ... . ..... ..... .. &s imm=%uimm_6bit_sw rs1=2 rs2=%rs2_5
|
||||
@c_li ... . ..... ..... .. &i imm=%imm_ci rs1=0 %rd
|
||||
|
@ -87,9 +94,15 @@
|
|||
illegal 000 000 000 00 --- 00
|
||||
addi 000 ... ... .. ... 00 @c_addi4spn
|
||||
}
|
||||
fld 001 ... ... .. ... 00 @cl_d
|
||||
{
|
||||
lq 001 ... ... .. ... 00 @cl_q
|
||||
fld 001 ... ... .. ... 00 @cl_d
|
||||
}
|
||||
lw 010 ... ... .. ... 00 @cl_w
|
||||
fsd 101 ... ... .. ... 00 @cs_d
|
||||
{
|
||||
sq 101 ... ... .. ... 00 @cs_q
|
||||
fsd 101 ... ... .. ... 00 @cs_d
|
||||
}
|
||||
sw 110 ... ... .. ... 00 @cs_w
|
||||
|
||||
# *** RV32C and RV64C specific Standard Extension (Quadrant 0) ***
|
||||
|
@ -132,7 +145,10 @@ addw 100 1 11 ... 01 ... 01 @cs_2
|
|||
|
||||
# *** RV32/64C Standard Extension (Quadrant 2) ***
|
||||
slli 000 . ..... ..... 10 @c_shift2
|
||||
fld 001 . ..... ..... 10 @c_ldsp
|
||||
{
|
||||
lq 001 ... ... .. ... 10 @c_lqsp
|
||||
fld 001 . ..... ..... 10 @c_ldsp
|
||||
}
|
||||
{
|
||||
illegal 010 - 00000 ----- 10 # c.lwsp, RES rd=0
|
||||
lw 010 . ..... ..... 10 @c_lwsp
|
||||
|
@ -147,7 +163,10 @@ fld 001 . ..... ..... 10 @c_ldsp
|
|||
jalr 100 1 ..... 00000 10 @c_jalr rd=1 # C.JALR
|
||||
add 100 1 ..... ..... 10 @cr
|
||||
}
|
||||
fsd 101 ...... ..... 10 @c_sdsp
|
||||
{
|
||||
sq 101 ... ... .. ... 10 @c_sqsp
|
||||
fsd 101 ...... ..... 10 @c_sdsp
|
||||
}
|
||||
sw 110 . ..... ..... 10 @c_swsp
|
||||
|
||||
# *** RV32C and RV64C specific Standard Extension (Quadrant 2) ***
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue