Commit b2ccb744 by Ulrich Weigand Committed by Ulrich Weigand

s390.md (reload_base, ltorg): Remove.

	* config/s390/s390.md (reload_base, ltorg): Remove.
	* s390.c (s390_stop_dump_lit_p, s390_dump_literal_pool,
	s390_asm_output_pool_prologue, s390_pool_start_insn): Remove.
	* s390-protos.h (s390_stop_dump_lit_p, s390_dump_literal_pool,
	s390_asm_output_pool_prologue): Likewise.
	* s390.h (s390_pool_start_insn): Likewise.

	* s390.c (s390_output_symbolic_const): Remove support for
	old-style pool chunks.
	(s390_function_epilogue): Likewise.
	(s390_output_constant_pool): Likewise.  Also, fix incorrect
	alignment for 64-bit literal pools.
	(print_operand_address): Remove 'y' and 'Y' format flags.
	* s390.h (ASM_OUTPUT_POOL_PROLOGUE): Remove support for
	old-style pool chunks.
	(ASM_OUTPUT_SPECIAL_POOL_ENTRY): Likewise.
	(ASM_OUTPUT_POOL_EPILOGUE): Remove.
	(S390_CHUNK_MAX, S390_CHUNK_OV, S390_POOL_MAX): Remove.

	* s390.c (consttable_operand): New function.
	* s390-protos.h (consttable_operand): Declare it.
	* s390.h (PREDICATE_CODES): Add consttable_operand.
	* s390.md (consttable_qi, consttable_hi, consttable_si, consttable_di,
	consttable_sf, consttable_df, pool_start_31, pool_end_31,
	pool_start_64, pool_end_64, reload_base, reload_base2): New insns.
	* s390.c (struct constant, struct constant_pool): New data types.
	(constant_modes, gen_consttable): New variables.
	(s390_start_pool, s390_end_pool, s390_add_pool,
	s390_dump_pool, s390_free_pool): New functions.
	(s390_chunkify_pool): Completely reimplement literal pool
	overflow handling.

	* s390.c (s390_pool_overflow): New variable.
	* s390.h (s390_pool_overflow): Declare it.
	* s390.md (cjump, icjump): Use it to adapt length for out-of-range
	jumps in literal pool overflow situations.

	* s390.c (s390_decompose_address): Accept new-style pool chunk offsets.
	(s390_frame_info): Account for possible use of RETURN_REGNUM
	by new literal pool overflow code.
	(s390_emit_prologue): Likewise.

From-SVN: r54500
parent 2f937369
2002-06-11 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.md (reload_base, ltorg): Remove.
* s390.c (s390_stop_dump_lit_p, s390_dump_literal_pool,
s390_asm_output_pool_prologue, s390_pool_start_insn): Remove.
* s390-protos.h (s390_stop_dump_lit_p, s390_dump_literal_pool,
s390_asm_output_pool_prologue): Likewise.
* s390.h (s390_pool_start_insn): Likewise.
* s390.c (s390_output_symbolic_const): Remove support for
old-style pool chunks.
(s390_function_epilogue): Likewise.
(s390_output_constant_pool): Likewise. Also, fix incorrect
alignment for 64-bit literal pools.
(print_operand_address): Remove 'y' and 'Y' format flags.
* s390.h (ASM_OUTPUT_POOL_PROLOGUE): Remove support for
old-style pool chunks.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY): Likewise.
(ASM_OUTPUT_POOL_EPILOGUE): Remove.
(S390_CHUNK_MAX, S390_CHUNK_OV, S390_POOL_MAX): Remove.
* s390.c (consttable_operand): New function.
* s390-protos.h (consttable_operand): Declare it.
* s390.h (PREDICATE_CODES): Add consttable_operand.
* s390.md (consttable_qi, consttable_hi, consttable_si, consttable_di,
consttable_sf, consttable_df, pool_start_31, pool_end_31,
pool_start_64, pool_end_64, reload_base, reload_base2): New insns.
* s390.c (struct constant, struct constant_pool): New data types.
(constant_modes, gen_consttable): New variables.
(s390_start_pool, s390_end_pool, s390_add_pool,
s390_dump_pool, s390_free_pool): New functions.
(s390_chunkify_pool): Completely reimplement literal pool
overflow handling.
* s390.c (s390_pool_overflow): New variable.
* s390.h (s390_pool_overflow): Declare it.
* s390.md (cjump, icjump): Use it to adapt length for out-of-range
jumps in literal pool overflow situations.
* s390.c (s390_decompose_address): Accept new-style pool chunk offsets.
(s390_frame_info): Account for possible use of RETURN_REGNUM
by new literal pool overflow code.
(s390_emit_prologue): Likewise.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
......
......@@ -32,6 +32,7 @@ extern void s390_function_profiler PARAMS ((FILE *, int));
#ifdef RTX_CODE
extern int const0_operand PARAMS ((rtx, enum machine_mode));
extern int consttable_operand PARAMS ((rtx, enum machine_mode));
extern int larl_operand PARAMS ((rtx, enum machine_mode));
extern int fp_operand PARAMS ((rtx, enum machine_mode));
extern int s_operand PARAMS ((rtx, enum machine_mode));
......@@ -65,8 +66,6 @@ extern void s390_output_symbolic_const PARAMS ((FILE *, rtx));
extern void print_operand_address PARAMS ((FILE *, rtx));
extern void print_operand PARAMS ((FILE *, rtx, int));
extern void s390_output_constant_pool PARAMS ((FILE *));
extern int s390_stop_dump_lit_p PARAMS ((rtx));
extern void s390_dump_literal_pool PARAMS ((rtx, rtx));
extern void s390_trampoline_template PARAMS ((FILE *));
extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx));
extern rtx s390_gen_rtx_const_DI PARAMS ((int, int));
......@@ -74,7 +73,6 @@ extern rtx s390_simplify_dwarf_addr PARAMS ((rtx));
#endif /* RTX_CODE */
#ifdef TREE_CODE
extern void s390_asm_output_pool_prologue PARAMS ((FILE *, const char *, tree, int));
extern int s390_function_arg_pass_by_reference PARAMS ((enum machine_mode, tree));
extern void s390_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
extern tree s390_build_va_list PARAMS ((void));
......
......@@ -1259,6 +1259,8 @@ extern struct rtx_def *s390_compare_op0, *s390_compare_op1;
{"load_multiple_operation", {PARALLEL}}, \
{"store_multiple_operation", {PARALLEL}}, \
{"const0_operand", { CONST_INT, CONST_DOUBLE }}, \
{"consttable_operand", { SYMBOL_REF, LABEL_REF, CONST, \
CONST_INT, CONST_DOUBLE }}, \
{"s390_plus_operand", { PLUS }},
......@@ -1277,20 +1279,12 @@ extern struct rtx_def *s390_compare_op0, *s390_compare_op1;
/* Constant Pool for all symbols operands which are changed with
force_const_mem during insn generation (expand_insn). */
extern struct rtx_def *s390_pool_start_insn;
extern int s390_pool_count;
extern int s390_nr_constants;
/* Function is splitted in chunk, if literal pool could overflow
Value need to be lowered, if problems with displacement overflow. */
#define S390_CHUNK_MAX 0xe00
#define S390_CHUNK_OV 0x1000
#define S390_POOL_MAX 0xe00
extern int s390_pool_overflow;
#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, fndecl, size) \
{ \
register rtx insn; \
struct pool_constant *pool; \
\
if (s390_pool_count == -1) \
......@@ -1300,53 +1294,11 @@ extern int s390_nr_constants;
if (pool->mark) s390_nr_constants++; \
return; \
} \
if (first_pool == 0) { \
s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size); \
return; \
} \
for (pool = first_pool; pool; pool = pool->next) \
pool->mark = 0; \
\
insn = s390_pool_start_insn; \
\
if (insn==NULL_RTX) \
insn = get_insns (); \
else \
insn = NEXT_INSN (insn); \
for (; insn; insn = NEXT_INSN (insn)) { \
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') { \
if (s390_stop_dump_lit_p (insn)) { \
mark_constants (PATTERN (insn)); \
break; \
} else \
mark_constants (PATTERN (insn)); \
} \
} \
\
/* Mark entries referenced by other entries */ \
for (pool = first_pool; pool; pool = pool->next) \
if (pool->mark) \
mark_constants (pool->constant); \
\
s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size); \
}
/* We need to return, because otherwise the pool is deleted of the
constant pool after the first output. */
#define ASM_OUTPUT_POOL_EPILOGUE(FILE, FUNNAME, fndecl, size) return;
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, EXP, MODE, ALIGN, LABELNO, WIN) \
{ \
if ((s390_pool_count == 0) || (s390_pool_count > 0 && LABELNO >= 0)) \
{ \
fprintf (FILE, ".LC%d:\n", LABELNO); \
LABELNO = ~LABELNO; \
} \
if (s390_pool_count > 0) \
{ \
fprintf (FILE, ".LC%d_%X:\n", ~LABELNO, s390_pool_count); \
} \
fprintf (FILE, ".LC%d:\n", LABELNO); \
\
/* Output the value of the constant itself. */ \
switch (GET_MODE_CLASS (MODE)) \
......
......@@ -5676,6 +5676,9 @@
(const_int 4)
(ne (symbol_ref "TARGET_64BIT") (const_int 0))
(const_int 6)
(ne (symbol_ref "s390_pool_overflow") (const_int 0))
(if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
(const_int 12) (const_int 14))
(eq (symbol_ref "flag_pic") (const_int 0))
(const_int 6)] (const_int 8)))])
......@@ -5725,6 +5728,9 @@
(const_int 4)
(ne (symbol_ref "TARGET_64BIT") (const_int 0))
(const_int 6)
(ne (symbol_ref "s390_pool_overflow") (const_int 0))
(if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
(const_int 12) (const_int 14))
(eq (symbol_ref "flag_pic") (const_int 0))
(const_int 6)] (const_int 8)))])
......@@ -6384,33 +6390,133 @@
; Special literal pool access instruction pattern(s).
;
(define_insn "reload_base"
[(parallel [(set (reg 13) (pc))
(use (label_ref (match_operand 0 "" "")))])]
(define_insn "consttable_qi"
[(unspec_volatile [(match_operand:QI 0 "consttable_operand" "X")] 200)]
""
"*
{
if (TARGET_64BIT)
return \"larl\\t13,%y0\";
else
return \"basr\\t13,0\;ahi\\t13,%Y0\";
assemble_integer (operands[0], 1, BITS_PER_UNIT, 1);
return \"\";
}"
[(set_attr "op_type" "NN")
(set_attr "type" "la")
(set_attr "length" "8")])
[(set_attr "op_type" "NN")
(set_attr "length" "1")])
(define_insn "consttable_hi"
[(unspec_volatile [(match_operand:HI 0 "consttable_operand" "X")] 201)]
""
"*
{
assemble_integer (operands[0], 2, 2*BITS_PER_UNIT, 1);
return \"\";
}"
[(set_attr "op_type" "NN")
(set_attr "length" "2")])
(define_insn "consttable_si"
[(unspec_volatile [(match_operand:SI 0 "consttable_operand" "X")] 202)]
""
"*
{
if (!TARGET_64BIT && flag_pic && SYMBOLIC_CONST (operands[0]))
return \".long\\t%0\";
(define_insn "ltorg"
[(parallel [(set (reg 13) (pc))
(use (match_operand:SI 0 "const_int_operand" ""))])]
assemble_integer (operands[0], 4, 4*BITS_PER_UNIT, 1);
return \"\";
}"
[(set_attr "op_type" "NN")
(set_attr "length" "4")])
(define_insn "consttable_di"
[(unspec_volatile [(match_operand:DI 0 "consttable_operand" "X")] 203)]
""
"*
{
s390_dump_literal_pool (insn, operands[0]);
return \"0:\";
assemble_integer (operands[0], 8, 8*BITS_PER_UNIT, 1);
return \"\";
}"
[(set_attr "op_type" "NN")
(set_attr "length" "8")])
(define_insn "consttable_sf"
[(unspec_volatile [(match_operand:SF 0 "consttable_operand" "X")] 204)]
""
"*
{
REAL_VALUE_TYPE r;
if (GET_CODE (operands[0]) != CONST_DOUBLE)
abort ();
REAL_VALUE_FROM_CONST_DOUBLE (r, operands[0]);
assemble_real (r, SFmode, 4*BITS_PER_UNIT);
return \"\";
}"
[(set_attr "op_type" "NN")
(set_attr "length" "4")])
(define_insn "consttable_df"
[(unspec_volatile [(match_operand:DF 0 "consttable_operand" "X")] 205)]
""
"*
{
REAL_VALUE_TYPE r;
if (GET_CODE (operands[0]) != CONST_DOUBLE)
abort ();
REAL_VALUE_FROM_CONST_DOUBLE (r, operands[0]);
assemble_real (r, DFmode, 8*BITS_PER_UNIT);
return \"\";
}"
[(set_attr "op_type" "NN")
(set_attr "length" "8")])
(define_insn "pool_start_31"
[(unspec_volatile [(const_int 0)] 206)]
"!TARGET_64BIT"
".align\\t4"
[(set_attr "op_type" "NN")
(set_attr "length" "2")])
(define_insn "pool_end_31"
[(unspec_volatile [(const_int 0)] 207)]
"!TARGET_64BIT"
".align\\t2"
[(set_attr "op_type" "NN")
(set_attr "length" "2")])
(define_insn "pool_start_64"
[(unspec_volatile [(const_int 0)] 206)]
"TARGET_64BIT"
".section\\t.rodata\;.align\\t8"
[(set_attr "op_type" "NN")
(set_attr "length" "0")])
(define_insn "pool_end_64"
[(unspec_volatile [(const_int 0)] 207)]
"TARGET_64BIT"
".previous"
[(set_attr "op_type" "NN")
(set_attr "length" "0")])
(define_insn "reload_base"
[(set (match_operand:SI 0 "register_operand" "=a")
(unspec:SI [(label_ref (match_operand 1 "" ""))] 210))]
"!TARGET_64BIT"
"basr\\t%0,0\;la\\t%0,%1-.(%0)"
[(set_attr "op_type" "NN")
(set_attr "type" "other")
(set_attr "length" "4096")])
(set_attr "type" "la")
(set_attr "length" "6")])
(define_insn "reload_base2"
[(set (match_operand:SI 0 "register_operand" "=a")
(unspec:SI [(label_ref (match_operand 1 "" ""))] 211))]
"!TARGET_64BIT"
"la\\t%0,%1-.(%0)"
[(set_attr "op_type" "NN")
(set_attr "type" "la")
(set_attr "length" "4")])
;;
;; Insns related to generating the function prologue and epilogue.
......
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