From 292860aa51eedd480e57b5df1085d30ddd46e375 Mon Sep 17 00:00:00 2001 From: Chih-Min Chao Date: Thu, 23 Apr 2020 23:40:08 -0700 Subject: rvv: commitlog: fix dst information for int comparison Signed-off-by: Chih-Min Chao --- riscv/decode.h | 60 ++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/riscv/decode.h b/riscv/decode.h index d209af3..91ce537 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -660,6 +660,26 @@ static inline bool is_overlapped(const int astart, const int asize, type_sew_t::type &vd = P.VU.elt::type>(rd_num, i, true); \ type_usew_t::type vs2 = P.VU.elt::type>(rs2_num, RS1); +#define VV_UCMP_PARAMS(x) \ + type_usew_t::type vs1 = P.VU.elt::type>(rs1_num, i); \ + type_usew_t::type vs2 = P.VU.elt::type>(rs2_num, i); + +#define VX_UCMP_PARAMS(x) \ + type_usew_t::type rs1 = (type_usew_t::type)RS1; \ + type_usew_t::type vs2 = P.VU.elt::type>(rs2_num, i); + +#define VV_CMP_PARAMS(x) \ + type_sew_t::type vs1 = P.VU.elt::type>(rs1_num, i); \ + type_sew_t::type vs2 = P.VU.elt::type>(rs2_num, i); + +#define VX_CMP_PARAMS(x) \ + type_sew_t::type rs1 = (type_sew_t::type)RS1; \ + type_sew_t::type vs2 = P.VU.elt::type>(rs2_num, i); + +#define VI_CMP_PARAMS(x) \ + type_sew_t::type simm5 = (type_sew_t::type)insn.v_simm5(); \ + type_sew_t::type vs2 = P.VU.elt::type>(rs2_num, i); + #define VI_XI_SLIDEDOWN_PARAMS(x, off) \ auto &vd = P.VU.elt::type>(rd_num, i, true); \ auto vs2 = P.VU.elt::type>(rs2_num, i + off); @@ -717,16 +737,16 @@ static inline bool is_overlapped(const int astart, const int asize, VI_CHECK_MSS(true); \ VI_LOOP_CMP_BASE \ if (sew == e8){ \ - VV_PARAMS(e8); \ + VV_CMP_PARAMS(e8); \ BODY; \ }else if(sew == e16){ \ - VV_PARAMS(e16); \ + VV_CMP_PARAMS(e16); \ BODY; \ }else if(sew == e32){ \ - VV_PARAMS(e32); \ + VV_CMP_PARAMS(e32); \ BODY; \ }else if(sew == e64){ \ - VV_PARAMS(e64); \ + VV_CMP_PARAMS(e64); \ BODY; \ } \ VI_LOOP_CMP_END @@ -735,16 +755,16 @@ static inline bool is_overlapped(const int astart, const int asize, VI_CHECK_MSS(false); \ VI_LOOP_CMP_BASE \ if (sew == e8){ \ - VX_PARAMS(e8); \ + VX_CMP_PARAMS(e8); \ BODY; \ }else if(sew == e16){ \ - VX_PARAMS(e16); \ + VX_CMP_PARAMS(e16); \ BODY; \ }else if(sew == e32){ \ - VX_PARAMS(e32); \ + VX_CMP_PARAMS(e32); \ BODY; \ }else if(sew == e64){ \ - VX_PARAMS(e64); \ + VX_CMP_PARAMS(e64); \ BODY; \ } \ VI_LOOP_CMP_END @@ -753,16 +773,16 @@ static inline bool is_overlapped(const int astart, const int asize, VI_CHECK_MSS(false); \ VI_LOOP_CMP_BASE \ if (sew == e8){ \ - VI_PARAMS(e8); \ + VI_CMP_PARAMS(e8); \ BODY; \ }else if(sew == e16){ \ - VI_PARAMS(e16); \ + VI_CMP_PARAMS(e16); \ BODY; \ }else if(sew == e32){ \ - VI_PARAMS(e32); \ + VI_CMP_PARAMS(e32); \ BODY; \ }else if(sew == e64){ \ - VI_PARAMS(e64); \ + VI_CMP_PARAMS(e64); \ BODY; \ } \ VI_LOOP_CMP_END @@ -771,16 +791,16 @@ static inline bool is_overlapped(const int astart, const int asize, VI_CHECK_MSS(true); \ VI_LOOP_CMP_BASE \ if (sew == e8){ \ - VV_U_PARAMS(e8); \ + VV_UCMP_PARAMS(e8); \ BODY; \ }else if(sew == e16){ \ - VV_U_PARAMS(e16); \ + VV_UCMP_PARAMS(e16); \ BODY; \ }else if(sew == e32){ \ - VV_U_PARAMS(e32); \ + VV_UCMP_PARAMS(e32); \ BODY; \ }else if(sew == e64){ \ - VV_U_PARAMS(e64); \ + VV_UCMP_PARAMS(e64); \ BODY; \ } \ VI_LOOP_CMP_END @@ -789,16 +809,16 @@ static inline bool is_overlapped(const int astart, const int asize, VI_CHECK_MSS(false); \ VI_LOOP_CMP_BASE \ if (sew == e8){ \ - VX_U_PARAMS(e8); \ + VX_UCMP_PARAMS(e8); \ BODY; \ }else if(sew == e16){ \ - VX_U_PARAMS(e16); \ + VX_UCMP_PARAMS(e16); \ BODY; \ }else if(sew == e32){ \ - VX_U_PARAMS(e32); \ + VX_UCMP_PARAMS(e32); \ BODY; \ }else if(sew == e64){ \ - VX_U_PARAMS(e64); \ + VX_UCMP_PARAMS(e64); \ BODY; \ } \ VI_LOOP_CMP_END -- cgit v1.1