Skip to content

Commit

Permalink
Clarify bit fiddling names.
Browse files Browse the repository at this point in the history
  • Loading branch information
vext01 committed Dec 20, 2023
1 parent 4f0e033 commit eb47831
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ykrt/src/compile/jitc_yk/jit_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eb47831

Please sign in to comment.