Skip to contentSkip to conversation

ARM thumb2 does not propogate carry flag properly

Qemu-devel Alexey Starikovskiy 2 participants 8 messages Oct 14, 2011 – Oct 18, 2011

lore
Share & tools
lore
#0 lore raw

Public bug reported:

information on carry flag is lost if gen_set_CF_bit31(t1) is called after logic operation.

** Affects: qemu
Importance: Undecided
Status: New

** Tags: arm flags

Signature · 16 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/874038

Title:
  ARM thumb2 does not propogate carry flag properly

Status in QEMU:
  New

Bug description:
  information on carry flag is lost if gen_set_CF_bit31(t1) is called
  after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions
#1 lore raw

** Patch added: "fix for the problem"
https://bugs.launchpad.net/bugs/874038/+attachment/2542719/+files/fix_carry_in_thumb2

Signature · 16 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/874038

Title:
  ARM thumb2 does not propogate carry flag properly

Status in QEMU:
  New

Bug description:
  information on carry flag is lost if gen_set_CF_bit31(t1) is called
  after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions
#2 lore raw
In reply to Alexey Starikovskiy

The existing code looks OK to me -- there's no need to call gen_set_CF_bit31() early because the inputs t0 and t1 to gen_thumb2_data_op() should always be distinct TCG values, and so gen_thumb2_data_op() will never trash t1. (There was a bug in this area involving ORN, but that was fixed in rev 29501f1, and I can see from your patch that you have that fix.)

Can you clarify which exact instruction, input data and output data case this patch is intended to fix, please?

Signature · 16 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/874038

Title:
  ARM thumb2 does not propogate carry flag properly

Status in QEMU:
  New

Bug description:
  information on carry flag is lost if gen_set_CF_bit31(t1) is called
  after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions
#3 lore raw
In reply to Alexey Starikovskiy

MVNS with immediate fails in attached test program at 0x82c0 location. My patch fixes that.

** Attachment added: "failed test for MVNS.IMM opcode"
https://bugs.launchpad.net/qemu/+bug/874038/+attachment/2554573/+files/mvns_imm.exe

Signature · 16 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/874038

Title:
  ARM thumb2 does not propogate carry flag properly

Status in QEMU:
  New

Bug description:
  information on carry flag is lost if gen_set_CF_bit31(t1) is called
  after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions
#4 lore raw
In reply to Alexey Starikovskiy

Current git master works for me on that test program without your patch:
cam-vm-266:maverick:qemu$ ./arm-linux-user/qemu-arm ~/Desktop/mvns_imm.exe cam-vm-266:maverick:qemu$ echo $?
0

(I tested on qemu-0.14 just to confirm that I'm running the test program correctly, and that indeed fails as I would expect it to, exiting with status 255.)

Which qemu version have you been testing with?

Signature · 16 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/874038

Title:
  ARM thumb2 does not propogate carry flag properly

Status in QEMU:
  New

Bug description:
  information on carry flag is lost if gen_set_CF_bit31(t1) is called
  after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions
#5 lore raw

0.15.0 fails for me.

Quoted 29 lines · Peter Maydell

Current git master works for me on that test program without your patch:
cam-vm-266:maverick:qemu$ ./arm-linux-user/qemu-arm ~/Desktop/mvns_imm.exe cam-vm-266:maverick:qemu$ echo $?
0

(I tested on qemu-0.14 just to confirm that I'm running the test program correctly, and that indeed fails as I would expect it to, exiting with status 255.)

Which qemu version have you been testing with?

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/874038

Title:
 ARM thumb2 does not propogate carry flag properly

Status in QEMU:
 New

Bug description:
 information on carry flag is lost if gen_set_CF_bit31(t1) is called after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions

Signature · 16 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/874038

Title:
  ARM thumb2 does not propogate carry flag properly

Status in QEMU:
  New

Bug description:
  information on carry flag is lost if gen_set_CF_bit31(t1) is called
  after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions
#6 lore raw
In reply to Alexey Starikovskiy
Quoted 1 line

0.15.0 fails for me.

Hmm. Works for me:

pm215@canth:/tmp$ wget http://wiki.qemu.org/download/qemu-0.15.0.tar.gz
[...]
pm215@canth:/tmp$ tar xzf qemu-0.15.0.tar.gz 
pm215@canth:/tmp$ cd qemu-0.15.0/
pm215@canth:/tmp/qemu-0.15.0$ ./configure --target-list=arm-linux-user && make -j4
[...]
pm215@canth:/tmp/qemu-0.15.0$ ./arm-linux-user/qemu-arm ~/Desktop/mvns_imm.exe 
pm215@canth:/tmp/qemu-0.15.0$ echo $?
0
Signature · 16 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/874038

Title:
  ARM thumb2 does not propogate carry flag properly

Status in QEMU:
  New

Bug description:
  information on carry flag is lost if gen_set_CF_bit31(t1) is called
  after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions
#7 lore raw
In reply to Alexey Starikovskiy

Sorry for the noise, it appears I've checked on not clean 0.15.0

** Changed in: qemu
Status: New => Invalid

Signature · 16 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/874038

Title:
  ARM thumb2 does not propogate carry flag properly

Status in QEMU:
  Invalid

Bug description:
  information on carry flag is lost if gen_set_CF_bit31(t1) is called
  after logic operation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/874038/+subscriptions