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_r_3(
&mut self,
name: *const core::ffi::c_char,
dst: RegisterA64,
src1: RegisterA64,
src2: RegisterA64,
op: u8,
op2: u8,
) {
if self.log_text {
self.log_c_char_register_a_64_register_a_64_register_a_64_i32(name, dst, src1, src2, 0);
}
assert!(
dst.kind() == KindA64::w
|| dst.kind() == KindA64::x
|| dst.kind() == KindA64::d
|| dst.kind() == KindA64::s
);
assert!(dst.kind() == src1.kind() && dst.kind() == src2.kind());
let sf = if dst.kind() == KindA64::x {
0x80000000
} else {
0
};
self.place(
(dst.index() as u32)
| ((src1.index() as u32) << 5)
| ((op2 as u32) << 10)
| ((src2.index() as u32) << 16)
| ((op as u32) << 21)
| sf,
);
self.commit();
}
}