This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Your change to function.c



  In message <199810060512.WAA09623@dm.cobaltmicro.com>you write:
  >    Date: Mon, 05 Oct 1998 08:54:15 -0600
  >    From: Jeffrey A Law <law@cygnus.com>
  > 
  >      >    (set (reg:QI) (addressof:SI (reg:SF xxx)))
  > 
  >    But why would we ever want to get something like the above -- addressof 
  > is
  >    an address right?  Why would we ever look at it in a mode like QImode?
  > 
  >    What am I missing?
  > 
  > Look at the RTL you get while compiling libchill, specifically
  > format.c:inpconv().  The address of a float is taken, and cast to a
  > char pointer, and 4 bytes are picked out of it by the MOV4() macro.
  > The relevant stuff is:
  > 
  > #define MOV4(tgt,src) \
  >   *((char*)(tgt)  ) = *((char*)(src)  ), \
  >   *((char*)(tgt)+1) = *((char*)(src)+1), \
  >   *((char*)(tgt)+2) = *((char*)(src)+2), \
  >   *((char*)(tgt)+3) = *((char*)(src)+3)
  > 
  > float fval;
  > MOV4(io.__t.__locreal,&fval);
  > 
  > Look at what purge_addressof_1 looks at when this is compiled.  It
  > look at something resembling:
  > 
  > (insn 18 15 19 (set (reg:QI 110)
  >         (mem:QI (addressof:SI (reg:SF 108) 107) 0)) -1 (nil)
  >     (nil))
  > 
  > And this is the source of the problem cases on big endian.
You were missing a MEM in your previous message.  It makes a lot more sense
now :-)

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]