Convert some fp reg from array to struct call
This commit is contained in:
parent
658502d353
commit
bce7047c5c
@ -470,20 +470,20 @@ impl Machine {
|
||||
machine.fp_reg.set_reg(inst.rd as usize, machine.fp_reg.get_reg(inst.rs1 as usize).sqrt());
|
||||
},
|
||||
RISCV_FP_FSGN => {
|
||||
let local_float = machine.fp_reg[inst.rs1 as usize];
|
||||
let local_float = machine.fp_reg.get_reg(inst.rs1 as usize);
|
||||
match inst.funct3 {
|
||||
RISCV_FP_FSGN_J => {
|
||||
if machine.fp_reg[inst.rs2 as usize] < 0 {
|
||||
machine.fp_reg[inst.rd as usize] = -local_float;
|
||||
if machine.fp_reg.get_reg(inst.rs2 as usize) < 0f32 {
|
||||
machine.fp_reg.set_reg(inst.rd as usize, -local_float);
|
||||
} else {
|
||||
machine.fp_reg[inst.rd as usize] = local_float;
|
||||
machine.fp_reg.set_reg(inst.rd as usize, local_float);
|
||||
}
|
||||
}
|
||||
RISCV_FP_FSGN_JN => {
|
||||
if machine.fp_reg[inst.rs2 as usize] < 0 {
|
||||
machine.fp_reg[inst.rd as usize] = local_float;
|
||||
if machine.fp_reg.get_reg(inst.rs2 as usize) < 0f32 {
|
||||
machine.fp_reg.set_reg(inst.rd as usize, local_float);
|
||||
} else {
|
||||
machine.fp_reg[inst.rd as usize] = -local_float;
|
||||
machine.fp_reg.set_reg(inst.rd as usize, -local_float);
|
||||
}
|
||||
}
|
||||
RISCV_FP_FSGN_JX => {
|
||||
|
Loading…
Reference in New Issue
Block a user