Multiple precison shoule be supported by NaN-boxing. That means, we should flush not valid NaN-boxing input to canonical NaN before effective calculation and we should NaN-boxing the result after the effective calculation.
In this patch set, split the implementation to three steps for compute, sign-injection, and some covert insns, which are check_nanboxed, effective calculation and gen_nanbox_fpr. Check_nanboxed checks the inputs and flushes not valid inputs to cancical NaN. Effective calculation is direct calculation on fp32 values. Gen_nanbox_fpr does the NaN-boxing, writing the 1s to upper 32 bits. LIU Zhiwei (6): target/riscv: move gen_nanbox_fpr to translate.c target/riscv: NaN-boxing compute, sign-injection and convert instructions. target/riscv: Check for LEGAL NaN-boxing target/riscv: check before allocating TCG temps target/riscv: Flush not valid NaN-boxing input to canonical NaN target/riscv: clean up fmv.w.x target/riscv/insn_trans/trans_rvd.inc.c | 16 +- target/riscv/insn_trans/trans_rvf.inc.c | 317 +++++++++++++++++++----- target/riscv/translate.c | 43 ++++ 3 files changed, 306 insertions(+), 70 deletions(-) -- 2.23.0