luaur-code-gen 0.1.3

Native (A64/X64) code generation for Luau (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::enums::kind_a_64::KindA64;
use crate::records::assembly_builder_a_64::AssemblyBuilderA64;
use crate::records::register_a_64::RegisterA64;

impl AssemblyBuilderA64 {
    pub fn place_br(&mut self, name: *const core::ffi::c_char, src: RegisterA64, op: u32) {
        if self.log_text {
            self.log_c_char_register_a_64(name, src);
        }

        // Avoid CODEGEN_ASSERT! macro invocation here: it currently trips a type mismatch
        // in assert_call_handler arguments elsewhere in the codebase.
        debug_assert!(src.kind() == KindA64::x);

        self.place((src.index() as u32) << 5 | (op << 10));
        self.commit();
    }
}