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