use crate::*;
const ALIGNED_ADDR: u64 = 0x3000;
#[test]
fn test_vhaddps_xmm_basic() {
let mut emu = emu64();
let code = [
0xc5, 0xf3, 0x7c, 0xc2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_same_dest_src1() {
let mut emu = emu64();
let code = [
0xc5, 0xf3, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_all_regs() {
let mut emu = emu64();
let code = [
0xc5, 0xdb, 0x7c, 0xdd, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_high_regs() {
let mut emu = emu64();
let code = [
0xc5, 0xc3, 0x7c, 0xf2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_extended_dest() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x73, 0x7c, 0xc2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_extended_src1() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x33, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_extended_src2() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x6b, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_all_extended() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x1b, 0x7c, 0xdd, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_r14_r15_r8() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x03, 0x7c, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_mem() {
let mut emu = emu64();
let code = [
0xc5, 0xfb, 0x7c, 0x0d, 0x00, 0x40, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
let test_data: [u8; 16] = [
0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0x40, ];
emu.maps.write_bytes_slice(ALIGNED_ADDR, &test_data);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_mem_extended() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x23, 0x7c, 0x15, 0x00, 0x40, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
let test_data: [u8; 16] = [
0x00, 0x00, 0xa0, 0x40, 0x00, 0x00, 0xc0, 0x40, 0x00, 0x00, 0xe0, 0x40, 0x00, 0x00, 0x00, 0x41, ];
emu.maps.write_bytes_slice(ALIGNED_ADDR, &test_data);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_xmm_self() {
let mut emu = emu64();
let code = [
0xc5, 0xfb, 0x7c, 0xc0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_basic() {
let mut emu = emu64();
let code = [
0xc5, 0xf7, 0x7c, 0xc2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_same_dest_src1() {
let mut emu = emu64();
let code = [
0xc5, 0xf7, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_all_regs() {
let mut emu = emu64();
let code = [
0xc5, 0xdf, 0x7c, 0xdd, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_high_regs() {
let mut emu = emu64();
let code = [
0xc5, 0xc7, 0x7c, 0xf2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_extended_dest() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x77, 0x7c, 0xc2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_extended_src1() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x37, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_extended_src2() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x6f, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_all_extended() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x1f, 0x7c, 0xdd, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_r14_r15_r8() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x07, 0x7c, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_mem() {
let mut emu = emu64();
let code = [
0xc5, 0xff, 0x7c, 0x0d, 0x00, 0x40, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
let test_data: [u8; 32] = [
0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0xa0, 0x40, 0x00, 0x00, 0xc0, 0x40, 0x00, 0x00, 0xe0, 0x40, 0x00, 0x00, 0x00, 0x41, ];
emu.maps.write_bytes_slice(ALIGNED_ADDR, &test_data);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_mem_extended() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x27, 0x7c, 0x15, 0x00, 0x40, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
let test_data: [u8; 32] = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
emu.maps.write_bytes_slice(ALIGNED_ADDR, &test_data);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddps_ymm_self() {
let mut emu = emu64();
let code = [
0xc5, 0xd7, 0x7c, 0xed, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_basic() {
let mut emu = emu64();
let code = [
0xc5, 0xf3, 0x7c, 0xc2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_same_dest_src1() {
let mut emu = emu64();
let code = [
0xc5, 0xf3, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_all_regs() {
let mut emu = emu64();
let code = [
0xc5, 0xdb, 0x7c, 0xdd, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_high_regs() {
let mut emu = emu64();
let code = [
0xc5, 0xc3, 0x7c, 0xf2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_extended_dest() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x73, 0x7c, 0xc2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_extended_src1() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x33, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_extended_src2() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x6b, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_all_extended() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x1b, 0x7c, 0xdd, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_r14_r15_r8() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x03, 0x7c, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_mem() {
let mut emu = emu64();
let code = [
0xc5, 0xfb, 0x7c, 0x0d, 0x00, 0x40, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
let test_data: [u8; 16] = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, ];
emu.maps.write_bytes_slice(ALIGNED_ADDR, &test_data);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_mem_extended() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x23, 0x7c, 0x15, 0x00, 0x40, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
let test_data: [u8; 16] = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, ];
emu.maps.write_bytes_slice(ALIGNED_ADDR, &test_data);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_xmm_self() {
let mut emu = emu64();
let code = [
0xc5, 0xeb, 0x7c, 0xd2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_basic() {
let mut emu = emu64();
let code = [
0xc5, 0xf7, 0x7c, 0xc2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_same_dest_src1() {
let mut emu = emu64();
let code = [
0xc5, 0xf7, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_all_regs() {
let mut emu = emu64();
let code = [
0xc5, 0xdf, 0x7c, 0xdd, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_high_regs() {
let mut emu = emu64();
let code = [
0xc5, 0xc7, 0x7c, 0xf2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_extended_dest() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x77, 0x7c, 0xc2, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_extended_src1() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x37, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_extended_src2() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x6f, 0x7c, 0xca, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_all_extended() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x1f, 0x7c, 0xdd, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_r14_r15_r8() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x07, 0x7c, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_mem() {
let mut emu = emu64();
let code = [
0xc5, 0xff, 0x7c, 0x0d, 0x00, 0x40, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
let test_data: [u8; 32] = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, ];
emu.maps.write_bytes_slice(ALIGNED_ADDR, &test_data);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_mem_extended() {
let mut emu = emu64();
let code = [
0xc4, 0xc1, 0x27, 0x7c, 0x15, 0x00, 0x40, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
let test_data: [u8; 32] = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
emu.maps.write_bytes_slice(ALIGNED_ADDR, &test_data);
emu.run(None).unwrap();
}
#[test]
fn test_vhaddpd_ymm_self() {
let mut emu = emu64();
let code = [
0xc5, 0xc7, 0x7c, 0xff, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}