From e6f948e3de96f63c11867bd6d274bfd5b872860d Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 16 Apr 1993 20:26:58 -0400 Subject: [PATCH] (untyped_call, blockage): New patterns. From-SVN: r4169 --- gcc/config/alpha/alpha.md | 37 +++++++++++++++++++++++++++++++++++++ gcc/config/romp/romp.md | 37 +++++++++++++++++++++++++++++++++++++ gcc/config/rs6000/rs6000.md | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 3fbf75d758b..ff2309df9b0 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -2341,6 +2341,43 @@ "bsr $26,%1..ng" [(set_attr "type" "ibr")]) +;; Call subroutine returning any type. + +(define_expand "untyped_call" + [(parallel [(call (match_operand 0 "" "") + (const_int 0)) + (match_operand 1 "" "") + (match_operand 2 "" "")])] + "" + " +{ + int i; + + emit_call_insn (gen_call (operands[0], const0_rtx, NULL, const0_rtx)); + + for (i = 0; i < XVECLEN (operands[2], 0); i++) + { + rtx set = XVECEXP (operands[2], 0, i); + emit_move_insn (SET_DEST (set), SET_SRC (set)); + } + + /* The optimizer does not know that the call sets the function value + registers we stored in the result block. We avoid problems by + claiming that all hard registers are used and clobbered at this + point. */ + emit_insn (gen_blockage ()); + + DONE; +}") + +;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and +;; all of memory. This blocks insns from being moved across this point. + +(define_insn "blockage" + [(unspec_volatile [(const_int 0)] 0)] + "" + "") + (define_insn "jump" [(set (pc) (label_ref (match_operand 0 "" "")))] diff --git a/gcc/config/romp/romp.md b/gcc/config/romp/romp.md index 70c19f4cde4..4bdb503aa39 100644 --- a/gcc/config/romp/romp.md +++ b/gcc/config/romp/romp.md @@ -1767,6 +1767,43 @@ "bali%# r15,%1" [(set_attr "type" "call")]) +;; Call subroutine returning any type. + +(define_expand "untyped_call" + [(parallel [(call (match_operand 0 "" "") + (const_int 0)) + (match_operand 1 "" "") + (match_operand 2 "" "")])] + "" + " +{ + int i; + + emit_call_insn (gen_call (operands[0], const0_rtx, NULL, const0_rtx)); + + for (i = 0; i < XVECLEN (operands[2], 0); i++) + { + rtx set = XVECEXP (operands[2], 0, i); + emit_move_insn (SET_DEST (set), SET_SRC (set)); + } + + /* The optimizer does not know that the call sets the function value + registers we stored in the result block. We avoid problems by + claiming that all hard registers are used and clobbered at this + point. */ + emit_insn (gen_blockage ()); + + DONE; +}") + +;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and +;; all of memory. This blocks insns from being moved across this point. + +(define_insn "blockage" + [(unspec_volatile [(const_int 0)] 0)] + "" + "") + ;; No operation insn. (define_insn "nop" [(const_int 0)] diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 5d476aca949..347f097fa3b 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -3055,6 +3055,43 @@ "@ brl\;l 2,20(1) bl %z1\;cror 15,15,15") + +;; Call subroutine returning any type. + +(define_expand "untyped_call" + [(parallel [(call (match_operand 0 "" "") + (const_int 0)) + (match_operand 1 "" "") + (match_operand 2 "" "")])] + "" + " +{ + int i; + + emit_call_insn (gen_call (operands[0], const0_rtx, NULL, const0_rtx)); + + for (i = 0; i < XVECLEN (operands[2], 0); i++) + { + rtx set = XVECEXP (operands[2], 0, i); + emit_move_insn (SET_DEST (set), SET_SRC (set)); + } + + /* The optimizer does not know that the call sets the function value + registers we stored in the result block. We avoid problems by + claiming that all hard registers are used and clobbered at this + point. */ + emit_insn (gen_blockage ()); + + DONE; +}") + +;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and +;; all of memory. This blocks insns from being moved across this point. + +(define_insn "blockage" + [(unspec_volatile [(const_int 0)] 0)] + "" + "") ;; Compare insns are next. Note that the RS/6000 has two types of compares, ;; signed & unsigned, and one type of branch. -- 2.30.2