This achieves the conversion by using combined cbranch/cstore patterns, and using a mechanism similar to the cc_status tracking to elide certain comparisons. Unlike cc_status, this is opt-in and requires a flags_valid attribute to be set for suitable instructions. Due to lack of test hardware, this conversion is omitted for a number of coldfire patterns as opposed to normal m68k.
For DImode comparisons, scc_di and beq0_di/bne0_di patterns already existed and are reused. The bgt0_di/ble0_di patterns are replaced with expander code to test just the high word, along with some smarts in m68k_find_flags_value. Bernd