unicorn-engine / unicorn

Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86)
http://www.unicorn-engine.org
GNU General Public License v2.0
7.34k stars 1.31k forks source link

Backport qemu/qemu@75b208c #1853

Closed basavesh closed 11 months ago

basavesh commented 11 months ago

target/i386: fix operand order for PDEP and PEXT

For PDEP and PEXT, the mask is provided in the memory (mod+r/m) operand, and therefore is loaded in s->T0 by gen_ldst_modrm. The source is provided in the second source operand (VEX.vvvv) and therefore is loaded in s->T1. Fix the order in which they are passed to the helpers.

wtdcode commented 11 months ago

AFAIK, this is https://github.com/qemu/qemu/commit/75b208c28316095c4685e8596ceb9e3f656592e2

I will backport this accordingly.

basavesh commented 11 months ago

Sounds good to me.

basavesh commented 11 months ago

@wtdcode Shall I close this PR as you will be back porting directly? or do you want me to update this PR to match the changes from qemu/qemu@75b208c

wtdcode commented 11 months ago

You could definitely do this (highly welcome!). But please note when you do backport please preserve all origin messages. I did one recently you may refer to: https://github.com/unicorn-engine/unicorn/commit/a7a5d187e77f7853755eff4768658daf8095c3b7

basavesh commented 11 months ago

I couldn't get the title correct with the hyperlink. I have made the necessary changes with respect to code and the text.

wtdcode commented 11 months ago

It looks okay but you target the wrong branch. PR always goes to dev.

basavesh commented 11 months ago

Closing this as I created an another PR #1861 for dev branch