I have recently been adding conditional move instructions to a GCC port
for a 16-bit DSP (i.e., movhicc, etc.). The DSP only supports
move-on-equals and move-on-not-equals, not the whole variety of LE, GT,
LEU, and so on. The movhicc pattern itself is written to fail if an
attempt is made to generate a conditional move using an unsupported
comparison, but the if-conversion code (ifcvt.c) doesn't seem to check
that a valid comparison is used. For example, if a simple code block is
found with a GT comparison controlling entry, the if-conversion code
attempts to generate a conditional move for a GT comparison, which isn't
supported. However, rather than giving up, and not performing the
conversion, the if-conversion code aborts instead.
What is the easiest way to go about solving this problem?
1) change the abort to allow graceful failure, with
fallback to using branches
2) prevent the if-conversion from even being attempted when an
unsupported comparison is used?