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]
Other format: [Raw text]

C6X: Fix floating point scheduling scheduling bug


We have code in the backend to predicate instructions with long delays
while scheduling, so that they can be placed in jump delay slots.  For
example,

[a1] b label
     nop 3
     ldw *a2, a0  ;; this insn is from the basic block after the branch
     nop
;; branch occurs here

is not safe even if A0 is not used at the branch target, since the load
will place data into A0 after the branch occurs, and we don't know
whether that conflicts with the code there.

We can make this safe by changing it into

[a1]  b label
      nop 3
[!a1] ldw *a2, a0
      nop
;; branch occurs here

since we know we're scheduling extended basic blocks, so we control the
code in the fallthru path.

This all works except for certain floating point instructions, which not
only store their destination after a given number of cycles, but which
also reserve functional units for multiple cycles. In the testcase I
have, it's a CMPLTDP instruction which can't be allowed to be placed in
the last delay cycle of the branch, since it reserves its units for two
cycles.

Fixed with this patch. Committed.


Bernd

Attachment: rsrvcycle.diff
Description: Text document


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