OpenCores

* Amber ARM-compatible core

Issue List
V Flag set by TST and TEQ. #16
Closed sleary opened this issue over 9 years ago
sleary commented over 9 years ago

The V flag gets set by TST and TEQ. The manual says only the N,C and Z flags are affected. Sample code below..

;; set the flags 
TEQP	PC,#&90000000
;; do the test
MOV	R1,#0
TST	R1,#0

;; Flags should be 5 here (Z and V)
;; on Amber the flags are 4 (Just Z)
MOVVC	R0,#0
MOVVS	R0,#1

And the same test also works for TEQ

;; set the flags 
TEQP	PC,#&90000000
;; do the test
MOV	R1,#0
TEQ	R1,#0

;; Flags should be 5 here (Z and V)
;; on Amber the flags are 4 (Just Z)
MOVVC	R0,#0
MOVVS	R0,#1

In both cases the V flag is reset to zero instead of being preserved.

sleary commented over 9 years ago

I resolved this in my local copy by making the decode unit emit a o_status_bits_flags_mask, this mask is usually 4'hF but for instructions that want to not set certain flags it sets those bits low. This lets me do this for other instructions later if find any with odd edge case requirements. Patch is available from my me via my opencores email on request.

csantifort closed this over 9 years ago

Assignee
No one
Labels
Bug