Expand SelectCmp to handle floating point compare
Details
Diff Detail
Event Timeline
I'm holding back on the conditional LGTM for now since I would like to see how you solve the 64-bit FPU cases both here and in D5562 first.
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
625 | C_EQ_D32 needs to be C_EQ_D64 for 64-bit FPU's and we don't guard against this. Similarly for the other compares. | |
640–647 | These two aren't correct when one of the operands is NaN. 'NaN ogt 0.0' is false because they are unordered, but '!(NaN ole 0.0)' is true. Swap the LHS/RHS instead. | |
test/CodeGen/Mips/Fast-ISel/fpcmpa.ll | ||
21 | We ought to check that the registers are in the right order. Likewise for the tests below. |
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
640–647 | After chatting with Reed, I've taken a look at the SelectionDAG implementation and found that it is using c.ule.[ds] and c.ule.[ds] for FCMP_OGT and FCMP_OGE respectively and then inverting the boolean result before the value is consumed. This is valid too and we should probably go with that for the sake of consistency. |
C_EQ_D32 needs to be C_EQ_D64 for 64-bit FPU's and we don't guard against this.
Similarly for the other compares.