Implement movhps xmm, m64 and movlhps xmm, xmm (shared opcode)

This commit is contained in:
Amaan Cheval 2017-12-01 16:28:17 +05:30 committed by Fabian
parent 694434fb7b
commit da94185d2e
2 changed files with 34 additions and 3 deletions

View file

@ -419,6 +419,7 @@ const encodings = [
{ opcode: 0x660F14, e: 1 },
{ opcode: 0x0F15, e: 1 },
{ opcode: 0x660F15, e: 1 },
{ opcode: 0x0F16, e: 1 },
{ opcode: 0x0F28, e: 1 },
{ opcode: 0x660F28, e: 1 },

View file

@ -489,7 +489,21 @@ static void instr_660F15(union reg128 source, int32_t r) {
}
DEFINE_SSE_SPLIT(instr_660F15, safe_read128s, read_xmm128s)
static void instr_0F16() { unimplemented_sse(); }
static void instr_0F16_mem(int32_t addr, int32_t r) {
// movhps xmm, m64
task_switch_test_mmx();
union reg64 data = safe_read64s(addr);
union reg128 orig = read_xmm128s(r);
write_xmm128(r, orig.u32[0], orig.u32[1], data.u32[0], data.u32[1]);
}
static void instr_0F16_reg(int32_t r1, int32_t r2) {
// movlhps xmm, xmm
task_switch_test_mmx();
union reg128 data = read_xmm128s(r1);
union reg128 orig = read_xmm128s(r2);
write_xmm128(r2, orig.u32[0], orig.u32[1], data.u32[0], data.u32[1]);
}
static void instr_0F17() { unimplemented_sse(); }
static void instr_0F18_reg(int32_t r1, int32_t r2) { trigger_ud(); }
@ -3846,7 +3860,15 @@ switch(opcode)
break;
case 0x16:
{
instr_0F16();
int32_t modrm_byte = read_imm8();
if(modrm_byte < 0xC0)
{
instr_0F16_mem(modrm_resolve(modrm_byte), modrm_byte >> 3 & 7);
}
else
{
instr_0F16_reg(modrm_byte & 7, modrm_byte >> 3 & 7);
}
}
break;
case 0x17:
@ -8304,7 +8326,15 @@ switch(opcode)
break;
case 0x16:
{
instr_0F16();
int32_t modrm_byte = read_imm8();
if(modrm_byte < 0xC0)
{
instr_0F16_mem(modrm_resolve(modrm_byte), modrm_byte >> 3 & 7);
}
else
{
instr_0F16_reg(modrm_byte & 7, modrm_byte >> 3 & 7);
}
}
break;
case 0x17: