|
|
|
|
|
by amavect
59 days ago
|
|
I'll use custom notation =? ≤≥? <? ≤? for comparison to distinguish from = < ≤. x =? x = True
Otherwise, a =? b = False
NaN ≤≥? NaN = False
Otherwise, a ≤≥? b = a =? b
-1.0 <? 0.0 = True
-1.0 <? +1.0 = True
0.0 <? +1.0 = True
Otherwise, a <? b = False
a >? b = b <? a
a ≤? b = (a <? b | a ≤≥? b)
a ≥? b = (a >? b | a ≤≥? b)
In logic gates: For =?, bitwise equality. For ≤≥?, bitwise equality and a NaN detector. For <?, use: ab <? cd = a&b&~c | ~a&~b&~c&d
I separate =? from ≤≥?. =? compares value, while ≤≥? compares order. NaN has no ordering, so it compares false. IEEE float only uses ≤≥? and names it ==. |
|
But the main question is: does this FP2 have any real applications? Maybe it could be useful when only one operand is FP2? Especially for vectorized math.