public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: mrs@wrs.com (Mike Stump)
To: wilson@cygnus.com
Cc: egcs@cygnus.com, kenner@vlsi1.ultra.nyu.edu
Subject: Re: EH on i960 (and nested functions)
Date: Tue, 21 Apr 1998 23:21:00 -0000	[thread overview]
Message-ID: <199804212049.NAA07489@kankakee.wrs.com> (raw)

> Date: Tue, 21 Apr 1998 13:23:28 -0700
> From: Jim Wilson <wilson@cygnus.com>

> In addition to the changes you mentioned, you presumably also need
> to do something about STATIC_CHAIN_REGNUM. [ ... ]  I don't know
> what to do to solve this though.  I suspect we may need to make an
> ABI change that will affect non-nested functions too.

I am nearly done...  I should have the STATIC_CHAIN_REGNUM restored
properly.  No abi changes seem necessary, though one will need to
recompile all code that had non-local gotos in them (which is ok,
because that code didn't work before).

These changes aren't done, addition work (make sure -O doesn't screw
the code, nonlocal_goto's interface is different) is needed.  Nobody
said how hot kenenr was for the fixes, so I provide them here, just in
case he needs them in the nearer term.  I'll spruce them up and
resubmit them later.  Kenner, if you want to verify these fix the
problem you saw, you can take a look at sparc/sparc.md's nonlocal_goto
pattern for the right operand ordering, the one below was current as
of two years back, and just avoid -O.  If they don't work, let me know
what's missing and I will fix it for you.

Doing diffs in i960.h.~1~:
*** i960.h.~1~	Thu Apr 16 15:03:46 1998
--- i960.h	Thu Apr 16 15:04:24 1998
*************** extern struct rtx_def *gen_compare_reg (
*** 1472,1477 ****
--- 1472,1482 ----
  		  CXT);							\
  }
  
+ /* Generate RTL to flush the register windows so as to make arbitrary frames
+    available.  */
+ #define SETUP_FRAME_ADDRESSES()		\
+   emit_insn (gen_flush_register_windows ())
+ 
  #if 0
  /* Promote char and short arguments to ints, when want compatibility with
     the iC960 compilers.  */
--------------
Doing diffs in i960.md.~1~:
*** i960.md.~1~	Thu Apr 16 15:03:54 1998
--- i960.md	Mon Apr 20 18:05:15 1998
***************
*** 2419,2424 ****
--- 2419,2485 ----
    "* return i960_output_ret_insn (insn);"
    [(set_attr "type" "branch")])
  
+ (define_insn "ret"
+   [(use (reg:SI 16))
+    (unspec_volatile [(const_int 0)] 3)]
+   ""
+   "ret"
+   [(set_attr "type" "branch")
+    (set_attr "length" "1")])
+ 
+ (define_insn "call1f"
+   [(unspec_volatile [(const_int 0)] 4)]
+   ""
+   "call    1f\;1:"
+   [(set_attr "type" "misc")
+    (set_attr "length" "1")])
+ 
+ (define_expand "nonlocal_goto"
+   [(match_operand:SI 0 "" "")
+    (match_operand:SI 1 "general_operand" "")
+    (match_operand:SI 2 "general_operand" "")
+    (match_operand:SI 3 "general_operand" "")]
+   ""
+   "
+ {
+   rtx fp = operands[0];
+   rtx chain = operands[1];
+   rtx stack = operands[2];
+   rtx lab = operands[3];
+ 
+   if (GET_CODE (fp) != REG)
+     fp = force_reg (Pmode, fp);
+ #if 0  
+   /* Is this needed?  */
+   emit_move_insn (virtual_stack_vars_rtx, fp);
+ #endif
+   if (GET_CODE (lab) != REG)
+     lab = force_reg (Pmode, lab);
+   if (GET_CODE (chain) != REG)
+     chain = force_reg (Pmode, chain);
+   emit_insn (gen_call1f ());
+   emit_insn (gen_flush_register_windows ());
+   emit_move_insn (gen_rtx (MEM, SImode,
+ 			   plus_constant (fp, 8-STARTING_FRAME_OFFSET)),
+ 		  chain);
+   emit_move_insn (gen_rtx (MEM, SImode,
+ 			   plus_constant (fp, 12-STARTING_FRAME_OFFSET)),
+ 		  lab);
+   emit_move_insn (gen_rtx (REG, SImode, 16),
+ 		  plus_constant (fp, -STARTING_FRAME_OFFSET));
+   emit_insn (gen_ret ());
+   emit_barrier ();
+   DONE;
+ }")
+ 
+ ;; Special insn to flush register windows.
+ (define_insn "flush_register_windows"
+   [(unspec_volatile [(const_int 0)] 1)]
+   ""
+   "flushreg"
+   [(set_attr "type" "misc")
+    (set_attr "length" "1")])
+ 
  (define_insn "nop"
    [(const_int 0)]
    ""
--------------

             reply	other threads:[~1998-04-21 23:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-21 23:21 Mike Stump [this message]
1998-04-22 13:07 ` Jim Wilson
  -- strict thread matches above, loose matches on Subject: below --
1998-04-23  9:01 Don Bowman
1998-04-22 20:43 Mike Stump
1998-04-20 12:14 Mike Stump
1998-04-21 13:29 ` Jim Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199804212049.NAA07489@kankakee.wrs.com \
    --to=mrs@wrs.com \
    --cc=egcs@cygnus.com \
    --cc=kenner@vlsi1.ultra.nyu.edu \
    --cc=wilson@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).