| 187 | : sign_a && ((a | b) != 0x8000u); |
| 188 | } |
| 189 | constexpr bool LessEqual(Half r) const |
| 190 | { |
| 191 | uint_fast16_t a = static_cast<uint_fast16_t>(bits_), |
| 192 | b = static_cast<uint_fast16_t>(r.bits_); |
| 193 | bool sign_a = (a & 0x8000u) == 0x8000u; |
| 194 | bool sign_b = (b & 0x8000u) == 0x8000u; |
| 195 | // if both `a` and `b` have same sign |
| 196 | // Test if `a` > `b` when `a` has the sign |
| 197 | // or `a` < `b` when is not. |
| 198 | // or a == b (needed even if we used <= above instead |
| 199 | // since testing +-0 still required) |
| 200 | // else |
| 201 | // Test if `a` has the sign |
| 202 | // or `a` and `b` equal to +-0.0 |
| 203 | return (sign_a == sign_b) ? (sign_a ^ (a < b)) || (a == b) |
| 204 | : sign_a || ((a | b) == 0x8000u); |
| 205 | } |
| 206 | constexpr bool Equal(Half r) const |
| 207 | { |
| 208 | // fast16 cast is not worth it, since unpack op should involved. |