diff options
Diffstat (limited to 'gcc/config/sh/sh.md')
-rw-r--r-- | gcc/config/sh/sh.md | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 5adcac22664..dd9f216b587 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -6869,8 +6869,8 @@ (define_insn "tls_global_dynamic" [(set (match_operand:SI 0 "register_operand" "=&z") - (call (unspec:SI [(match_operand:SI 1 "" "")] - UNSPEC_TLSGD) + (call (mem:SI (unspec:SI [(match_operand:SI 1 "" "")] + UNSPEC_TLSGD)) (const_int 0))) (use (reg:PSI FPSCR_REG)) (use (reg:SI PIC_REG)) @@ -6898,8 +6898,8 @@ mov.l\\t1f,r4\\n\\ (define_insn "tls_local_dynamic" [(set (match_operand:SI 0 "register_operand" "=&z") - (call (unspec:SI [(match_operand:SI 1 "" "")] - UNSPEC_TLSLDM) + (call (mem:SI (unspec:SI [(match_operand:SI 1 "" "")] + UNSPEC_TLSLDM)) (const_int 0))) (use (reg:PSI FPSCR_REG)) (use (reg:SI PIC_REG)) @@ -10951,17 +10951,45 @@ mov.l\\t1f,r0\\n\\ "byterev %1, %0" [(set_attr "type" "arith_media")]) -(define_insn "prefetch" +(define_insn "prefetch_media" [(prefetch (match_operand:QI 0 "address_operand" "p") (match_operand:SI 1 "const_int_operand" "n") (match_operand:SI 2 "const_int_operand" "n"))] - "TARGET_SHMEDIA || TARGET_HARD_SH4" + "TARGET_SHMEDIA" "* { - if (TARGET_HARD_SH4) - return \"pref @%0\"; operands[0] = gen_rtx_MEM (QImode, operands[0]); output_asm_insn (\"ld%M0.b %m0,r63\", operands); return \"\"; }" [(set_attr "type" "other")]) + +(define_insn "prefetch_i4" + [(prefetch (match_operand:SI 0 "register_operand" "r") + (match_operand:SI 1 "const_int_operand" "n") + (match_operand:SI 2 "const_int_operand" "n"))] + "TARGET_HARD_SH4" + "* +{ + return \"pref @%0\"; +}" + [(set_attr "type" "other")]) + +(define_expand "prefetch" + [(prefetch (match_operand:QI 0 "address_operand" "p") + (match_operand:SI 1 "const_int_operand" "n") + (match_operand:SI 2 "const_int_operand" "n"))] + "TARGET_SHMEDIA || TARGET_HARD_SH4" + " +{ + if (TARGET_HARD_SH4 && ! register_operand (operands[0], SImode)) + { + rtx reg = gen_reg_rtx (SImode); + emit_move_insn (reg, operands[0]); + operands[0] = reg; + } + + emit_insn ((TARGET_SHMEDIA ? gen_prefetch_media : gen_prefetch_i4) + (operands[0], operands[1], operands[2])); + DONE; +}") |