Skip to content

Commit

Permalink
Implement orps
Browse files Browse the repository at this point in the history
Now gcc works when the sse2 bit is set in cpuid
  • Loading branch information
tbodt committed Jun 9, 2020
1 parent a31ddc1 commit 8d84030
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 5 additions & 4 deletions emu/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
case 0x4f: TRACEI("cmovnle modrm, reg");
READMODRM; CMOVN(LE, modrm_val, modrm_reg,oz); break;

case 0x57: TRACEI("xorps xmm, xmm:modrm");
READMODRM; V_OP(xor, xmm_modrm_val, xmm_modrm_reg,128);
break;

case 0x77: TRACEI("emms (ignored because there is no mmx)"); break;

case 0x80: TRACEI("jo rel\t");
Expand Down Expand Up @@ -339,6 +335,11 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
case 0x11: TRACEI("movups xmm, xmm:modrm");
READMODRM; VMOV(xmm_modrm_reg, xmm_modrm_val,128); break;

case 0x56: TRACEI("orps xmm:modrm, xmm");
READMODRM; V_OP(or, xmm_modrm_val, xmm_modrm_reg,128); break;
case 0x57: TRACEI("xorps xmm:modrm, xmm");
READMODRM; V_OP(xor, xmm_modrm_val, xmm_modrm_reg,128); break;

case 0x6f: TRACEI("movq modrm, mm");
READMODRM; VMOV(mm_modrm_val, mm_modrm_reg, 64); break;
case 0x7f: TRACEI("movq mm, modrm");
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/qemu/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4374,8 +4374,12 @@ pextrw : r=0000944a
pmovmskb : r=00009918
punpcklqdq: a=dc515cff944a58ec456723c698694873 b=41f21efba9e3e1461f297ccd58bad7ab r=1f297ccd58bad7ab456723c698694873
punpcklqdq: a=231be9e8cde7438d007c62c2085427f8 b=c233e9e8c4c9439a0f76255a085427f8 r=0f76255a085427f8007c62c2085427f8
orps : a=dc515cff944a58ec456723c698694873 b=41f21efba9e3e1461f297ccd58bad7ab r=ddf35effbdebf9ee5f6f7fcfd8fbdffb
orps : a=231be9e8cde7438d007c62c2085427f8 b=c233e9e8c4c9439a0f76255a085427f8 r=e33be9e8cdef439f0f7e67da085427f8
orpd : a=dc515cff944a58ec456723c698694873 b=41f21efba9e3e1461f297ccd58bad7ab r=ddf35effbdebf9ee5f6f7fcfd8fbdffb
orpd : a=231be9e8cde7438d007c62c2085427f8 b=c233e9e8c4c9439a0f76255a085427f8 r=e33be9e8cdef439f0f7e67da085427f8
xorps : a=dc515cff944a58ec456723c698694873 b=41f21efba9e3e1461f297ccd58bad7ab r=9da342043da9b9aa5a4e5f0bc0d39fd8
xorps : a=231be9e8cde7438d007c62c2085427f8 b=c233e9e8c4c9439a0f76255a085427f8 r=e1280000092e00170f0a479800000000
pshufd : a=dc515cff944a58ec456723c698694873 ib=78 r=456723c6dc515cff944a58ec98694873
pshufd : a=231be9e8cde7438d007c62c2085427f8 ib=78 r=007c62c2231be9e8cde7438d085427f8
pshuflw : a=dc515cff944a58ec456723c698694873 ib=78 r=dc515cff944a58ec9869456723c64873
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/qemu/qemu-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2503,9 +2503,9 @@ void test_sse(void)
// SSE_OP2(andpd);
// SSE_OP2(andnps);
// SSE_OP2(andnpd);
// SSE_OP2(orps);
SSE_OP2(orps);
SSE_OP2(orpd);
// SSE_OP2(xorps);
SSE_OP2(xorps);
// SSE_OP2(xorpd);

// SSE_OP2(unpcklps);
Expand Down

0 comments on commit 8d84030

Please sign in to comment.