public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* subreg question
@ 2001-12-12 18:13 Dale Johannesen
  2001-12-13  1:39 ` Jan Hubicka
  2001-12-13 10:33 ` Aldy Hernandez
  0 siblings, 2 replies; 15+ messages in thread
From: Dale Johannesen @ 2001-12-12 18:13 UTC (permalink / raw)
  To: gcc

What cases of subreg are supposed to be handled exactly?

double x(float y) {
     double z;
     *((float *)&z) = y;
     return z;  }

On ppc, the rtl for the store after purge_addressof looks like:

(insn 36 12 17 (set (subreg:SF (reg/v:DF 118) 0)
         (reg:SF 121)) -1 (nil)
     (nil))

This seems to work (118 eventually gets resolved to memory) despite
an explicit statement in rtl.texi that it is invalid.  Is it really?

The original case involved Altivec vectors, which as you recall are
16 bytes:

     vector signed char v;
     int i;
     *((int *)&v) = i;

This similarly produces

(insn 217 40 43 (set (subreg:SI (reg/v:V16QI 126) 0)
         (reg/v:SI 115)) 310 {*movsi_internal1} (insn_list 4 (nil))

which is currently not handled.  There is no way to generate code for
this except by putting 126 in memory.  The subreg use here does not
seem to correspond to any of the uses described in rtl.texi, so it
seems to me it should not be generated by purge_addressof.  Is this
a reasonable approach?




^ permalink raw reply	[flat|nested] 15+ messages in thread
* subreg question
@ 2008-03-25 14:56 Jan Hoogerbrugge
  2008-03-25 15:58 ` Paul Brook
  0 siblings, 1 reply; 15+ messages in thread
From: Jan Hoogerbrugge @ 2008-03-25 14:56 UTC (permalink / raw)
  To: gcc

Hi,

My target architecture has 32 bit registers and uses register pairs
for 64 bit values. What makes it special is that whenever a register
pair is written by a 64 bit operation, the individual registers should
not be read by 32 bit operations. The reverse is also true: whenever a
register pair is used as 64 bit operand, the value should not be
produced by 32 bit operations.

In order to connect 64 to 32 operations, the target architecture
provides high and low, which select a register from a register pair,
and combine, which combines two registers into a register pair.

How to tell gcc to insert high, low, and combine operations, when 32
and 64 bit operations are exchanging values?

Regards,
Jan

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-03-25 14:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-12 18:13 subreg question Dale Johannesen
2001-12-13  1:39 ` Jan Hubicka
2001-12-13 10:33 ` Aldy Hernandez
2001-12-13 12:26   ` Dale Johannesen
2001-12-13 12:39     ` Daniel Jacobowitz
2001-12-13 12:45       ` Dale Johannesen
2001-12-13 12:51         ` Daniel Jacobowitz
2001-12-13 13:04           ` Aldy Hernandez
2001-12-13 14:57             ` Joe Buck
2001-12-13 13:04           ` Dale Johannesen
2001-12-13 13:33             ` Daniel Jacobowitz
2001-12-13 13:34             ` Aldy Hernandez
2001-12-13 14:56               ` Richard Henderson
2008-03-25 14:56 Jan Hoogerbrugge
2008-03-25 15:58 ` Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).