To NEG or not to NEG, that is the question
ozpropdev
Posts: 2,792
In the P1 and the propsed P2 instruction set we have 5 variants of the NEG instruction.
Do we really need the last 4 variants as they can be replicated with conditional versions
of the standard NEG instruction. Can't they?
Brian
P2 aka P16X64A instructins -------------------------- ZCWS 0110011 ZCI CCCC DDDDDDDDD SSSSSSSSS NEG D,S/# inc ZCWS 0110100 ZCI CCCC DDDDDDDDD SSSSSSSSS NEGC D,S/# inc ZCWS 0110101 ZCI CCCC DDDDDDDDD SSSSSSSSS NEGNC D,S/# inc ZCWS 0110110 ZCI CCCC DDDDDDDDD SSSSSSSSS NEGZ D,S/# inc ZCWS 0110111 ZCI CCCC DDDDDDDDD SSSSSSSSS NEGNZ D,S/# inc
Do we really need the last 4 variants as they can be replicated with conditional versions
of the standard NEG instruction. Can't they?
if_c neg d,s# 'replaces negc if_nc neg d,s# 'replaces negnc if_z neg d,s# 'replaces negz if_nz neg d,s# 'replaces negnzAm I missing something here?
Brian
Comments
As soon as I read "move" in your explanation, the penny dropped.
In my use/test cases I am using the same source and destination address.
I read the docs multiple times and still managed to miss the fundamental stuff. Yikes!
Thanks for putting me on the straight and narrow.
The forum saves the day again.
Cheers
Brian