On Thu, Sep 09, 2021 at 08:16:16AM +0200, Richard Biener wrote:
> But subreg _is_ bit_cast.  What is odd to me is that a "disallowed" subreg
> like (subreg:SF (reg:TI ..) 0) magically becomes valid (in terms of
> validate_subreg) if you rewrite it as (subreg:SF (subreg:SI (reg:TI ..) 0) 0).
> Of course that's nested and invalid but just push the inner subreg to a
> new pseudo and the thing becomes valid.

Basically I only checked the mode of the SUBREG and the value in SUBREG_REG.  I
agree (subreg:SF (subreg:SI (reg:TI))) should not be allowed.

When I wrote the changes we didn't see SUBREG's as much to access the bottom or
top element of a structure that was held in a larger int field.  If the patch
is not reverted, then we have to deal with this somehow.  Such as with my patch
that allows (subreg:SF (reg:TI xxx)) and (subreg:SF (reg:DI xxx)).

The target hook idea might be too big of a hammer.  I would need to play with
it to see if there are other losses.

On the PowerPC, the problematical subregs only occur when you are moving a
register from GPR to a vector/float register or vice versa.  If you move a
subreg between two GPR registers or two vector/float registers, then you can
just do the copy.

Part of the issue is for some moves, you need to use a temporary register to
convert the results, but of course we have the long standing 'all moves for a
mode must be done in a single insn that covers all of the cases'.  Then you get
into secondary reload territory.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797

Reply via email to