Skip to main content

luaur_code_gen/methods/
assembly_builder_x_64_vpinsrd.rs

1use crate::records::assembly_builder_x_64::AssemblyBuilderX64;
2use crate::records::operand_x_64::OperandX64;
3use crate::records::register_x_64::RegisterX64;
4
5impl AssemblyBuilderX64 {
6    pub fn vpinsrd(&mut self, dst: RegisterX64, src1: RegisterX64, src2: OperandX64, offset: u8) {
7        // C++: placeAvx("vpinsrd", dst, src1, src2, offset, 0x22, false,
8        //               AVX_0F3A, AVX_66);
9        // dst is the real destination register (not noreg), and the opcode map
10        // is AVX_0F3A (0x3A -> 0b00011), not 0xF3.
11        self.place_avx_c_char_operand_x_64_operand_x_64_operand_x_64_u8_u8_bool_u8_u8(
12            b"vpinsrd\0".as_ptr() as *const core::ffi::c_char,
13            OperandX64::reg(dst),
14            OperandX64::reg(src1),
15            src2,
16            offset,
17            0x22,
18            false,
19            0x3A, // AVX_0F3A
20            0x66, // AVX_66
21        );
22    }
23}