From 07ea92d369f23465125a18d989382683b3a4e730 Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Fri, 8 Oct 2004 11:44:20 +0000 Subject: [PATCH] sh.md (tls_global_dynamic): Use MEM pattern for the first argument of CALL. * config/sh/sh.md (tls_global_dynamic): Use MEM pattern for the first argument of CALL. (tls_local_dynamic): Likewise. * config/sh/sh.md (prefetch_media, prefetch_i4): New insns. (prefetch): Convert to expander. From-SVN: r88747 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/sh/sh.md | 44 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c0a9055724..8055ac68be1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2004-10-08 Kaz Kojima + + * config/sh/sh.md (prefetch_media, prefetch_i4): New insns. + (prefetch): Convert to expander. + +2004-10-08 Kaz Kojima + + * config/sh/sh.md (tls_global_dynamic): Use MEM pattern for the + first argument of CALL. + (tls_local_dynamic): Likewise. + 2004-10-08 Joseph S. Myers * c-typeck.c (enum impl_conv): New. 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; +}") -- 2.30.2