Hi! On Thu, Jun 02, 2022 at 01:30:04PM +0800, HAO CHEN GUI wrote: > Segher, > Does BCD comparison return false when either operand is invalid coding?
It sets all of LT, GT, and EQ to 0 (it normally sets exactly one of them to 1). It sets bit 3 (the "SO" bit usually) to 1. That is what the machine insns do. What the builtins do is undefined as far as I know? If So we can do whatever is most convenient, so, not handle it specifically at all, just go with what falls out. > If yes, the result could be 3-way. We can check gt and eq bits for ge. You can check the LT bit, instead: it is only one branch insn, and also only one setbc[r] insn (it can be slightly more expensive if you can use only older insns). > We still can't use crnot to only check lt bit as there could be invalid > coding. > Also, do you think finite-math-only excludes invalid coding? Seems GCC > doesn't clear define it. This is not floating-point code at all, it should not be influenced at all by finite-math-only! Segher