public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Allocating scratch register
@ 2008-01-09 18:26 Boris Boesler
  2008-01-09 22:55 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Boesler @ 2008-01-09 18:26 UTC (permalink / raw)
  To: GCC

Hi!

  I'm trying to allocate a scratch register: write immediate constant  
into scratch register r, write register r into memory

;; write imm into memory
(define_insn_and_split "mov<mode>_imm_by_store"
   [(set (match_operand:I8I16 0 "memory_operand"    "=m")
	(match_operand:I8I16 1 "immediate_operand" " i"))
   (clobber (match_scratch:I8I16 2 "=r"))]
   ""
   "#"
   ""
   [(parallel
     [(set (match_dup 2) (match_dup 1))
      (set (match_dup 0) (match_dup 2))])]
   ""
)

  I found that in a mips back-end. But this pattern is not recognized  
during code-generation [char c1; c1 = 1;]:
simple-memory.c:19: error: unrecognizable insn:
(insn 12 11 14 3 (set (mem/c/i:QI (reg/f:SI 105) [0 c1+0 S8])
         (const_int 1 [0x1])) -1 (nil)
     (nil))

  If I remove the clobber command and replace (match_dup 2) by  
(reg:I8I16 A15_REGNUM) code will be generated (but not as wanted).

  What is wrong with the code above?

Thanks,
Boris

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

end of thread, other threads:[~2008-01-10 16:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-09 18:26 Allocating scratch register Boris Boesler
2008-01-09 22:55 ` Ian Lance Taylor
2008-01-10 16:22   ` Boris Boesler
2008-01-10 16:47     ` 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).