Commit 632954d
committed
Add Tag_RISCV_cfi_encoding for CFI instruction interpretation
CFI extensions use NOP or MOP (Maybe Operation) instructions to ensure
correct program execution even when hardware doesn't implement CFI.
However, this design conflicts with current toolchain conventions,
where X extension instructions are only usable when the X extension
is enabled: assemblers accept corresponding mnemonics and disassemblers
decode instructions only when the extension is active.
The CFI use case requires different behavior:
- Zicfiss instructions should be available when Zimop extension is present
- Zicfilp instructions should be usable even without explicit enabling
(since auipc is in baseline ISA)
Following conventional toolchain behavior would force compilers to
generate 'mop' instructions and 'auipc x0, <lpad-value>' instead of
'sspush/sspop' and 'lpad <lpad-value>', causing user confusion.
While this could be addressed at the ISA specification level, such
changes involve complex and time-consuming procedures. Therefore,
this psABI defines Tag_RISCV_cfi_encoding to provide toolchain
implementations with clear guidance.
This tag indicates when instruction encodings should be reinterpreted
for CFI extensions: Zimop encodings as Zicfiss instructions and
'auipc x0, <value>' as 'lpad <value>' (Zicfilp), regardless of
whether these extensions are explicitly enabled.1 parent 712449f commit 632954d
1 file changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1272 | 1272 | | |
1273 | 1273 | | |
1274 | 1274 | | |
| 1275 | + | |
1275 | 1276 | | |
1276 | 1277 | | |
1277 | 1278 | | |
| |||
1437 | 1438 | | |
1438 | 1439 | | |
1439 | 1440 | | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
1440 | 1464 | | |
1441 | 1465 | | |
1442 | 1466 | | |
| |||
0 commit comments