]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
sim: pru: Fix emulation of carry bit
authorDimitar Dimitrov <dimitar@dinux.eu>
Fri, 8 Dec 2023 18:39:10 +0000 (20:39 +0200)
committerDimitar Dimitrov <dimitar@dinux.eu>
Thu, 28 Dec 2023 07:09:13 +0000 (09:09 +0200)
commitfcd5cdd5aeecf7eae91a402755c260bb64a0fe0f
treee5a61334c906df9657c03e6b391a599af65001f0
parent73d931e560059a87d76f528fafbb4270a98746bc
sim: pru: Fix emulation of carry bit

The PRU architecture documentation [1] was used for the initial GNU
simulator implementation.  But recently [2] TI confirmed the carry
behaviour was wrongly documented.  In reality, the PRU carry behaves
like the carry in ARM processors.

This patch fixes simulator to align with latest recommendations from TI.

The new carry.s test was also validated to pass on real hardware -
a BeaglePlay board [3].  That test is a bit long because TI still
has not released official updates for the PRU documents.  And I wanted
to ensure simulator handles all edge cases exactly as the real hardware
does.

[1] https://www.ti.com/lit/pdf/spruij2
[2] https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1244359/sk-am64b-am64x-pru-assembler-how-works-this-bloody-carry
[3] https://www.beagleboard.org/boards/beagleplay

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
sim/pru/pru.isa
sim/testsuite/pru/carry.s [new file with mode: 0644]