So the primary purpose of this patch is to make it easier to write tests for
removal of useless test/compare insns on the H8.
In simplest terms the costing model in the H8 port tends to encourage changing
something like:
x = y + 4;
if (x == 0)
into:
x = y + 4;
if (y == -4)
This is a marginal de-optimization on the H8. So fixing it makes the code
ever-so-slightly better in isolation. Fixing this also improves redundant
test/compare elimination and makes writing tests for redundant test/compare
elimination far easier.
gcc/
* config/h8300/h8300.c (h8300_rtx_costs): Handle the various
comparison rtx codes too.
return true;
case COMPARE:
+ case NE:
+ case EQ:
+ case GE:
+ case GT:
+ case LE:
+ case LT:
+ case GEU:
+ case GTU:
+ case LEU:
+ case LTU:
if (XEXP (x, 1) == const0_rtx)
*total = 0;
return false;