From 2c2e25a1f6b5954df2376de4ebccb95355150d03 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sun, 1 Dec 2024 01:01:58 -0800 Subject: [PATCH] Update recommended use of xlen in CODE_STYLE Update CODE_STYLE.md to recommend using xlen instead of sizeof(xlen) to align with our current usage. --- CODE_STYLE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE_STYLE.md b/CODE_STYLE.md index f4eef2247..aafe3311c 100644 --- a/CODE_STYLE.md +++ b/CODE_STYLE.md @@ -62,11 +62,11 @@ Implementation * All instructions should be built as part of both the RV32 and RV64 models so as to provide a path to supporting mutable MXL/SXL/UXL; if necessary, - constructs like `assert(sizeof(xlen) == 32)` at the start of the body can be + constructs like `assert(xlen == 32)` at the start of the body can be used to suppress any type errors that arise as a result * Avoid the use of hard-coded constants like 32 even if the instruction is - RV32-specific, instead favouring `sizeof(xlen)` or a computed constant to + RV32-specific, instead favouring `xlen` or a computed constant to more clearly express the underlying intent * Local variables should be made immutable whenever possible, but short