sv_freg_t sv_proc_t::get_fpreg(reg_spec_t const&spec)
{
freg_t data = READ_FREG(spec);
- uint8_t bitwidth = _insn->src_bitwidth;
- return sv_freg_t(data, xlen, bitwidth);
+ //uint8_t bitwidth = _insn->src_bitwidth;
+ reg_t reg = spec.reg;
+ uint8_t elwidth = _insn->reg_elwidth(reg, false);
+ return sv_freg_t(data, xlen, elwidth);
}
#define GET_REG(name) \
case 1: throw trap_illegal_instruction(0); // XXX for now
// 16-bit data, up-convert to f32
case 2:
- return f16_to_f32(f16(x.to_uint32()));
+ {
+ sv_reg_t x32(x.to_uint32());
+ float16_t f_16 = f16(x);
+ fprintf(stderr, "f16-to-f32 %lx\n", (uint64_t)x32);
+ return f16_to_f32(f_16);
+ }
// 0 and 3 are 32-bit
default: break;
}
case 1: throw trap_illegal_instruction(0); // XXX for now
// 16-bit data, up-convert to f32
case 2:
+ fprintf(stderr, "f16-to-f32\n");
return f16_to_f32(f16(x));
// 0 and 3 are 32-bit
default: break;