This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How to force instruction in slot1 while emit NOP in slot0 if necessary?
- From: "Bingfeng Mei" <bmei at broadcom dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 24 Sep 2007 04:36:28 -0700
- Subject: How to force instruction in slot1 while emit NOP in slot0 if necessary?
We are portinng GCC 4.2.1 to a 2-issue VLIW processor. There are some
special instructions which can only be issued on the second slot (slot
1). I tried to specify using following DFA constructs.
;; Define this instruction can only be issued on slot 1
(define_insn_reservation "psr_y" 1
(eq_attr "type" "psr")
"slot1" )
;; Define slot1 can only be issued after slot0 is filled
(presence_set "slot1" "slot0")
I hope the compiler can automatically insert NOP on slot0 if it is
unused so that the second constraint can be fulfilled. However, the
compiler falls into a deadlock. Without the second constraint , the
compiler can emit code but I cannot tell from RTL on which slot the
instruction is issued. What is best way to figure out unused slot and
insert NOP insn? Or is there more clever way to specify DFA that allows
compiler automatically emit NOPs? Any suggestion is greatly
appreciated.