@dzaima

3 Followers
9 Following
26 Posts
Fun float hack on x86: the float comparison "a!=a || a>=b" (i.e. a>=b but treating NaNs as larger than all other floats) can be done in two instructions - cmpunord(a>=b, a) - reinterpreting the result vector of the first comparison as a zero-or-NaN float input to the second one.
Doesn't apply to AVX-512 though, which returns a mask register instead of an all-0s-or-1s-elements vector from comparisons.