[M68K][Fixed-Point] gcc expand & insn for the comparisons

Georg-Johann Lay avr@gjlay.de
Thu Oct 16 17:01:43 GMT 2025


Am 11.10.25 um 05:09 schrieb Jean-Paul Mari via Gcc-help:
> Hi,
> 
> I have followed the Stefan's code sample; modified the m68k.md using the mode iterators to add the fixed-point for the additions, subtractions and negations but I'm stuck on the comparisons. I think I need to handle the cc register, but I do not understand yet how to use it.
> 
> Thanks in advance for your help and guidance.

I don't know nothing about m68k, but wouldn't fixed-point comparison
take the same route like comparing (un)signed integers of the same
size?  Moving the decimal point is just a multiplication by a
positive constant, and that doesn't change any of the <, <= etc.
relations.  So a good point to start is the cbranch<mode>4 patterns
for the modes.

What I also don't know is how gcc behaves when no fixed-point
compare patterns are provided; the reasonable default behavior would
be to just emit respective integer comparisons.  Though some of the
fixed-point parts in the middle-end received less attention than
more common types did.

Regards, Johann



More information about the Gcc-help mailing list