This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 271
/
notes.txt
259 lines (183 loc) · 8 KB
/
notes.txt
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
AVL
00000 0
00001 1
00010 2
00011 3
00100 4
00101 5
00110 6
00111 7
01000 8
01001 9
01010 10
01011 11
01100 12
01101 13
01110 14
01111 15
10000 16 uimm[4:3] << uimm[2:0]
10001 32
10010 64
10011 128
10100 256
10101 512
10110 1024
10111 2048
11000 24
11001 48
11010 96
11011 192
11100 384
11101 768
11110 1536
11111 3072
if (uimm[4])
AVL = uimm[4:3] << (uimm[2:0] + 3)
else
AVL = uimm[3:0]
SLEN=VLEN=32b
Byte 3 2 1 0
LMUL=1,SEW=8b
3 2 1 0 Element
[3] [2] [1] [0] Mask bit position in decimal
LMUL=2,SEW=16b
1 0
[01] [00]
3 2
[03] [02]
LMUL=4,SEW=32b 0
[00]
1
[01]
2
[02]
3
[03]
----
----
LMUL=2,SEW=8b
3 2 1 0
[12][08][04][00]
7 6 5 4
[28][24][20][16]
LMUL=8,SEW=32b
0
[00]
1
[04]
2
[08]
3
[12]
4
[16]
5
[20]
6
[24]
7
[28]
LMUL=8,SEW=8b
3 2 1 0
[03][02][01][00]
7 6 5 4
[07][06][05][04]
B A 9 8
[11][10][09][08]
F E D C
[15][14][13][12]
13 12 11 10
[19][18][17][16]
17 16 15 14
[23][22][21][20]
1B 1A 19 18
[27][26][25][24]
1F 1E 1D 1C
[31][30][29][28]
----
When LMUL < 1, the mask elements are accessed as if LMUL=1 and the
vector length was reduced.
=== Mask Element Locations for SLEN < VLEN
In systems with SLEN < VLEN, the mask elements are striped across the
VLEN/SLEN sections of the vector mask register. Mask element 0 is in
least-significant bits of section 0, and mask element 1 is in
least-significant bits of section 1, etc. In general, the
least-significant bit of the mask element for element __i__ is located
at bit:
mask_LSB_index(__i__) = (__i__ % (VLEN / SLEN)) * SLEN + floor(__i__ / (VLEN / SLEN)) * MLEN
----
Mask register element location examples for SLEN < VLEN
The bit position of the LSB of each mask element is in decimal inside [] braces.
VLEN=256b, SLEN=128b, SEW=32b, LMUL=2, MLEN=16b
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2*n 7 5 3 1| 6 4 2 0
[7] [5] [3] [1] [6] [4] [2] [0]
v2*n+1 F D B 9| E C A 8
[240] [224] [208] [192] [112] [96] [80] [64]
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2*n 7 5 3 1| 6 4 2 0
[131] [130] [129] [128] [3] [2] [1] [0]
v2*n+1 F D B 9| E C A 8
[135] [134] [133] [132] [7] [6] [5] [4]
SEW=8b, LMUL=1/2
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2*n - - - - - - - - F D B 9 7 5 3 1| - - - - - - - - E C A B 6 4 2 0
[135].........[128] [7[6[5[4[3[2[1[0]
v2*n+1 F D B 9| E C A 8
[135] [134] [133] [132] [7] [6] [5] [4]
VLEN=256b, SLEN=128b, SEW=64b, LMUL=1, MLEN=64b
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
vn 3 1| 2 0
[129] [128] [1] [0]
VLEN=256b, SLEN=128b, SEW=32b, LMUL=1/2, MLEN=64b
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
vn - - 3 1| - - 2 0
[129] [128] [1] [0]
VLEN=256b, SLEN=128b, SEW=64b, LMUL=1, MLEN=64b
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
vn 3 1| 2 0
[192] [128] [64] [0]
----
----------------------------------------------------------------------
VLEN=256b, SLEN=128b, SEW=32b, LMUL=2
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2*n 7 5 3 1| 6 4 2 0
v2*n+1 F D B 9| E C A 8
VLEN=512b, SLEN=128b, SEW=32b, LMUL=1
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2 D 9 5 1| C 8 4 0
3 2
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2 F B 7 3| E A 6 2
VLEN=512b, SLEN=128b, SEW=64b, LMUL=1
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2 [A,B] 5 [2,3] 1| [8,9] 4 [0,1] 0
3 2
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2 [E,F] 7 [6,7] 3| [C,D] 6 [4,5] 2
----------------------------------------------------------------------
fix SLEN=128b, DLEN>=128
VLEN=512b, SLEN=128, DLEN=256, EEW=16b
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2 7 5 3 1| 6 4 2 0
v2 F D B 9| E C A 8
VLEN=512b, SLEN=128, DLEN=256, EEW=32b
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2 7 5 3 1| 6 4 2 0
v2 F D B 9| E C A 8
VLEN=512b, SLEN=128, DLEN=256, EEW=64b
Section 1 | 0
Byte 1F1E1D1C1B1A19181716151413121110| F E D C B A 9 8 7 6 5 4 3 2 1 0
v2 3 1| 2 0
v2 7 5| 6 4