On 5/9/24 17:25, Paolo Bonzini wrote:
According to the manual, 32-bit vs 64-bit is governed by REX.W
and REX ignores the 0x66 prefix.  This can be confirmed with this
program:

     #include <stdio.h>
     int main()
     {
        int x = 0x12340000;
        int y;
        asm("popcntl %1, %0" : "=r" (y) : "r" (x)); printf("%x\n", y);
        asm("mov $-1, %0; .byte 0x66; popcntl %1, %0" : "+r" (y) : "r" (x)); 
printf("%x\n", y);
        asm("mov $-1, %0; .byte 0x66; popcntq %q1, %q0" : "+r" (y) : "r" (x)); 
printf("%x\n", y);
     }

which prints 5/ffff0000/5 on real hardware and 5/ffff0000/ffff0000
on QEMU.

Cc:qemu-sta...@nongnu.org
Signed-off-by: Paolo Bonzini<pbonz...@redhat.com>
---
  target/i386/tcg/translate.c | 17 +----------------
  1 file changed, 1 insertion(+), 16 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to