aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/vslide1up_vx.h
diff options
context:
space:
mode:
authorChih-Min Chao <chihmin.chao@sifive.com>2019-06-06 03:24:27 -0700
committerChih-Min Chao <chihmin.chao@sifive.com>2019-06-18 08:56:11 -0700
commit655aedc0ebd2326d69d389bc714c2d622bf2cb08 (patch)
treeaa2cf79905906cde9ff6d10c63d1499fb4a484a1 /riscv/insns/vslide1up_vx.h
parent235aa58bfb439c9782defe8bdd21f792e40aac31 (diff)
downloadspike-655aedc0ebd2326d69d389bc714c2d622bf2cb08.zip
spike-655aedc0ebd2326d69d389bc714c2d622bf2cb08.tar.gz
spike-655aedc0ebd2326d69d389bc714c2d622bf2cb08.tar.bz2
rvv: add integer/fixed-point/mask/reduction/permutation instructions
based on v-spec 0.7.1, support sections: 12/13/15.1 ~ 15.2/16/17 element size: 8/16/32/64 support ediv: 1 Signed-off-by: Bruce Hoult <bruce@hoult.org> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com> Signed-off-by: Dave Wen <dave.wen@sifive.com>
Diffstat (limited to 'riscv/insns/vslide1up_vx.h')
-rw-r--r--riscv/insns/vslide1up_vx.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/riscv/insns/vslide1up_vx.h b/riscv/insns/vslide1up_vx.h
new file mode 100644
index 0000000..50cc503
--- /dev/null
+++ b/riscv/insns/vslide1up_vx.h
@@ -0,0 +1,32 @@
+//vslide1up.vx vd, vs2, rs1
+if (insn.v_vm() == 0)
+ require(insn.rd() != 0);
+
+VI_CHECK_SS
+VI_LOOP_BASE
+if (i != 0) {
+ if (sew == e8) {
+ VI_XI_SLIDEUP_PARAMS(e8, 1);
+ vd = vs2;
+ } else if(sew == e16) {
+ VI_XI_SLIDEUP_PARAMS(e16, 1);
+ vd = vs2;
+ } else if(sew == e32) {
+ VI_XI_SLIDEUP_PARAMS(e32, 1);
+ vd = vs2;
+ } else if(sew == e64) {
+ VI_XI_SLIDEUP_PARAMS(e64, 1);
+ vd = vs2;
+ }
+} else {
+ if (sew == e8) {
+ P.VU.elt<uint8_t>(rd_num, 0) = RS1;
+ } else if(sew == e16) {
+ P.VU.elt<uint16_t>(rd_num, 0) = RS1;
+ } else if(sew == e32) {
+ P.VU.elt<uint32_t>(rd_num, 0) = RS1;
+ } else if(sew == e64) {
+ P.VU.elt<uint64_t>(rd_num, 0) = RS1;
+ }
+}
+VI_LOOP_END