FROOTN 2nd argument is integer
[libreriscv.git] / rv_major_opcode_1010011.mdwn
1 # Summary FP Opcodes
2
3 This page aids and assists in the development of FP proposals,
4 by identifying and listing in full both publicly-known proposals
5 and the full brownfield encoding space available in the 0b010011
6 major opcode.
7
8 A primary critical use-case for extending FP is for 3D and supercomputing.
9
10 Publicly-known FP proposals:
11
12 * Zfrsqrt - Reciprocal SQRT <http://bugs.libre-riscv.org/show_bug.cgi?id=110>
13 * Zftrans - see [[ztrans_proposal]]: Transcendentals
14 (FPOW, FEXP, FLOG, FCBRT)
15 <http://bugs.libre-riscv.org/show_bug.cgi?id=127>
16 * Ztrig\* - see [[ztrans_proposal]]: Trigonometriics
17 (FSIN, FCOS, FTAN, arc-variants, hypotenuse-variants)
18 * Extension of formats to cover FP16 (RISC-V ISA Manual Table 11.3 "fmt field")
19 * HI-half FP MV - <https://github.com/riscv/riscv-isa-manual/pull/301>
20 <https://groups.google.com/a/groups.riscv.org/forum/m/#!topic/isa-dev/kXgfFqgBv-c>
21 * (Add new entries here: Zextname - Description and URL)
22
23 [[!toc levels=2]]
24
25 # Main FP opcode 1010011 table
26
27 Notes:
28
29 * Proposed new encodings in **bold**.
30 * *Use funct5 sparingly!* - 2-operand functions only.
31 * Single-argument FP operations should go under one of the funct5 tables
32 * Both dual and single argument FP operations that do not require
33 "rounding mode" should go in one of the funct5 tables that already use
34 "funct3".
35 * The rs2 field can be best used to sub-select a considerable number
36 of 1-op operations, with "rounding" in funct3
37 * The funct3 field can be best used to sub-select a considerable number
38 of 2-op operations
39 * 1-op operations that do not need "rounding" have the best brownfield
40 availability: 8 bit sub-selection (rs2=5 + funct3=3). This however is
41 rare as most FP operations need "rounding" selection.
42 * Be careful not to use encoding space for which FP16 has already been
43 reserved (mostly FP conversion opcodes)
44
45 [[!table data="""
46 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
47 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
48 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
49 00000 | xx | rs2 | rs1 | rm | rd | 1010011 | FADD.xx |
50 00001 | xx | rs2 | rs1 | rm | rd | 1010011 | FSUB.xx |
51 00010 | xx | rs2 | rs1 | rm | rd | 1010011 | FMUL.xx |
52 00011 | xx | rs2 | rs1 | rm | rd | 1010011 | FDIV.xx |
53 00100 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
54 00101 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=00101 |
55 00110 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
56 00111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
57 01000 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=01000 |
58 01001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
59 01010 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
60 01011 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=01011 |
61 01100 | xx | rs2 | rs1 | yyy | rd | 1010011 | **FHYPOT.xx** |
62 01101 | xx | rs2 | rs1 | rm | rd | 1010011 | **FATAN2.xx** |
63 01110 | xx | rs2 | rs1 | rm | rd | 1010011 | **FATAN2PI.xx**|
64 01111 | xx | rs2 | rs1 | rm | rd | 1010011 | **FPOW.xx** |
65 10000 | xx | rs2 | rs1 | yyy | rd | 1010011 | **FROOTN.xx** |
66 10001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
67 10010 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
68 10011 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
69 10100 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=10100 |
70 10101 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
71 10110 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
72 10111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
73 11000 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11000 |
74 11001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
75 11010 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11010 |
76 11100 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11100 |
77 11101 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
78 11110 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11110 |
79 11111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
80 """]]
81
82 Code:
83
84 * xx: Opcode format field "fmt" - Table 11.3
85 * xxxxx: 5-bit selection field (usually 1-op selection)
86 * yyy: funct3 selection field (usually 2-op selection)
87 * rm: "rounding mode"
88
89 ## funct5 = 00000 - FADD
90
91 No brownfield encodings available.
92
93 ## funct5 = 00001 - FSUB
94
95 No brownfield encodings available.
96
97 ## funct5 = 00010 - FMUL
98
99 No brownfield encodings available.
100
101 ## funct5 = 00011 - FDIV
102
103 No brownfield encodings available.
104
105 ## funct5 = 00100 - unused
106
107 Brownfield encodings available.
108
109 ## funct5 = 00100 - FSGN
110
111 This table uses funct3 for encoding 2-operand FP operations
112
113 [[!table data="""
114 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
115 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
116 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
117 00100 | xx | rs2 | rs1 | 000 | rd | 1010011 | FSGNJ.xx |
118 00100 | xx | rs2 | rs1 | 001 | rd | 1010011 | FSGNJN.xx |
119 00100 | xx | rs2 | rs1 | 010 | rd | 1010011 | FSGNJX.xx |
120 00100 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
121 00100 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
122 00100 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
123 00100 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
124 00100 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
125 """]]
126
127 ## funct5 = 00101 - FMIN/MAX
128
129 This table uses funct3 for encoding 2-operand FP operations where the result
130 register is a **floating-point** value.
131
132 [[!table data="""
133 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
134 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
135 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
136 00101 | xx | rs2 | rs1 | 000 | rd | 1010011 | FMIN.S |
137 00101 | xx | rs2 | rs1 | 001 | rd | 1010011 | FMAX.S |
138 00101 | xx | rs2 | rs1 | 010 | rd | 1010011 | ?f3=010 |
139 00101 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
140 00101 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
141 00101 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
142 00101 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
143 00101 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
144 """]]
145
146 ## funct5 = 00110 - unused
147
148 Brownfield encodings available.
149
150 ## funct5 = 00111 - unused
151
152 Brownfield encodings available.
153
154 ## funct5 = 01000 - FCVT
155
156 This table uses rs2 for encoding 1-operand FP operations, using
157 funct3 to specify the "rounding" mode
158
159 Notes:
160
161 * FP16 logically deduced from fmt field encoding (bits 25-26)
162
163 [[!table data="""
164 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
165 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
166 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
167 01000 | 00 | 00000 | rs1 | rm | rd | 1010011 | ???????? |
168 01000 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.S.D |
169 01000 | 00 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.S.H**|
170 01000 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.S.Q |
171 01000 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
172 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
173 01000 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.D.S |
174 01000 | 01 | 00001 | rs1 | rm | rd | 1010011 | ???????? |
175 01000 | 01 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.D.H**|
176 01000 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.D.Q |
177 01000 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
178 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
179 01000 | 10 | 00000 | rs1 | rm | rd | 1010011 | FCVT.H.S |
180 01000 | 10 | 00001 | rs1 | rm | rd | 1010011 | **FCVT.H.D**|
181 01000 | 10 | 00010 | rs1 | rm | rd | 1010011 | ???????? |
182 01000 | 10 | 00011 | rs1 | rm | rd | 1010011 | FCVT.H.Q |
183 01000 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
184 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
185 01000 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.Q.S |
186 01000 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.Q.D |
187 01000 | 11 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.Q.H**|
188 01000 | 11 | 00011 | rs1 | rm | rd | 1010011 | ???????? |
189 01000 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
190 """]]
191
192 ## funct5 = 01001 - unused
193
194 Brownfield encodings available.
195
196 ## funct5 = 01010 - unused
197
198 Brownfield encodings available.
199
200 ## funct5 = 01011 - 1-op Transcendentals <a name="transcendentals_1op"></a>
201
202 This table uses rs2 for encoding 1-operand FP operations, using
203 funct3 to specify the "rounding" mode
204
205 [[!table data="""
206 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
207 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
208 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
209 01011 | xx | 00000 | rs1 | rm | rd | 1010011 | FSQRT.xx |
210 01011 | xx | 00001 | rs1 | rm | rd | 1010011 | **FRSQRT.xx** |
211 01011 | xx | 00010 | rs1 | rm | rd | 1010011 | **FRECIP.xx** |
212 01011 | xx | 00011 | rs1 | rm | rd | 1010011 | **FCBRT.xx** |
213 01011 | xx | 00100 | rs1 | rm | rd | 1010011 | **FEXP2.xx** |
214 01011 | xx | 00101 | rs1 | rm | rd | 1010011 | **FLOG2.xx** |
215 01011 | xx | 00110 | rs1 | rm | rd | 1010011 | **FEXPM1.xx** |
216 01011 | xx | 00111 | rs1 | rm | rd | 1010011 | **FLOGP1.xx** |
217 01011 | xx | 01000 | rs1 | rm | rd | 1010011 | **FEXP.xx** |
218 01011 | xx | 01001 | rs1 | rm | rd | 1010011 | **FLOG.xx** |
219 01011 | xx | 01010 | rs1 | rm | rd | 1010011 | **FEXP10.xx** |
220 01011 | xx | 01011 | rs1 | rm | rd | 1010011 | **FLOG10.xx** |
221 01011 | xx | 01100 | rs1 | rm | rd | 1010011 | **FASINH.xx** |
222 01011 | xx | 01101 | rs1 | rm | rd | 1010011 | **FACOSH.xx** |
223 01011 | xx | 01110 | rs1 | rm | rd | 1010011 | **FATANH.xx** |
224 01011 | xx | 01111 | rs1 | rm | rd | 1010011 | ? |
225 01011 | xx | 10000 | rs1 | rm | rd | 1010011 | **FSIN.xx** |
226 01011 | xx | 10001 | rs1 | rm | rd | 1010011 | **FSINPI.xx** |
227 01011 | xx | 10010 | rs1 | rm | rd | 1010011 | **FASIN.xx** |
228 01011 | xx | 10011 | rs1 | rm | rd | 1010011 | **FASINPI.xx**|
229 01011 | xx | 10100 | rs1 | rm | rd | 1010011 | **FCOS.xx** |
230 01011 | xx | 10101 | rs1 | rm | rd | 1010011 | **FCOSPI.xx** |
231 01011 | xx | 10110 | rs1 | rm | rd | 1010011 | **FACOS.xx** |
232 01011 | xx | 10111 | rs1 | rm | rd | 1010011 | **FACOSPI.xx**|
233 01011 | xx | 11000 | rs1 | rm | rd | 1010011 | **FTAN.xx** |
234 01011 | xx | 11001 | rs1 | rm | rd | 1010011 | **FTANPI.xx** |
235 01011 | xx | 11010 | rs1 | rm | rd | 1010011 | **FATAN.xx** |
236 01011 | xx | 11011 | rs1 | rm | rd | 1010011 | **FATANPI.xx**|
237 01011 | xx | 11100 | rs1 | rm | rd | 1010011 | **FSINH.xx** |
238 01011 | xx | 11101 | rs1 | rm | rd | 1010011 | **FCOSH.xx** |
239 01011 | xx | 11110 | rs1 | rm | rd | 1010011 | **FTANH.xx** |
240 01011 | xx | 11111 | rs1 | rm | rd | 1010011 | ? |
241 """]]
242
243 ## funct5 = 01100 - **FHYPOT**
244
245 Proposed for Zftrans - FHYPOT: "sqrt(rs1 * rs1 + rs2 * rs2)"
246
247 ## funct5 = 01101 - **FATAN2**
248
249 Proposed for Zftrans - FATAN: "atan(rs1, rs2)"
250
251 ## funct5 = 01110 - **FATAN2PI**
252
253 Proposed for ZftransExt - FATAN2PI: "atan2(rs1, rs2) * PI".
254 Rationale: Gives better accuracy than if using FMUL with the constant, PI.
255
256 ## funct5 = 01111 - **FPOW**
257
258 Proposed for ZftransAdv - FPOW: "FP rs1 to the power of rs2"
259
260 ## funct5 = 10000 - **FROOTN**
261
262 Proposed for ZftransAdv - FPROOTN: "FP rs1 to the power of (1/rs2)".
263 rs1 is FP, rs2 is **integer**.
264
265 ## funct5 = 10000 - unused
266
267 Brownfield encodings available.
268
269 ## funct5 = 10001 - unused
270
271 Brownfield encodings available.
272
273 ## funct5 = 10010 - unused
274
275 Brownfield encodings available.
276
277 ## funct5 = 10011 - unused
278
279 Brownfield encodings available.
280
281 ## funct5 = 10100 - FP comparisons
282
283 This table uses funct3 for encoding 2-operand FP "comparison" operations
284 where the result register is an **integer**
285
286 Notes:
287
288 * FNE missing?
289
290 [[!table data="""
291 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
292 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
293 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
294 10100 | xx | rs2 | rs1 | 000 | rd | 1010011 | FLE.xx |
295 10100 | xx | rs2 | rs1 | 001 | rd | 1010011 | FLT.xx |
296 10100 | xx | rs2 | rs1 | 010 | rd | 1010011 | FEQ.xx |
297 10100 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
298 10100 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
299 10100 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
300 10100 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
301 10100 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
302 """]]
303
304 ## funct5 = 10101 - unused
305
306 Brownfield encodings available.
307
308 ## funct5 = 10110 - unused
309
310 Brownfield encodings available.
311
312 ## funct5 = 10111 - unused
313
314 Brownfield encodings available.
315
316 ## funct5 = 11000 - FCVT
317
318 This table uses rs2 for encoding 1-operand FP operations, using
319 funct3 to specify the "rounding" mode
320
321 Notes:
322
323 * FP16 logically deduced from fmt field (bits 25-26)
324
325 [[!table data="""
326 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
327 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
328 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
329 11000 | 00 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.S |
330 11000 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.S |
331 11000 | 00 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.S |
332 11000 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.S |
333 11000 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
334 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
335 11000 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.D |
336 11000 | 01 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.D |
337 11000 | 01 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.D |
338 11000 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.D |
339 11000 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
340 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
341 11000 | 10 | 00000 | rs1 | rm | rd | 1010011 |**FCVT.W.H** |
342 11000 | 10 | 00001 | rs1 | rm | rd | 1010011 |**FCVT.WU.H**|
343 11000 | 10 | 00010 | rs1 | rm | rd | 1010011 |**FCVT.L.H** |
344 11000 | 10 | 00011 | rs1 | rm | rd | 1010011 |**FCVT.LU.H**|
345 11000 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
346 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
347 11000 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.Q |
348 11000 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.Q |
349 11000 | 11 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.Q |
350 11000 | 11 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.Q |
351 11000 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
352 """]]
353
354 ## funct5 = 11001 - unused
355
356 Brownfield encodings available.
357
358 ## funct5 = 11010 - FCVT
359
360 This table uses rs2 for encoding 1-operand FP operations, using
361 funct3 to specify the "rounding" mode
362
363 * FP16 logically deduced from fmt field (bits 25-26)
364
365 [[!table data="""
366 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
367 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
368 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
369 11010 | 00 | 00000 | rs1 | rm | rd | 1010011 | FCVT.S.W |
370 11010 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.S.WU |
371 11010 | 00 | 00010 | rs1 | rm | rd | 1010011 | FCVT.S.L |
372 11010 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.S.LU |
373 11010 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
374 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
375 11010 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.D.W |
376 11010 | 01 | 00001 | rs1 | rm | rd | 1010011 | FCVT.D.WU |
377 11010 | 01 | 00010 | rs1 | rm | rd | 1010011 | FCVT.D.L |
378 11010 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.D.LU |
379 11010 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
380 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
381 11010 | 10 | 00000 | rs1 | rm | rd | 1010011 |**FCVT.H.W** |
382 11010 | 10 | 00001 | rs1 | rm | rd | 1010011 |**FCVT.H.WU**|
383 11010 | 10 | 00010 | rs1 | rm | rd | 1010011 |**FCVT.H.L** |
384 11010 | 10 | 00011 | rs1 | rm | rd | 1010011 |**FCVT.H.LU**|
385 11010 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
386 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
387 11010 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.Q.W |
388 11010 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.Q.WU |
389 11010 | 11 | 00010 | rs1 | rm | rd | 1010011 | FCVT.Q.L |
390 11010 | 11 | 00011 | rs1 | rm | rd | 1010011 | FCVT.Q.LU |
391 11010 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
392 """]]
393
394 ## funct5 = 11100 - FMV, FCLASS
395
396 This table uses *both* rs2 *and* funct3 for encoding 1-operand FP operations.
397
398 Notes:
399
400 * FMV.X.Q is missing (alias of FMVH.X.D if it existed)
401 * FP16 logically deduced from fmt field (bits 25-26)
402 * FMVH.X.HW (half-word) missing?
403
404 [[!table data="""
405 31..27| 26..25| 24..20 |19..15|14...12| 11..7 | 6....0 | function |
406 funct5| SDHQ | rs2 | rs1 |funct3 | rd | opcode | name |
407 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
408 11100 | 00 | 00000 | rs1 | 000 | rd | 1010011 | FMV.X.W |
409 11100 | 00 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.S |
410 11100 | 00 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
411 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
412 11100 | 01 | 00000 | rs1 | 000 | rd | 1010011 | FMV.X.D **FMVH.X.W** |
413 11100 | 01 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.D |
414 11100 | 01 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
415 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
416 11100 | 10 | 00000 | rs1 | 000 | rd | 1010011 |**FMV.X.H** |
417 11100 | 10 | 00000 | rs1 | 001 | rd | 1010011 |**FCLASS.H** |
418 11100 | 10 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
419 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
420 11100 | 11 | 00000 | rs1 | 000 | rd | 1010011 | **FMVH.X.D** |
421 11100 | 11 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.Q |
422 11100 | xx | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
423 """]]
424
425 ## funct5 = 11101 - unused
426
427 Brownfield encodings available.
428
429 ## funct5 = 11110 - FMV
430
431 This table uses *both* rs2 *and* funct3 for encoding 1-operand FP operations.
432
433 Notes:
434
435 * FMV.Q.X is missing (as is FMVH.D.X)
436 * FMVH.W.X is missing (alias of FMV.D.X)
437 * FP16 logically deduced from fmt field (bits 25-26)
438 * FMVH.HW.X (half-word) missing?
439
440 [[!table data="""
441 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
442 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
443 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
444 11110 | 00 | 00000 | rs1 | 000 | rd | 1010011 | FMV.W.X |
445 11110 | 00 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
446 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
447 11110 | 01 | 00000 | rs1 | 000 | rd | 1010011 | FMV.D.X |
448 11110 | 01 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
449 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
450 11110 | 10 | 00000 | rs1 | 000 | rd | 1010011 |**FMV.H.X** |
451 11110 | 10 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
452 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
453 11110 | 11 | 00000 | rs1 | 000 | rd | 1010011 | ? |
454 11110 | 11 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
455 """]]
456
457 ## funct5 = 11111 - unused
458
459 Brownfield encodings available.
460
461 ## funct5 = ????? (table template)
462
463 This table acts as a cut/paste template for creating brownfield encodings
464
465 [[!table data="""
466 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
467 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
468 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
469 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
470 """]]
471