Skip to content

Commit 1011ff9

Browse files
committed
Refine the comments
1 parent dfdadc8 commit 1011ff9

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/decode.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ enum op_field {
201201
_(fuse7)
202202

203203
/* clang-format off */
204-
/* IR list */
204+
/* IR (intermediate representation) is exclusively represented by RISC-V
205+
* instructions, yet it is executed at a lower cost.
206+
*/
205207
enum {
206208
#define _(inst, can_branch, insn_len, translatable, reg_mask) rv_insn_##inst,
207209
RV_INSN_LIST
@@ -325,22 +327,22 @@ typedef struct rv_insn {
325327
* optimization enables the self-recursive function to reuse the same
326328
* function stack frame.
327329
*
328-
* The @next member indicates the next intermediate representation
329-
* (IR) or is NULL if it is the final instruction in a basic block. The
330-
* @impl member facilitates the direct invocation of the next instruction
331-
* emulation without the need to compute the jump address. By utilizing
332-
* these two members, all instruction emulations can be rewritten into a
333-
* self-recursive version, enabling the compiler to leverage TCO.
330+
* The @next member indicates the next IR or is NULL if it is the final
331+
* instruction in a basic block. The @impl member facilitates the direct
332+
* invocation of the next instruction emulation without the need to compute
333+
* the jump address. By utilizing these two members, all instruction
334+
* emulations can be rewritten into a self-recursive version, enabling the
335+
* compiler to leverage TCO.
334336
*/
335337
struct rv_insn *next;
336338
bool (*impl)(riscv_t *, const struct rv_insn *, uint64_t, uint32_t);
337339

338340
/* Two pointers, 'branch_taken' and 'branch_untaken', are employed to
339341
* avoid the overhead associated with aggressive memory copying. Instead
340-
* of copying the entire intermediate representation (IR) array, these
341-
* pointers indicate the first IR of the first basic block in the path of
342-
* the taken and untaken branches. This allows for direct jumping to the
343-
* specific IR array without the need for additional copying.
342+
* of copying the entire IR array, these pointers indicate the first IR
343+
* of the first basic block in the path of the taken and untaken branches.
344+
* This allows for direct jumping to the specific IR array without the
345+
* need for additional copying.
344346
*/
345347
struct rv_insn *branch_taken, *branch_untaken;
346348
branch_history_table_t *branch_table;

0 commit comments

Comments
 (0)