OpenCores

* Amber ARM-compatible core

Issue List
Broken Carry for MOV R0,R0,RRX #26
Closed sleary opened this issue over 9 years ago
sleary commented over 9 years ago

Really sorry... feel like the bad guy here but:-

MOV R0,R0,RRX ignores the carry flag contents.

Code to demo...

    ;; setup the carry for the test
;; could do this in program.cpp but
;; doing this makes the test repeatable
;; on a real Archie from BASIC V.
MOV	R0,#0
SUB	R1,R0,#1
ADDS	R1,R1,#1
;;Do the test
MOV	R0,#0
MOV     R0,R0,RRX

EXIT

Expected R0 = 0x80000000 Amber Actual R0 = 0

$ ./program/Va23_core bugs/rrxbug.bin Executing % on Amber/ArcEM Comparison 40 40 Failed. errors: expected,actual,bitwise difference r0(0x80000000,0x00000000,0x80000000) r15(0x60001027,0x60001023,0x00000004)

initial: r0=0x7e1d4e3c,r1=0x06f1d01b,r2=0x1d5d2ed9,r3=0x6f6f8292,r4=0x7c6b63c9,r5=0x2f69a363,r6=0x19430192,r7=0x0de580bf,r8=0x4c467585,r9=0x41ce04b8,r10=0x44a2b75b,r11=0x0b00c412,r12=0x3119e1f5,r13=0x6b052991,r14=0x66b52125,r15=0x00000003,r8_firq=0x304dc14d,r9_firq=0x611dec5a,r10_firq=0x1b088c0e,r11_firq=0x147c49d9,r12_firq=0x4ab42a1b,r13_firq=0x0e0912fe,r14_firq=0x464da53c,r13_irq=0x529e0ec9,r14_irq=0x4580ab03,r13_svc=0x5c49d017,r14_svc=0x322acccd,

arcem: r0=0x80000000,r1=0x00000000,r2=0x1d5d2ed9,r3=0x6f6f8292,r4=0x7c6b63c9,r5=0x2f69a363,r6=0x19430192,r7=0x0de580bf,r8=0x4c467585,r9=0x41ce04b8,r10=0x44a2b75b,r11=0x0b00c412,r12=0x3119e1f5,r13=0x6b052991,r14=0x66b52125,r15=0x60001027,r8_firq=0x304dc14d,r9_firq=0x611dec5a,r10_firq=0x1b088c0e,r11_firq=0x147c49d9,r12_firq=0x4ab42a1b,r13_firq=0x0e0912fe,r14_firq=0x464da53c,r13_irq=0x529e0ec9,r14_irq=0x4580ab03,r13_svc=0x5c49d017,r14_svc=0x322acccd,

amber: r0=0x00000000,r1=0x00000000,r2=0x1d5d2ed9,r3=0x6f6f8292,r4=0x7c6b63c9,r5=0x2f69a363,r6=0x19430192,r7=0x0de580bf,r8=0x4c467585,r9=0x41ce04b8,r10=0x44a2b75b,r11=0x0b00c412,r12=0x3119e1f5,r13=0x6b052991,r14=0x66b52125,r15=0x60001023,r8_firq=0x304dc14d,r9_firq=0x611dec5a,r10_firq=0x1b088c0e,r11_firq=0x147c49d9,r12_firq=0x4ab42a1b,r13_firq=0x0e0912fe,r14_firq=0x464da53c,r13_irq=0x529e0ec9,r14_irq=0x4580ab03,r13_svc=0x5c49d017,r14_svc=0x322acccd,

Verified on ArcEM/Real Archie.

https://www.dropbox.com/s/dolx0o3pyfj1ces/A540RRXBug.JPG?dl=0

csantifort commented over 9 years ago

Code changes from Stephen added to release 87 for a23, and release 88 for a25. This fixes the issue.

csantifort closed this over 9 years ago

Assignee
No one
Labels
Bug