diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-04-16 20:26:58 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-04-16 20:26:58 -0400 |
commit | e6f948e3de96f63c11867bd6d274bfd5b872860d (patch) | |
tree | f0bb570e6c5fb54286dfe487dcc1e41f4dc6d517 | |
parent | bc3654906f31f7211d19f0887c7e5305116518f3 (diff) | |
download | gcc-e6f948e3de96f63c11867bd6d274bfd5b872860d.zip gcc-e6f948e3de96f63c11867bd6d274bfd5b872860d.tar.gz gcc-e6f948e3de96f63c11867bd6d274bfd5b872860d.tar.bz2 |
(untyped_call, blockage): New patterns.
From-SVN: r4169
-rw-r--r-- | gcc/config/alpha/alpha.md | 37 | ||||
-rw-r--r-- | gcc/config/romp/romp.md | 37 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 37 |
3 files changed, 111 insertions, 0 deletions
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 3fbf75d..ff2309d 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 70c19f4..4bdb503 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 5d476ac..347f097 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. |