From eb47831171ace788c850f6fe9b6530fe8d219151 Mon Sep 17 00:00:00 2001 From: Edd Barrett Date: Wed, 20 Dec 2023 11:47:54 +0000 Subject: [PATCH] Clarify bit fiddling names. --- ykrt/src/compile/jitc_yk/jit_ir.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ykrt/src/compile/jitc_yk/jit_ir.rs b/ykrt/src/compile/jitc_yk/jit_ir.rs index 82215cf23..b1a5427de 100644 --- a/ykrt/src/compile/jitc_yk/jit_ir.rs +++ b/ykrt/src/compile/jitc_yk/jit_ir.rs @@ -18,13 +18,18 @@ const OPCODE_SIZE: u64 = 8; /// Max number of operands in a short instruction. const SHORT_INSTR_MAX_OPERANDS: u64 = 3; -/// Bit fiddling for a short operands. +/// Bit fiddling. +/// +/// In the constants below: +/// - `*_SIZE`: the size of a field in bits. +/// - `*_MASK`: a mask with one bits occupying the field in question. +/// +/// Bit fiddling for a short operands: const SHORT_OPERAND_SIZE: u64 = 18; const SHORT_OPERAND_KIND_SIZE: u64 = 3; const SHORT_OPERAND_KIND_MASK: u64 = 7; const SHORT_OPERAND_VALUE_SIZE: u64 = 15; const SHORT_OPERAND_MASK: u64 = 0x3ffff; - /// Bit fiddling for instructions. const INSTR_ISSHORT_SIZE: u64 = 1; const INSTR_ISSHORT_MASK: u64 = 1;