Parity Flag Not Set On xor %eax, %eax
Public bug reported:
Tested against qemu-1.7.0 as well as qemu-1.7.50 on Debian Sid
Steps To Reproduce
$ cat > prog.hex << EOF
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 02 00 03 00 01 00 00 00 54 80 04 08 34 00 00 00 00 00 00 00 00 00 00 00 34 00 20 00 01 00 28 00 00 00 00 00 01 00 00 00 00 00 00 00 00 80 04 08 00 80 04 08 76 00 00 00 76 00 00 00 05 00 00 00
00 10 00 00
31 c0
9c
b8 04 00 00 00
bb 01 00 00 00
89 e1
ba 04 00 00 00
cd 80
b8 01 00 00 00
bb 00 00 00 00
cd 80
EOF
$ xxd -p -r prog.hex > prog $ chmod 700 prog
$ ./prog | hexdump -vC 00000000 46 02 00 00 |F...| 00000004
$ qemu-i386 ./prog | hexdump -vC 00000000 42 02 00 00 |B...| 00000004
On the other hand if [xor %eax, %eax] (31 c0) is replaced with sub %eax,%eax (29 c0), then the parity flag is set correctly.
** Affects: qemu
Importance: Undecided
Status: New
** Tags: eflags i386 parity
Signature · 55 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1267955 Title: [i386] Parity Flag Not Set On xor %eax,%eax Status in QEMU: New Bug description: Tested against qemu-1.7.0 as well as qemu-1.7.50 on Debian Sid Steps To Reproduce $ cat > prog.hex << EOF 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 02 00 03 00 01 00 00 00 54 80 04 08 34 00 00 00 00 00 00 00 00 00 00 00 34 00 20 00 01 00 28 00 00 00 00 00 01 00 00 00 00 00 00 00 00 80 04 08 00 80 04 08 76 00 00 00 76 00 00 00 05 00 00 00 00 10 00 00 31 c0 9c b8 04 00 00 00 bb 01 00 00 00 89 e1 ba 04 00 00 00 cd 80 b8 01 00 00 00 bb 00 00 00 00 cd 80 EOF $ xxd -p -r prog.hex > prog $ chmod 700 prog $ ./prog | hexdump -vC 00000000 46 02 00 00 |F...| 00000004 $ qemu-i386 ./prog | hexdump -vC 00000000 42 02 00 00 |B...| 00000004 On the other hand if [xor %eax, %eax] (31 c0) is replaced with sub %eax,%eax (29 c0), then the parity flag is set correctly. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1267955/+subscriptions
Fix had been included here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=d2fe51bda8adf33d07c21
==> Closing
** Changed in: qemu
Status: New => Fix Released
Signature · 55 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1267955 Title: [i386] Parity Flag Not Set On xor %eax,%eax Status in QEMU: Fix Released Bug description: Tested against qemu-1.7.0 as well as qemu-1.7.50 on Debian Sid Steps To Reproduce $ cat > prog.hex << EOF 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 02 00 03 00 01 00 00 00 54 80 04 08 34 00 00 00 00 00 00 00 00 00 00 00 34 00 20 00 01 00 28 00 00 00 00 00 01 00 00 00 00 00 00 00 00 80 04 08 00 80 04 08 76 00 00 00 76 00 00 00 05 00 00 00 00 10 00 00 31 c0 9c b8 04 00 00 00 bb 01 00 00 00 89 e1 ba 04 00 00 00 cd 80 b8 01 00 00 00 bb 00 00 00 00 cd 80 EOF $ xxd -p -r prog.hex > prog $ chmod 700 prog $ ./prog | hexdump -vC 00000000 46 02 00 00 |F...| 00000004 $ qemu-i386 ./prog | hexdump -vC 00000000 42 02 00 00 |B...| 00000004 On the other hand if [xor %eax, %eax] (31 c0) is replaced with sub %eax,%eax (29 c0), then the parity flag is set correctly. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1267955/+subscriptions