patch to fix SH4 mode-switching problems

Geoff Keating geoffk@cygnus.com
Mon Feb 7 11:43:00 GMT 2000


Joern Rennecke <amylaar@cygnus.co.uk> writes:

> Like this?
> 
> ..
> @item OPTIMIZE_MODE_SWITCHING (@var{entity})
> Define this macro if the port needs extra instructions inserted for mode
> switching in an optimizing compilation.
> For an example, look at the SH port.
> You can have multiple entities that are mode-switched, and select at run time
> ..

I think more like

`CANONICALIZE_COMPARISON (CODE, OP0, OP1)'
     One some machines not all possible comparisons are defined, but
     you can convert an invalid comparison into a valid one.  For
     example, the Alpha does not have a `GT' comparison, but you can
     use an `LT' comparison instead and swap the order of the operands.

     On such machines, define this macro to be a C statement to do any
     required conversions.  CODE is the initial comparison code and OP0
     and OP1 are the left and right operands of the comparison,
     respectively.  You should modify CODE, OP0, and OP1 as required.

     GNU CC will not assume that the comparison resulting from this
     macro is valid but will see if the resulting insn matches a
     pattern in the `md' file.

     You need not define this macro if it would never change the
     comparison code or operands.

You shouldn't assume that everyone porting GCC already understands how
each of the existing ports work.  In fact, I think you can safely
assume that no one person understands how all the existing ports work,
and there aren't many people who even understand half of them.

-- 
- Geoffrey Keating <geoffk@cygnus.com>


More information about the Gcc-patches mailing list