SUBREGs and modes

Geoff Keating
Thu Aug 3 13:31:00 GMT 2000

Jan Hubicka <> writes:

> > 
> > Actually, we don't.  It used to be that when cross-compiling you could
> > get constructs like:
> > 
> > (subreg:SF (const_int 0x40800000) 0)
> Isn't SFmode subreg prohibited completely?

Certainly not!  It's easy to get constructs like (subreg:SF (reg:SI 3) 0).

> What is the main purpose to make such constructs with cross-compiling?

It's, loosely, what you get when you use a union:

union { float f; unsigned u; } u;

u.u = 0x40800000;
return u.f + 1.0;

when you're cross-compiling and you have no FP emulator.  You get
constructs like

(set (reg:SF f1) (subreg:SF (const_int 0x40800000) 0))
(set (reg:SF f0) (const_double:SF ...))
(set (reg:SF f3) (plus:SF (reg:SF f1) (r:SF f0)))

- Geoffrey Keating <>

More information about the Gcc-patches mailing list