Commit ffd386b0 by Jakub Jelinek Committed by Jakub Jelinek

sparc.md (pic): New attribute.

	* config/sparc/sparc.md (pic): New attribute.
	(do_builtin_setjmp_setup): Save %fp, %i7 and %l7 for TARGET_V9
	into stack slots.
	(split after do_builtin_setjmp_setup): New.

From-SVN: r51870
parent 3c55704e
2002-04-04 Jakub Jelinek <jakub@redhat.com> 2002-04-04 Jakub Jelinek <jakub@redhat.com>
* config/sparc/sparc.md (pic): New attribute.
(do_builtin_setjmp_setup): Save %fp, %i7 and %l7 for TARGET_V9
into stack slots.
(split after do_builtin_setjmp_setup): New.
2002-04-04 Jakub Jelinek <jakub@redhat.com>
PR fortran/6106 PR fortran/6106
* config/sparc/sparc.h (MIN_UNITS_PER_WORD): Backout 2001-01-01 * config/sparc/sparc.h (MIN_UNITS_PER_WORD): Backout 2001-01-01
change. change.
......
...@@ -93,6 +93,9 @@ ...@@ -93,6 +93,9 @@
(define_attr "branch_type" "none,icc,fcc,reg" (const_string "none")) (define_attr "branch_type" "none,icc,fcc,reg" (const_string "none"))
(define_attr "pic" "false,true"
(symbol_ref "flag_pic != 0"))
;; Length (in # of insns). ;; Length (in # of insns).
(define_attr "length" "" (define_attr "length" ""
(cond [(eq_attr "type" "uncond_branch,call,sibcall") (cond [(eq_attr "type" "uncond_branch,call,sibcall")
...@@ -8877,22 +8880,41 @@ ...@@ -8877,22 +8880,41 @@
DONE; DONE;
}") }")
;; ??? Should set length to zero when !current_function_calls_alloca,
;; ??? but there is no easy way to get at that definition. It would
;; ??? require including function.h into sparc-protos.h and that is
;; ??? likely not a good idea. -DaveM
(define_insn "do_builtin_setjmp_setup" (define_insn "do_builtin_setjmp_setup"
[(unspec_volatile [(const_int 0)] 5)] [(unspec_volatile [(const_int 0)] 5)]
"" ""
"* "*
{ {
if (!current_function_calls_alloca) if (! current_function_calls_alloca || ! TARGET_V9 || TARGET_FLAT)
return \"\"; return \"#\";
if (TARGET_V9) fputs (\"\tflushw\n\", asm_out_file);
return \"flushw\"; if (flag_pic)
return \"ta\\t3\"; fprintf (asm_out_file, \"\tst%c\t%%l7, [%%sp+%d]\n\",
TARGET_ARCH64 ? 'x' : 'w',
SPARC_STACK_BIAS + 7 * UNITS_PER_WORD);
fprintf (asm_out_file, \"\tst%c\t%%fp, [%%sp+%d]\n\",
TARGET_ARCH64 ? 'x' : 'w',
SPARC_STACK_BIAS + 14 * UNITS_PER_WORD);
fprintf (asm_out_file, \"\tst%c\t%%i7, [%%sp+%d]\n\",
TARGET_ARCH64 ? 'x' : 'w',
SPARC_STACK_BIAS + 15 * UNITS_PER_WORD);
return \"\";
}" }"
[(set_attr "type" "misc")]) [(set_attr "type" "misc")
(set (attr "length") (if_then_else (eq_attr "pic" "true")
(const_int 4)
(const_int 3)))])
(define_split
[(unspec_volatile [(const_int 0)] 5)]
"! current_function_calls_alloca || ! TARGET_V9 || TARGET_FLAT"
[(const_int 0)]
"
{
if (current_function_calls_alloca)
emit_insn (gen_flush_register_windows ());
DONE;
}")
;; Pattern for use after a setjmp to store FP and the return register ;; Pattern for use after a setjmp to store FP and the return register
;; into the stack area. ;; into the stack area.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment