qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] target/i386: Fix ANDN (bmi)


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] target/i386: Fix ANDN (bmi)
Date: Thu, 13 Jul 2017 14:22:25 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/13/2017 11:51 AM, Ricardo Ribalda Delgado wrote:
Operands on ANDN are swapped.

Tested with the following function:

long test_andn(long v1, long v2){
        return (~v1 & v2);
}

Compiled with:

gcc kk.c -mbmi -O3 -Wall

0000000000000910 <test_andn>:
  910:c4 e2 c0 f2 c6            andn   %rsi,%rdi,%rax
  915:c3                        retq
  916:66 2e 0f 1f 84 00 00      nopw   %cs:0x0(%rax,%rax,1)
  91d:00 00 00

and

gcc kk.c -march=native -O3 -Wall

0000000000000930 <test_andn>:
  930:   48 f7 d7                not    %rdi
  933:   48 89 f8                mov    %rdi,%rax
  936:   48 21 f0                and    %rsi,%rax
  939:   c3                      retq
  93a:   66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)

The test showed than -mbmi version behaved differently than the
-march native version.

Signed-off-by: Ricardo Ribalda Delgado <address@hidden>

Thanks, applied to my i386 tcg queue.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]