target/riscv: Fix wrong expanding for c.fswsp

base register is no rs1 not rs2 for fsw.

Backports commit 620455350a8da7cc62ae82cb69dd5c556f744136 from qemu
This commit is contained in:
Kito Cheng 2019-03-26 20:39:25 -04:00 committed by Lioncash
parent fc662c281a
commit 5a7ad783e9
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -337,7 +337,7 @@ static bool trans_c_fswsp_sdsp(DisasContext *ctx, arg_c_fswsp_sdsp *a)
{ {
#ifdef TARGET_RISCV32 #ifdef TARGET_RISCV32
/* C.FSWSP */ /* C.FSWSP */
arg_fsw a_fsw = { .rs1 = a->rs2, .rs2 = 2, .imm = a->uimm_fswsp }; arg_fsw a_fsw = { .rs1 = 2, .rs2 = a->rs2, .imm = a->uimm_fswsp };
return trans_fsw(ctx, &a_fsw); return trans_fsw(ctx, &a_fsw);
#else #else
/* C.SDSP */ /* C.SDSP */