Skip to main content

luaur_code_gen/methods/
ir_reg_alloc_a_64_get_set.rs

1use crate::enums::kind_a_64::KindA64;
2use crate::records::ir_reg_alloc_a_64::IrRegAllocA64;
3use crate::records::set::Set;
4use luaur_common::macros::luau_unreachable::LUAU_UNREACHABLE;
5
6impl IrRegAllocA64 {
7    pub(crate) fn get_set(&mut self, kind: KindA64) -> &mut Set {
8        match kind {
9            KindA64::x | KindA64::w => &mut self.gpr,
10
11            KindA64::s | KindA64::d | KindA64::q => &mut self.simd,
12
13            _ => {
14                debug_assert!(false, "Unexpected register kind");
15                LUAU_UNREACHABLE!();
16            }
17        }
18    }
19}