-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathXCoreVBitmanip.core_desc
131 lines (131 loc) · 5.38 KB
/
XCoreVBitmanip.core_desc
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
InstructionSet XCoreVBitmanip extends RISCVBase {
instructions {
// SOURCE FILE: instr_srcs/XCoreVALU_BitmanipI.txt
CV_EXTRACT {
encoding: 2'b00 :: Luimm5[4:0] :: Iuimm5[4:0] :: rs1[4:0] :: 3'b000 :: rd[4:0] :: 7'b1011011;
assembly: {"cv.extract", "{name(rd)}, {name(rs1)}, {Luimm5}, {Iuimm5}" };
behavior: {
if (rd != 0) {
X[rd] = (signed<32>)(((X[rs1] >> Iuimm5) & ((2 << Luimm5) - 1)) << (31 - Luimm5)) >> (31 - Luimm5);
}
}
}
CV_EXTRACTU {
encoding: 2'b01 :: Luimm5[4:0] :: Iuimm5[4:0] :: rs1[4:0] :: 3'b000 :: rd[4:0] :: 7'b1011011;
assembly: {"cv.extractu", "{name(rd)}, {name(rs1)}, {Luimm5}, {Iuimm5}" };
behavior: {
if (rd != 0) {
X[rd] = (unsigned)((X[rs1] >> Iuimm5) & ((2 << Luimm5) - 1));
}
}
}
// CV_INSERT {
// encoding: 2'b10 :: Luimm5[4:0] :: Iuimm5[4:0] :: rs1[4:0] :: 3'b000 :: rd[4:0] :: 7'b1011011;
// assembly: {"cv.insert", "{name(rd)}, {name(rs1)}, {Luimm5}, {Iuimm5}" };
// behavior: {
// // TODO
// }
// }
// CV_BCLR {
// encoding: 2'b00 :: Luimm5[4:0] :: Iuimm5[4:0] :: rs1[4:0] :: 3'b001 :: rd[4:0] :: 7'b1011011;
// assembly: {"cv.bclr", "{name(rd)}, {name(rs1)}, {Luimm5}, {Iuimm5}" };
// behavior: {
// // TODO
// }
// }
// CV_BSET {
// encoding: 2'b01 :: Luimm5[4:0] :: Iuimm5[4:0] :: rs1[4:0] :: 3'b001 :: rd[4:0] :: 7'b1011011;
// assembly: {"cv.bset", "{name(rd)}, {name(rs1)}, {Luimm5}, {Iuimm5}" };
// behavior: {
// // TODO
// }
// }
// CV_BITREV {
// encoding: 2'b11 :: Luimm5[4:0] :: Iuimm5[4:0] :: rs1[4:0] :: 3'b001 :: rd[4:0] :: 7'b1011011;
// assembly: {"cv.bitrev", "{name(rd)}, {name(rs1)}, {Luimm5}, {Iuimm5}" };
// behavior: {
// // TODO
// }
// }
// SOURCE FILE: instr_srcs/XCoreVALU_BitmanipR.txt
CV_EXTRACTR {
encoding: 7'b0011000 :: rs2[4:0] :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
assembly: {"cv.extractr", "{name(rd)}, {name(rs1)}, {name(rs2)}" };
behavior: {
if (rd != 0) {
X[rd] = (signed<32>)(((X[rs1] >> X[rs2][31: 0][4:0]) & ((2 << X[rs2][31: 0][9:5]) - 1)) << (31 - X[rs2][31: 0][9:5])) >> (31 - X[rs2][31: 0][9:5]);
}
}
}
CV_EXTRACTUR {
encoding: 7'b0011001 :: rs2[4:0] :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
assembly: {"cv.extractur", "{name(rd)}, {name(rs1)}, {name(rs2)}" };
behavior: {
if (rd != 0) {
X[rd] = (unsigned)((X[rs1] >> X[rs2][31: 0][4:0]) & ((2 << X[rs2][31: 0][9:5]) - 1));
}
}
}
// CV_INSERTR {
// encoding: 7'b0011010 :: rs2[4:0] :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
// assembly: {"cv.insertr", "{name(rd)}, {name(rs1)}, {name(rs2)}" };
// behavior: {
// // TODO
// }
// }
// CV_BCLRR {
// encoding: 7'b0011100 :: rs2[4:0] :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
// assembly: {"cv.bclrr", "{name(rd)}, {name(rs1)}, {name(rs2)}" };
// behavior: {
// // TODO
// }
// }
// CV_BSETR {
// encoding: 7'b0011101 :: rs2[4:0] :: scr1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
// assembly: {"cv.bsetr", "{name(rd)}, {name(rs1)}, {name(rs2)}" };
// behavior: {
// // TODO
// }
// }
// CV_ROR {
// encoding: 7'b0100000 :: rs2[4:0] :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
// assembly: {"cv.ror", "{name(rd)}, {name(rs1)}, {name(rs2)}" };
// behavior: {
// // TODO
// }
// }
// CV_FF1 {
// encoding: 7'b0100001 :: 5'b00000 :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
// assembly: {"cv.ff1", "{name(rd)}, {name(rs1)}" };
// behavior: {
// // TODO
// }
// }
// CV_FL1 {
// encoding: 7'b0100010 :: 5'b00000 :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
// assembly: {"cv.fl1", "{name(rd)}, {name(rs1)}" };
// behavior: {
// // TODO
// }
// }
// CV_CLB {
// encoding: 7'b0100011 :: 5'b00000 :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
// assembly: {"cv.clb", "{name(rd)}, {name(rs1)}" };
// behavior: {
// if (rd != 0) {
// if (X[rs1] == 0) return 0;
// unsigned<5> i = 0;
// while (X[rs1][31 - i] == X[rs1][31]) i = i + 1;
// return i - 1;
// }
// }
// }
// CV_CNT {
// encoding: 7'b0100100 :: 5'b00000 :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
// assembly: {"cv.cnt", "{name(rd)}, {name(rs1)}" };
// behavior: {
// // TODO
// }
// }
}
}