MAX and MIN inconsistent with P1
Seairth
Posts: 2,474
in Propeller 2
P2's implementation appears to differ from P1, as the flags differ.
P1 MAX/MIN:
* Z : S=0
P2 MAX/MIN:
* Z : result=0
This change makes sense to me. Is this an intended change?
P1 MAX:
* C : D<S
P2 MAX:
* C : S<D
C for MIN is the same on P1 and P2. I suspect C for MAX on P2 is a bug.
I have not yet examined MAXS/MINS.
(rant: MAX is a bad name for this instruction. In most languages, it returns the maximum value, not the minimum value. Same goes for MIN. Maybe consider swapping MAX and MIN, then adding LMIN and LMAX as aliases for people who think in SPIN terms.)
P1 MAX/MIN:
* Z : S=0
P2 MAX/MIN:
* Z : result=0
This change makes sense to me. Is this an intended change?
P1 MAX:
* C : D<S
P2 MAX:
* C : S<D
C for MIN is the same on P1 and P2. I suspect C for MAX on P2 is a bug.
I have not yet examined MAXS/MINS.
(rant: MAX is a bad name for this instruction. In most languages, it returns the maximum value, not the minimum value. Same goes for MIN. Maybe consider swapping MAX and MIN, then adding LMIN and LMAX as aliases for people who think in SPIN terms.)
Comments
This is another non-intuitive thing from P1...
-Phil
https://docs.google.com/document/d/1O27nO2tMjBTvUNblFFRtEp5DHvcvsSGXcPvH9FaJ9u8/edit#bookmark=id.n1suwwbjxuk4
Note: I did not list the "D<S" vs. "S<D" as a difference MAX/MAXS, since I suspect this is a bug.