Skip to content

Commit

Permalink
Feature: X86 punpckhqdq rewriter
Browse files Browse the repository at this point in the history
  • Loading branch information
uxmal committed Jul 22, 2024
1 parent c7ac7f3 commit 085e691
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 27 deletions.
2 changes: 2 additions & 0 deletions src/Arch/X86/Rewriter/X86Rewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ public IEnumerator<RtlInstructionCluster> GetEnumerator()
case Mnemonic.punpckhbw: RewritePunpck(false, punpckhbw_intrinsic); break;
case Mnemonic.punpckhdq: RewritePunpck(false, punpckhdq_intrinsic); break;
case Mnemonic.vpunpckhdq: RewritePunpck(true, punpckhdq_intrinsic); break;
case Mnemonic.punpckhqdq: RewritePunpck(true, punpckhqdq_intrinsic); break;
case Mnemonic.punpckhwd: RewritePunpck(false, punpckhwd_intrinsic); break;
case Mnemonic.vpunpckhwd: RewritePunpck(true, punpckhwd_intrinsic); break;
case Mnemonic.punpcklbw: RewritePunpck(false, punpcklbw_intrinsic); break;
Expand Down Expand Up @@ -1624,6 +1625,7 @@ private static IntrinsicProcedure GenericConversionIntrinsic(string name)
private static readonly IntrinsicProcedure psubus_intrinsic = GenericBinaryIntrinsic("__psubus");
private static readonly IntrinsicProcedure punpckhbw_intrinsic = GenericBinaryIntrinsic("__punpckhbw");
private static readonly IntrinsicProcedure punpckhdq_intrinsic = GenericBinaryIntrinsic("__punpckhdq");
private static readonly IntrinsicProcedure punpckhqdq_intrinsic = GenericBinaryIntrinsic("__punpckhqdq");
private static readonly IntrinsicProcedure punpckhwd_intrinsic = GenericBinaryIntrinsic("__punpckhwd");
private static readonly IntrinsicProcedure punpcklbw_intrinsic = GenericBinaryIntrinsic("__punpcklbw");
private static readonly IntrinsicProcedure punpckldq_intrinsic = GenericBinaryIntrinsic("__punpckldq");
Expand Down
9 changes: 9 additions & 0 deletions src/UnitTests/Arch/X86/Rewriter/X86Rewriter_64bitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,15 @@ public void X86Rw_punpcklqdq()
"1|L--|xmm0 = __punpcklqdq<word128>(xmm0, xmm0)");
}

[Test]
public void X86Rw_punpckhqdq()
{
Given_HexString("660F6DC1");
AssertCode( // punpckhqdq xmm0,xmm1
"0|L--|0000000140000000(4): 1 instructions",
"1|L--|xmm0 = __punpckhqdq<word128>(xmm0, xmm1)");
}

[Test]
public void X86Rw_vpunpckhdq()
{
Expand Down
4 changes: 2 additions & 2 deletions subjects/Elf/ARM/angr-685/RTOSDemo.reko/RTOSDemo_bss.asm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions subjects/Elf/MIPS/swlswr/test.reko/test_bss.asm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions subjects/Elf/superH/netbsd-ls/ls.reko/ls_bss.asm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 7 additions & 13 deletions subjects/regression.log

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions subjects/regressions/reko-351/a.reko/a_bss.asm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 085e691

Please sign in to comment.