ARM thumb2 does not propogate carry flag properly

Bug #874038 reported by Alexey Starikovskiy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Invalid
Undecided
Unassigned

Bug Description

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

Tags: arm flags
Revision history for this message
Alexey Starikovskiy (aystarik) wrote :
Revision history for this message
Peter Maydell (pmaydell) wrote :

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?

Revision history for this message
Alexey Starikovskiy (aystarik) wrote :

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

Revision history for this message
Peter Maydell (pmaydell) wrote :

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?

Revision history for this message
Alexey Starikovskiy (aystarik) wrote : Re: [Bug 874038] Re: ARM thumb2 does not propogate carry flag properly

0.15.0 fails for me.

On Mon, Oct 17, 2011 at 10:06 PM, Peter Maydell
<email address hidden> wrote:
> 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
>

Revision history for this message
Peter Maydell (pmaydell) wrote :

> 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

Revision history for this message
Alexey Starikovskiy (aystarik) wrote :

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

Changed in qemu:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.