alpha.c (current_file_function_operand): Don't fail for profiling.

* alpha.c (current_file_function_operand): Don't fail for profiling.
        (direct_call_operand): New.
        * alpha-protos.h: Declare it.
        * alpha.h (EXTRA_CONSTRAINT): Use it.
        (PREDICATE_CODES): Add it.
        (ASM_OUTPUT_MI_THUNK): Remove.
        * alpha32.h (ASM_OUTPUT_MI_THUNK): Remove.
        * alpha.md (sibcall_osf_1, sibcall_value_osf_1): Add 's' alternative.

From-SVN: r46299
This commit is contained in:
Richard Henderson 2001-10-16 15:44:39 -07:00 committed by Richard Henderson
parent 087772344c
commit 1afec8ade9
6 changed files with 59 additions and 76 deletions

View File

@ -1,3 +1,14 @@
2001-10-16 Richard Henderson <rth@redhat.com>
* alpha.c (current_file_function_operand): Don't fail for profiling.
(direct_call_operand): New.
* alpha-protos.h: Declare it.
* alpha.h (EXTRA_CONSTRAINT): Use it.
(PREDICATE_CODES): Add it.
(ASM_OUTPUT_MI_THUNK): Remove.
* alpha32.h (ASM_OUTPUT_MI_THUNK): Remove.
* alpha.md (sibcall_osf_1, sibcall_value_osf_1): Add 's' alternative.
2001-10-16 Krister Walfridsson <cato@df.lth.se>
* config/i386/netbsd-elf.h (ASM_OUTPUT_ADDR_DIFF_ELT): Define.

View File

@ -56,6 +56,7 @@ extern int some_operand PARAMS ((rtx, enum machine_mode));
extern int some_ni_operand PARAMS ((rtx, enum machine_mode));
extern int input_operand PARAMS ((rtx, enum machine_mode));
extern int current_file_function_operand PARAMS ((rtx, enum machine_mode));
extern int direct_call_operand PARAMS ((rtx, enum machine_mode));
extern int local_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int small_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int global_symbolic_operand PARAMS ((rtx, enum machine_mode));

View File

@ -839,10 +839,35 @@ current_file_function_operand (op, mode)
rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == SYMBOL_REF
&& ! profile_flag && ! profile_block_flag
&& (SYMBOL_REF_FLAG (op)
|| op == XEXP (DECL_RTL (current_function_decl), 0)));
if (GET_CODE (op) != SYMBOL_REF)
return 0;
if (! SYMBOL_REF_FLAG (op)
&& op != XEXP (DECL_RTL (current_function_decl), 0))
return 0;
return 1;
}
/* Return 1 if OP is a SYMBOL_REF for which we can make a call via bsr. */
int
direct_call_operand (op, mode)
rtx op;
enum machine_mode mode;
{
/* Must be defined in this file. */
if (! current_file_function_operand (op, mode))
return 0;
/* If profiling is implemented via linker tricks, we can't jump
to the nogp alternate entry point. */
/* ??? TARGET_PROFILING_NEEDS_GP isn't really the right test,
but is approximately correct for the OSF ABIs. Don't know
what to do for VMS, NT, or UMK. */
if (! TARGET_PROFILING_NEEDS_GP
&& ! profile_flag && ! profile_block_flag)
return 0;
}
/* Return true if OP is a LABEL_REF, or SYMBOL_REF or CONST referencing

View File

@ -824,7 +824,7 @@ enum reg_class { NO_REGS, PV_REG, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
#define EXTRA_CONSTRAINT(OP, C) \
((C) == 'Q' ? normal_memory_operand (OP, VOIDmode) \
: (C) == 'R' ? current_file_function_operand (OP, Pmode) \
: (C) == 'R' ? direct_call_operand (OP, Pmode) \
: (C) == 'S' ? (GET_CODE (OP) == CONST_INT \
&& (unsigned HOST_WIDE_INT) INTVAL (OP) < 64) \
: (C) == 'T' ? GET_CODE (OP) == HIGH \
@ -2093,44 +2093,6 @@ do { \
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */
/* ??? This is only used with the v2 ABI, and alpha.c makes assumptions
about current_function_is_thunk that are not valid with the v3 ABI. */
#if 0
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \
const char *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
int reg; \
\
if (TARGET_ABI_OSF) \
fprintf (FILE, "\tldgp $29,0($27)\n"); \
\
/* Mark end of prologue. */ \
output_end_prologue (FILE); \
\
/* Rely on the assembler to macro expand a large delta. */ \
fprintf (FILE, "\t.set at\n"); \
reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \
fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \
\
if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0), \
VOIDmode)) \
{ \
fprintf (FILE, "\tbr $31,$"); \
assemble_name (FILE, fn_name); \
fprintf (FILE, "..ng\n"); \
} \
else \
{ \
fprintf (FILE, "\tjmp $31,"); \
assemble_name (FILE, fn_name); \
fputc ('\n', FILE); \
} \
fprintf (FILE, "\t.set noat\n"); \
} while (0)
#endif
/* Print operand X (an rtx) in assembler syntax to file FILE.
@ -2188,6 +2150,7 @@ do { \
{"divmod_operator", {DIV, MOD, UDIV, UMOD}}, \
{"fp0_operand", {CONST_DOUBLE}}, \
{"current_file_function_operand", {SYMBOL_REF}}, \
{"direct_call_operand", {SYMBOL_REF}}, \
{"local_symbolic_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
{"small_symbolic_operand", {SYMBOL_REF, CONST}}, \
{"global_symbolic_operand", {SYMBOL_REF, CONST}}, \

View File

@ -4848,13 +4848,18 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi"
[(set_attr "type" "jsr")
(set_attr "length" "12,*,16")])
;; Need 's' alternative for OSF/1, which implements profiling
;; via linker tricks.
(define_insn "*sibcall_osf_1"
[(call (mem:DI (match_operand:DI 0 "current_file_function_operand" "R"))
[(call (mem:DI (match_operand:DI 0 "current_file_function_operand" "R,s"))
(match_operand 1 "" ""))
(use (reg:DI 29))]
"TARGET_ABI_OSF"
"br $31,$%0..ng"
[(set_attr "type" "jsr")])
"@
br $31,$%0..ng
jmp $31,%0"
[(set_attr "type" "jsr")
(set_attr "length" "*,8")])
(define_insn "*call_nt_1"
[(call (mem:DI (match_operand:DI 0 "call_operand" "r,R,s"))
@ -6802,14 +6807,19 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi"
[(set_attr "type" "jsr")
(set_attr "length" "12,*,16")])
;; Need 's' alternative for OSF/1, which implements profiling
;; via linker tricks.
(define_insn "*sibcall_value_osf_1"
[(set (match_operand 0 "" "")
(call (mem:DI (match_operand:DI 1 "current_file_function_operand" "R"))
(call (mem:DI (match_operand:DI 1 "current_file_function_operand" "R,s"))
(match_operand 2 "" "")))
(use (reg:DI 29))]
"TARGET_ABI_OSF"
"br $31,$%1..ng"
[(set_attr "type" "jsr")])
"@
br $31,$%1..ng
jmp $31,%1"
[(set_attr "type" "jsr")
(set_attr "length" "*,8")])
(define_insn "*call_value_nt_1"
[(set (match_operand 0 "" "")

View File

@ -78,30 +78,3 @@ Boston, MA 02111-1307, USA. */
#undef INITIALIZE_TRAMPOLINE
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 20, 16, 12)
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */
/* ??? This is only used with the v2 ABI, and alpha.c makes assumptions
about current_function_is_thunk that are not valid with the v3 ABI. */
#if 0
#undef ASM_OUTPUT_MI_THUNK
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \
const char *op, *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
int reg; \
\
/* Mark end of prologue. */ \
output_end_prologue (FILE); \
\
/* Rely on the assembler to macro expand a large delta. */ \
reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \
fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \
\
op = "jsr"; \
if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0))) \
op = "br"; \
fprintf (FILE, "\t%s $31,", op); \
assemble_name (FILE, fn_name); \
fputc ('\n', FILE); \
} while (0)
#endif