use crate::*;
const ALIGNED_ADDR: u64 = 0x3000; const UNALIGNED_ADDR: u64 = 0x3001;
#[test]
fn test_lddqu_xmm0_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x04, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm1_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x0c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm2_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x14, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm3_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x1c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm4_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x24, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm5_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x2c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm6_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x34, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm7_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm8_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x04, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm9_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x0c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm10_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x14, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm11_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x1c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm12_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x24, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm13_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x2c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm14_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x34, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm15_mem_aligned() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm0_mem_unaligned_1byte() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x04, 0x25, 0x01, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm1_mem_unaligned_2byte() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x0c, 0x25, 0x02, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm2_mem_unaligned_4byte() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x14, 0x25, 0x04, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm3_mem_unaligned_8byte() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x1c, 0x25, 0x08, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm4_mem_unaligned_odd() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x24, 0x25, 0x03, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm5_mem_unaligned_5byte() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x2c, 0x25, 0x05, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm6_mem_unaligned_7byte() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x34, 0x25, 0x07, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_xmm7_mem_unaligned_15byte() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x3c, 0x25, 0x0f, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_multiple_loads() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x04, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf2, 0x0f, 0xf0, 0x0c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf2, 0x0f, 0xf0, 0x14, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_sequential_addresses() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x04, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf2, 0x0f, 0xf0, 0x0c, 0x25, 0x10, 0x30, 0x00, 0x00, 0xf2, 0x0f, 0xf0, 0x14, 0x25, 0x20, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_high_regs() {
let mut emu = emu64();
let code = [
0xf2, 0x44, 0x0f, 0xf0, 0x04, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf2, 0x44, 0x0f, 0xf0, 0x14, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf2, 0x44, 0x0f, 0xf0, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_lddqu_cache_line_boundary() {
let mut emu = emu64();
let code = [
0xf2, 0x0f, 0xf0, 0x04, 0x25, 0x38, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}