This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Expanding a load instruction
- From: fearyourself <fearyourself at gmail dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 5 Jun 2009 11:32:35 -0400
- Subject: Expanding a load instruction
Dear all,
In the instruction set of my architecture, the offsets of a half-load
(HImode) have to be multiples of 2. However, if I set up a structure
in a certain way, the compiler will generate:
(mem/s/j:HI (plus:DI (reg:DI 134 [ ivtmp.23 ])
(const_int 1 [0x1])) [0 <variable>.geno+0 S2 A16])
As the memory operand for the load.
Now, one solution I am going to try to fix this is to use
define_expand and add a move into another register before this load
and then load from that register (thus removing the offset of 1).
My question is: Is that how it should be done or is there another solution?
Thanks again for your help,
Jc