aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/vslide1down_vx.h
blob: 04e2540507eb5db52a7350c9e47af1001890a203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//vslide1down.vx vd, vs2, rs1
require((insn.rs2() & (P.VU.vlmul - 1)) == 0);
require((insn.rd() & (P.VU.vlmul - 1)) == 0);
if (P.VU.vlmul > 1 && insn.v_vm() == 0)
  require(insn.rd() != 0);

VI_LOOP_BASE
if (i != vl - 1) {
  switch (sew) {
  case e8: {
    VI_XI_SLIDEDOWN_PARAMS(e8, 1);
    vd = vs2;
  }
  break;
  case e16: {
    VI_XI_SLIDEDOWN_PARAMS(e16, 1);
    vd = vs2;
  }
  break;
  case e32: {
    VI_XI_SLIDEDOWN_PARAMS(e32, 1);
    vd = vs2;
  }
  break;
  default: {
    VI_XI_SLIDEDOWN_PARAMS(e64, 1);
    vd = vs2;
  }
  break;
  }
} else {
  switch (sew) {
  case e8:
    P.VU.elt<uint8_t>(rd_num, vl - 1) = RS1;
    break;
  case e16:
    P.VU.elt<uint16_t>(rd_num, vl - 1) = RS1;
    break;
  case e32:
    P.VU.elt<uint32_t>(rd_num, vl - 1) = RS1;
    break;
  default:
    P.VU.elt<uint64_t>(rd_num, vl - 1) = RS1;
    break;
  }
}
VI_LOOP_END