diff options
author | eopXD <yueh.ting.chen@gmail.com> | 2021-12-09 11:15:16 +0800 |
---|---|---|
committer | eopXD <yueh.ting.chen@gmail.com> | 2021-12-09 18:59:38 +0800 |
commit | f25933a48392d2141bf557fe16b3e3c56957b2d2 (patch) | |
tree | 3cf66a14062caff65dcca72d188f74e4c52466bc /riscv/decode.h | |
parent | 76bc15ad4bd51108d99aa4daa5af72c164559a3f (diff) | |
download | riscv-isa-sim-f25933a48392d2141bf557fe16b3e3c56957b2d2.zip riscv-isa-sim-f25933a48392d2141bf557fe16b3e3c56957b2d2.tar.gz riscv-isa-sim-f25933a48392d2141bf557fe16b3e3c56957b2d2.tar.bz2 |
Simplify vfwcvt
Diffstat (limited to 'riscv/decode.h')
-rw-r--r-- | riscv/decode.h | 89 |
1 files changed, 50 insertions, 39 deletions
diff --git a/riscv/decode.h b/riscv/decode.h index 541b46b..9058334 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -2423,6 +2423,56 @@ reg_t index[P.VU.vlmax]; \ break; \ } +#define VI_VFP_WCVT_FP_TO_FP(BODY8, BODY16, BODY32, \ + CHECK8, CHECK16, CHECK32) \ + VI_CHECK_DSS(false); \ + switch(P.VU.vsew) { \ + case e16: \ + { VI_VFP_CVT_LOOP(CVT_FP_TO_FP_PARAMS(16, 32), CHECK16, BODY16); } \ + break; \ + case e32: \ + { VI_VFP_CVT_LOOP(CVT_FP_TO_FP_PARAMS(32, 64), CHECK32, BODY32); } \ + break; \ + default: \ + require(0); \ + break; \ + } + +#define VI_VFP_WCVT_INT_TO_FP(BODY8, BODY16, BODY32, \ + CHECK8, CHECK16, CHECK32, \ + sign) \ + VI_CHECK_DSS(false); \ + switch(P.VU.vsew) { \ + case e8: \ + { VI_VFP_CVT_LOOP(CVT_INT_TO_FP_PARAMS(8, 16, sign), CHECK8, BODY8); } \ + break; \ + case e16: \ + { VI_VFP_CVT_LOOP(CVT_INT_TO_FP_PARAMS(16, 32, sign), CHECK16, BODY16); } \ + break; \ + case e32: \ + { VI_VFP_CVT_LOOP(CVT_INT_TO_FP_PARAMS(32, 64, sign), CHECK32, BODY32); } \ + break; \ + default: \ + require(0); \ + break; \ + } + +#define VI_VFP_WCVT_FP_TO_INT(BODY8, BODY16, BODY32, \ + CHECK8, CHECK16, CHECK32, \ + sign) \ + VI_CHECK_DSS(false); \ + switch(P.VU.vsew) { \ + case e16: \ + { VI_VFP_CVT_LOOP(CVT_FP_TO_INT_PARAMS(16, 32, sign), CHECK16, BODY16); } \ + break; \ + case e32: \ + { VI_VFP_CVT_LOOP(CVT_FP_TO_INT_PARAMS(32, 64, sign), CHECK32, BODY32); } \ + break; \ + default: \ + require(0); \ + break; \ + } + #define VI_VFP_NCVT_FP_TO_FP(BODY8, BODY16, BODY32, \ CHECK8, CHECK16, CHECK32) \ VI_CHECK_SDS(false); \ @@ -2473,45 +2523,6 @@ reg_t index[P.VU.vlmax]; \ break; \ } -#define VI_VFP_CVT_SCALE(BODY8, BODY16, BODY32, \ - CHECK8, CHECK16, CHECK32, \ - is_widen, eew_check) \ - if (is_widen) { \ - VI_CHECK_DSS(false);\ - } else { \ - VI_CHECK_SDS(false); \ - } \ - require(eew_check); \ - switch(P.VU.vsew) { \ - case e8: {\ - CHECK8 \ - VI_VFP_LOOP_SCALE_BASE \ - BODY8 \ - set_fp_exceptions; \ - VI_VFP_LOOP_END \ - } \ - break; \ - case e16: {\ - CHECK16 \ - VI_VFP_LOOP_SCALE_BASE \ - BODY16 \ - set_fp_exceptions; \ - VI_VFP_LOOP_END \ - } \ - break; \ - case e32: {\ - CHECK32 \ - VI_VFP_LOOP_SCALE_BASE \ - BODY32 \ - set_fp_exceptions; \ - VI_VFP_LOOP_END \ - } \ - break; \ - default: \ - require(0); \ - break; \ - } - // The p-extension support is contributed by // Programming Langauge Lab, Department of Computer Science, National Tsing-Hua University, Taiwan |