Skip to content

Commit

Permalink
Designate semihosting entry/exit HINTs as standard, not custom (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
aswaterman authored Jan 8, 2025
1 parent 63267df commit b8f5aa6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
15 changes: 11 additions & 4 deletions src/rv32.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,10 @@ hints, security tags, and instrumentation flags for simulation/emulation.
(_rs2_=`x4`) NTL.S1 +
(_rs2_=`x5`) NTL.ALL

|SLLI |_rd_=`x0`, _rs1_=`x0`, _shamt_=31 |1|Semihosting entry marker

|SRAI |_rd_=`x0`, _rs1_=`x0`, _shamt_=7 |1|Semihosting exit marker

|SUB |_rd_=`x0` |latexmath:[$2^{10}$] .11+<.^m|_Designated for future standard use_

|AND |_rd_=`x0` |latexmath:[$2^{10}$]
Expand Down Expand Up @@ -1066,16 +1070,19 @@ hints, security tags, and instrumentation flags for simulation/emulation.

|SLTIU|_rd_=`x0` |latexmath:[$2^{17}$]

|SLLI |_rd_=`x0` |latexmath:[$2^{10}$]
|SLLI |_rd_=`x0`, and either _rs1_&#8800;``x0`` or _shamt_&#8800;31 |latexmath:[$2^{10}-1$]

|SRLI |_rd_=`x0` |latexmath:[$2^{10}$]

|SRAI |_rd_=`x0` |latexmath:[$2^{10}$]
|SRAI |_rd_=`x0`, and either _rs1_&#8800;``x0`` or _shamt_&#8800;7 |latexmath:[$2^{10}-1$]

|SLT |_rd_=`x0` |latexmath:[$2^{10}$]

|SLTU |_rd_=`x0` |latexmath:[$2^{10}$]
|===

TIP: When allocating `slli x0, x0, 0x1f` or `srai x0, x0, 7` as custom HINTs,
take note of their use in semihosting calls, as described in <<ecall-ebreak>>.
NOTE: `slli x0, x0, 0x1f` and `srai x0, x0, 7` were previously designated as
custom HINTs, but they have been appropriated for use in semihosting calls, as
described in <<ecall-ebreak>>.
To reflect their usage in practice, the base ISA spec has been changed to
designate them as standard HINTs.
15 changes: 12 additions & 3 deletions src/rv64.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ no standard HINTs will ever be defined in this subspace.
(_rs2_=_x4_) NTL.S1 +
(_rs2_=_x5_) NTL.ALL

|SLLI |_rd_=`x0`, _rs1_=`x0`, _shamt_=31 |1|Semihosting entry marker

|SRAI |_rd_=`x0`, _rs1_=`x0`, _shamt_=7 |1|Semihosting exit marker

|SUB |_rd_=_x0_ |latexmath:[$2^{10}$] .16+.^| _Designated for future standard use_

|AND |_rd_=_x0_ |latexmath:[$2^{10}$]
Expand Down Expand Up @@ -232,11 +236,11 @@ no standard HINTs will ever be defined in this subspace.

|SLTIU |_rd_=_x0_ |latexmath:[$2^{17}$]

|SLLI |_rd_=_x0_ |latexmath:[$2^{11}$]
|SLLI |_rd_=`x0`, and either _rs1_&#8800;``x0`` or _shamt_&#8800;31 |latexmath:[$2^{11}-1$]

|SRLI |_rd_=_x0_ |latexmath:[$2^{11}$]
|SRLI |_rd_=`x0` |latexmath:[$2^{11}$]

|SRAI |_rd_=_x0_ |latexmath:[$2^{11}$]
|SRAI |_rd_=`x0`, and either _rs1_&#8800;``x0`` or _shamt_&#8800;7 |latexmath:[$2^{11}-1$]

|SLLIW |_rd_=_x0_ |latexmath:[$2^{10}$]

Expand All @@ -249,3 +253,8 @@ no standard HINTs will ever be defined in this subspace.
|SLTU |_rd_=_x0_ |latexmath:[$2^{10}$]
|===

NOTE: `slli x0, x0, 0x1f` and `srai x0, x0, 7` were previously designated as
custom HINTs, but they have been appropriated for use in semihosting calls, as
described in <<ecall-ebreak>>.
To reflect their usage in practice, the base ISA spec has been changed to
designate them as standard HINTs.

0 comments on commit b8f5aa6

Please sign in to comment.