aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Min Chao <chihmin.chao@sifive.com>2020-04-23 23:40:08 -0700
committerChih-Min Chao <chihmin.chao@sifive.com>2020-04-24 00:44:55 -0700
commit292860aa51eedd480e57b5df1085d30ddd46e375 (patch)
treea4ace39199e7c020efba4907a57d2a8cb662efdd
parentd4a48f2fc678413bb6c25994affee8486c6a3f98 (diff)
downloadspike-292860aa51eedd480e57b5df1085d30ddd46e375.zip
spike-292860aa51eedd480e57b5df1085d30ddd46e375.tar.gz
spike-292860aa51eedd480e57b5df1085d30ddd46e375.tar.bz2
rvv: commitlog: fix dst information for int comparison
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
-rw-r--r--riscv/decode.h60
1 files 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<x>::type &vd = P.VU.elt<type_sew_t<x>::type>(rd_num, i, true); \
type_usew_t<x>::type vs2 = P.VU.elt<type_usew_t<x>::type>(rs2_num, RS1);
+#define VV_UCMP_PARAMS(x) \
+ type_usew_t<x>::type vs1 = P.VU.elt<type_usew_t<x>::type>(rs1_num, i); \
+ type_usew_t<x>::type vs2 = P.VU.elt<type_usew_t<x>::type>(rs2_num, i);
+
+#define VX_UCMP_PARAMS(x) \
+ type_usew_t<x>::type rs1 = (type_usew_t<x>::type)RS1; \
+ type_usew_t<x>::type vs2 = P.VU.elt<type_usew_t<x>::type>(rs2_num, i);
+
+#define VV_CMP_PARAMS(x) \
+ type_sew_t<x>::type vs1 = P.VU.elt<type_sew_t<x>::type>(rs1_num, i); \
+ type_sew_t<x>::type vs2 = P.VU.elt<type_sew_t<x>::type>(rs2_num, i);
+
+#define VX_CMP_PARAMS(x) \
+ type_sew_t<x>::type rs1 = (type_sew_t<x>::type)RS1; \
+ type_sew_t<x>::type vs2 = P.VU.elt<type_sew_t<x>::type>(rs2_num, i);
+
+#define VI_CMP_PARAMS(x) \
+ type_sew_t<x>::type simm5 = (type_sew_t<x>::type)insn.v_simm5(); \
+ type_sew_t<x>::type vs2 = P.VU.elt<type_sew_t<x>::type>(rs2_num, i);
+
#define VI_XI_SLIDEDOWN_PARAMS(x, off) \
auto &vd = P.VU.elt<type_sew_t<x>::type>(rd_num, i, true); \
auto vs2 = P.VU.elt<type_sew_t<x>::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