blob: 25422d6b9c2db190b2e6ced99cff02660e0bf566 (
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
|
// vmpopc rd, vs2, vm
require(P.VU.vsew >= e8 && P.VU.vsew <= e64);
require_vector;
reg_t vl = P.VU.vl;
reg_t sew = P.VU.vsew;
reg_t rd_num = insn.rd();
reg_t rs1_num = insn.rs1();
reg_t rs2_num = insn.rs2();
require((rd_num & (P.VU.vlmul - 1)) == 0);
if (insn.v_vm() == 0 && P.VU.vlmul >= 2) \
require(insn.rd() != 0);
for (reg_t i = P.VU.vstart ; i < P.VU.vl; ++i) {
VI_LOOP_ELEMENT_SKIP();
switch (sew) {
case e8:
P.VU.elt<uint8_t>(rd_num, i) = i;
break;
case e16:
P.VU.elt<uint16_t>(rd_num, i) = i;
break;
case e32:
P.VU.elt<uint32_t>(rd_num, i) = i;
break;
default:
P.VU.elt<uint64_t>(rd_num, i) = i;
break;
}
}
P.VU.vstart = 0;
|