Commit dfdfa60f by David Edelsohn Committed by David Edelsohn

rs6000.md (restore_stack_block): Generate MEM and specify mode.

        * rs6000.md (restore_stack_block): Generate MEM and specify mode.
        * rs6000.h (STACK_SAVEAREA_MODE): SAVE_FUNCTION is VOIDmode.
        * rs6000.c (rs6000_output_load_toc_table): Use fputs.
        (output_function_profiler): Use asm_fprintf and fputs.

From-SVN: r20268
parent a0b152cd
Sun Jun 7 12:27:30 1998 David Edelsohn <edelsohn@mhpcc.edu>
* rs6000.md (restore_stack_block): Generate MEM and specify mode.
* rs6000.h (STACK_SAVEAREA_MODE): SAVE_FUNCTION is VOIDmode.
* rs6000.c (rs6000_output_load_toc_table): Use fputs.
(output_function_profiler): Use asm_fprintf and fputs.
Sat Jun 6 12:17:12 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Sat Jun 6 12:17:12 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gencheck.c: Remove redundant stdio.h include. Add a definition * gencheck.c: Remove redundant stdio.h include. Add a definition
......
...@@ -3676,7 +3676,7 @@ rs6000_output_load_toc_table (file, reg) ...@@ -3676,7 +3676,7 @@ rs6000_output_load_toc_table (file, reg)
ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1);
asm_fprintf (file, "\t{liu|lis} %s,", reg_names[reg]); asm_fprintf (file, "\t{liu|lis} %s,", reg_names[reg]);
assemble_name (file, buf); assemble_name (file, buf);
asm_fprintf (file, "@ha\n"); fputs ("@ha\n", file);
asm_fprintf (file, "\t{cal|la} %s,", reg_names[reg]); asm_fprintf (file, "\t{cal|la} %s,", reg_names[reg]);
assemble_name (file, buf); assemble_name (file, buf);
asm_fprintf (file, "@l(%s)\n", reg_names[reg]); asm_fprintf (file, "@l(%s)\n", reg_names[reg]);
...@@ -4609,32 +4609,28 @@ output_function_profiler (file, labelno) ...@@ -4609,32 +4609,28 @@ output_function_profiler (file, labelno)
fprintf (file, "\tmflr %s\n", reg_names[0]); fprintf (file, "\tmflr %s\n", reg_names[0]);
if (flag_pic == 1) if (flag_pic == 1)
{ {
fprintf (file, "\tbl _GLOBAL_OFFSET_TABLE_@local-4\n"); fputs ("\tbl _GLOBAL_OFFSET_TABLE_@local-4\n", file);
fprintf (file, "\t%s %s,4(%s)\n", asm_fprintf (file, "\t{st|stw} %s,4(%s)\n",
(TARGET_NEW_MNEMONICS) ? "stw" : "st", reg_names[0], reg_names[1]);
reg_names[0], reg_names[1]); asm_fprintf (file, "\tmflr %s\n", reg_names[11]);
fprintf (file, "\tmflr %s\n", reg_names[11]); asm_fprintf (file, "\t{l|lwz} %s,", reg_names[0]);
fprintf (file, "\t%s %s,", (TARGET_NEW_MNEMONICS) ? "lwz" : "l",
reg_names[0]);
assemble_name (file, buf); assemble_name (file, buf);
fprintf (file, "@got(%s)\n", reg_names[11]); asm_fprintf (file, "@got(%s)\n", reg_names[11]);
} }
#if TARGET_ELF #if TARGET_ELF
else if (flag_pic > 1 || TARGET_RELOCATABLE) else if (flag_pic > 1 || TARGET_RELOCATABLE)
{ {
fprintf (file, "\t%s %s,4(%s)\n", asm_fprintf (file, "\t{st|stw} %s,4(%s)\n",
(TARGET_NEW_MNEMONICS) ? "stw" : "st", reg_names[0], reg_names[1]);
reg_names[0], reg_names[1]);
rs6000_pic_func_labelno = rs6000_pic_labelno; rs6000_pic_func_labelno = rs6000_pic_labelno;
rs6000_output_load_toc_table (file, 11); rs6000_output_load_toc_table (file, 11);
fprintf (file, "\t%s %s,", (TARGET_NEW_MNEMONICS) ? "lwz" : "l", asm_fprintf (file, "\t{l|lwz} %s,", reg_names[11]);
reg_names[11]);
assemble_name (file, buf); assemble_name (file, buf);
fprintf (file, "X(%s)\n", reg_names[11]); asm_fprintf (file, "X(%s)\n", reg_names[11]);
fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); asm_fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
assemble_name (file, buf); assemble_name (file, buf);
fprintf (file, "X = .-.LCTOC1\n"); fputs ("X = .-.LCTOC1\n", file);
fprintf (file, "\t.long "); fputs ("\t.long ", file);
assemble_name (file, buf); assemble_name (file, buf);
fputs ("\n\t.previous\n", file); fputs ("\n\t.previous\n", file);
} }
...@@ -4643,7 +4639,7 @@ output_function_profiler (file, labelno) ...@@ -4643,7 +4639,7 @@ output_function_profiler (file, labelno)
{ {
asm_fprintf (file, "\t{liu|lis} %s,", reg_names[11]); asm_fprintf (file, "\t{liu|lis} %s,", reg_names[11]);
assemble_name (file, buf); assemble_name (file, buf);
asm_fprintf (file, "@ha\n"); fputs ("@ha\n", file);
asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", reg_names[0], reg_names[1]); asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", reg_names[0], reg_names[1]);
asm_fprintf (file, "\t{cal|la} %s,", reg_names[0]); asm_fprintf (file, "\t{cal|la} %s,", reg_names[0]);
assemble_name (file, buf); assemble_name (file, buf);
......
...@@ -1324,9 +1324,12 @@ extern int rs6000_sysv_varargs_p; ...@@ -1324,9 +1324,12 @@ extern int rs6000_sysv_varargs_p;
&& (DEFAULT_ABI != ABI_SOLARIS || int_size_in_bytes (TYPE) > 8)) && (DEFAULT_ABI != ABI_SOLARIS || int_size_in_bytes (TYPE) > 8))
/* Mode of stack savearea. /* Mode of stack savearea.
FUNCTION is VOIDmode because calling convention maintains SP.
BLOCK needs Pmode for SP.
NONLOCAL needs twice Pmode to maintain both backchain and SP. */ NONLOCAL needs twice Pmode to maintain both backchain and SP. */
#define STACK_SAVEAREA_MODE(LEVEL) \ #define STACK_SAVEAREA_MODE(LEVEL) \
(LEVEL == SAVE_NONLOCAL ? (TARGET_32BIT ? DImode : TImode) : Pmode) (LEVEL == SAVE_FUNCTION ? VOIDmode \
: LEVEL == SAVE_NONLOCAL ? (TARGET_32BIT ? DImode : TImode) : Pmode)
/* Minimum and maximum general purpose registers used to hold arguments. */ /* Minimum and maximum general purpose registers used to hold arguments. */
#define GP_ARG_MIN_REG 3 #define GP_ARG_MIN_REG 3
......
...@@ -7318,12 +7318,16 @@ ...@@ -7318,12 +7318,16 @@
"") "")
(define_expand "restore_stack_block" (define_expand "restore_stack_block"
[(set (match_dup 2) (mem (match_operand 0 "register_operand" ""))) [(use (match_operand 0 "register_operand" ""))
(set (match_dup 2) (match_dup 3))
(set (match_dup 0) (match_operand 1 "register_operand" "")) (set (match_dup 0) (match_operand 1 "register_operand" ""))
(set (mem (match_dup 0)) (match_dup 2))] (set (match_dup 3) (match_dup 2))]
"" ""
" "
{ operands[2] = gen_reg_rtx (Pmode); }") {
operands[2] = gen_reg_rtx (Pmode);
operands[3] = gen_rtx (MEM, Pmode, operands[0]);
}")
(define_expand "save_stack_nonlocal" (define_expand "save_stack_nonlocal"
[(match_operand 0 "memory_operand" "") [(match_operand 0 "memory_operand" "")
......
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