summaryrefslogtreecommitdiff
path: root/gcc/config/spu/spu.md
diff options
context:
space:
mode:
authortsmigiel <tsmigiel@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-05 22:12:24 +0000
committertsmigiel <tsmigiel@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-05 22:12:24 +0000
commit5a976006131fae932edbe2f9732367a512373218 (patch)
treec37a03103b3833c1eaba6a9dccfbcb1a8045587e /gcc/config/spu/spu.md
parent5422d457a256845828efe38f13789e8dd618d333 (diff)
downloadgcc-5a976006131fae932edbe2f9732367a512373218.tar.gz
Improved branch hints, safe hints, and scheduling.
* haifa-sched.c (sched_emit_insn) : Define. * sched-int.h (sched_emit_insn) : Add prototype. * doc/invoke.texi (-mdual-nops, -mhint-max-nops, -mhint-max-distance -msafe-hints) : Document. * config/spu/spu.c (spu_flag_var_tracking): New. (TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_INIT, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_ASM_FILE_START): Define. (TARGET_SCHED_ADJUST_PRIORITY): Remove. (STOP_HINT_P, HINTED_P, SCHED_ON_EVEN_P): Define. (spu_emit_branch_hint): Add blocks argument. (insert_branch_hints, insert_nops): Remove. (pad_bb, insert_hbrp_for_ilb_runout, insert_hbrp, in_spu_reorg, uses_ls_unit, spu_sched_init_global, spu_sched_init, spu_sched_reorder, asm_file_start): New functions. (clock_var, spu_sched_length, pipe0_clock, pipe1_clock, prev_clock_var, prev_priority, spu_ls_first, prev_ls_clock): New static variables. * config/spu/spu.h (TARGET_DEFAULT): Add MASK_SAFE_HINTS. * config/spu.md (iprefetch): Add operand, make it clobber MEM. (nopn_nv): Add a non-volatile version of nop. * config/spu/spu.opt (-mdual-nops, -mhint-max-nops, -mhint-max-distance, -msafe-hints): New options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140047 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/spu/spu.md')
-rw-r--r--gcc/config/spu/spu.md15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md
index 7b4b743fc8d..d1fa6f03508 100644
--- a/gcc/config/spu/spu.md
+++ b/gcc/config/spu/spu.md
@@ -4200,12 +4200,23 @@ selb\t%0,%4,%0,%3"
"lnop"
[(set_attr "type" "lnop")])
+;; The operand is so we know why we generated this hbrp.
+;; We clobber mem to make sure it isn't moved over any
+;; loads, stores or calls while scheduling.
(define_insn "iprefetch"
- [(unspec [(const_int 0)] UNSPEC_IPREFETCH)]
+ [(unspec [(match_operand:SI 0 "const_int_operand" "n")] UNSPEC_IPREFETCH)
+ (clobber (mem:BLK (scratch)))]
""
- "hbrp"
+ "hbrp\t# %0"
[(set_attr "type" "iprefetch")])
+;; A non-volatile version so it gets scheduled
+(define_insn "nopn_nv"
+ [(unspec [(match_operand:SI 0 "register_operand" "r")] UNSPEC_NOP)]
+ ""
+ "nop\t%0"
+ [(set_attr "type" "nop")])
+
(define_insn "hbr"
[(set (reg:SI 130)
(unspec:SI [(match_operand:SI 0 "immediate_operand" "i,i,i")