use crate::*;
const ADDR: u64 = 0x3000;
#[test]
fn test_clflushopt_basic() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_single_line() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_offset_1() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x10, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_offset_2() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x20, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_offset_3() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_sequential() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_multiple_lines() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x80, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_cache_line_aligned() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_unaligned() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x01, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_with_sfence() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_with_mfence() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_ordering_1() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_ordering_2() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_invalidate() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_writeback() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_all_levels() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_performance() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_weakly_ordered() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_persistence() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_modified_line() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_shared_line() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_exclusive_line() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_range_1() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_range_2() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x80, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_buffer_flush() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_data_sync() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_coherency() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_dma_buffer() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_io_coherency() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_large_buffer() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x80, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0xc0, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_streaming_data() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_memory_mapped_io() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_cache_control() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_batch_flush_1() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_batch_flush_2() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_nvdimm() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_persistent_memory() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_transaction_log() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_durability() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_optimized_ordering() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x40, 0x30, 0x00, 0x00, 0x66, 0x0f, 0xae, 0x3c, 0x25, 0x80, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_hierarchical_flush() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_bypass_cache() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_memory_barrier() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf0, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}
#[test]
fn test_clflushopt_store_barrier() {
let mut emu = emu64();
let code = [
0x66, 0x0f, 0xae, 0x3c, 0x25, 0x00, 0x30, 0x00, 0x00, 0x0f, 0xae, 0xf8, 0xf4, ];
emu.load_code_bytes(&code);
emu.run(None).unwrap();
}