jit {,66}0F2A (cvtpi2ps, cvtsi2ss, cvtpi2pd, cvtsi2sd)

This commit is contained in:
Fabian 2021-04-04 22:56:50 -05:00
parent 9e63bab294
commit 2b2d22f6d3
3 changed files with 17 additions and 6 deletions

View file

@ -647,8 +647,8 @@ const encodings = [
{ sse: 1, opcode: 0x660F28, e: 1, custom: 1 },
{ sse: 1, opcode: 0x0F29, e: 1, custom: 1 },
{ sse: 1, opcode: 0x660F29, e: 1, custom: 1 },
{ sse: 1, opcode: 0x0F2A, e: 1, },
{ sse: 1, opcode: 0x660F2A, e: 1, },
{ sse: 1, opcode: 0x0F2A, e: 1, custom: 1 },
{ sse: 1, opcode: 0x660F2A, e: 1, custom: 1 },
{ sse: 1, opcode: 0xF20F2A, e: 1, },
{ sse: 1, opcode: 0xF30F2A, e: 1, },
{ sse: 1, opcode: 0x0F2B, reg_ud: 1, e: 1, custom: 1 },

View file

@ -900,6 +900,7 @@ pub unsafe fn instr_660F29_reg(r1: i32, r2: i32) {
mov_r_r128(r1, r2);
}
#[no_mangle]
pub unsafe fn instr_0F2A(source: u64, r: i32) {
// cvtpi2ps xmm, mm/m64
// Note: Casts here can fail
@ -909,12 +910,11 @@ pub unsafe fn instr_0F2A(source: u64, r: i32) {
write_xmm64(r, std::mem::transmute(result));
transition_fpu_to_mmx();
}
#[no_mangle]
pub unsafe fn instr_0F2A_reg(r1: i32, r2: i32) { instr_0F2A(read_mmx64s(r1), r2); }
#[no_mangle]
pub unsafe fn instr_0F2A_mem(addr: i32, r: i32) {
instr_0F2A(return_on_pagefault!(safe_read64s(addr)), r);
}
#[no_mangle]
pub unsafe fn instr_660F2A(source: u64, r: i32) {
// cvtpi2pd xmm, xmm/m64
// These casts can't fail
@ -925,9 +925,7 @@ pub unsafe fn instr_660F2A(source: u64, r: i32) {
write_xmm_reg128(r, result);
transition_fpu_to_mmx();
}
#[no_mangle]
pub unsafe fn instr_660F2A_reg(r1: i32, r2: i32) { instr_660F2A(read_mmx64s(r1), r2); }
#[no_mangle]
pub unsafe fn instr_660F2A_mem(addr: i32, r: i32) {
instr_660F2A(return_on_pagefault!(safe_read64s(addr)), r);
}

View file

@ -5100,6 +5100,19 @@ pub fn instr_660F29_mem_jit(ctx: &mut JitContext, modrm_byte: ModrmByte, r: u32)
}
pub fn instr_660F29_reg_jit(ctx: &mut JitContext, r1: u32, r2: u32) { sse_mov_xmm_xmm(ctx, r2, r1) }
pub fn instr_0F2A_mem_jit(ctx: &mut JitContext, modrm_byte: ModrmByte, r: u32) {
mmx_read64_mm_mem(ctx, "instr_0F2A", modrm_byte, r);
}
pub fn instr_0F2A_reg_jit(ctx: &mut JitContext, r1: u32, r2: u32) {
mmx_read64_mm_mm(ctx, "instr_0F2A", r1, r2);
}
pub fn instr_660F2A_mem_jit(ctx: &mut JitContext, modrm_byte: ModrmByte, r: u32) {
mmx_read64_mm_mem(ctx, "instr_660F2A", modrm_byte, r);
}
pub fn instr_660F2A_reg_jit(ctx: &mut JitContext, r1: u32, r2: u32) {
mmx_read64_mm_mm(ctx, "instr_660F2A", r1, r2);
}
pub fn instr_0F2B_mem_jit(ctx: &mut JitContext, modrm_byte: ModrmByte, r: u32) {
instr_0F29_mem_jit(ctx, modrm_byte, r)
}