static int s390_issue_rate (void);
static int s390_use_dfa_pipeline_interface (void);
static int s390_first_cycle_multipass_dfa_lookahead (void);
-static int s390_sched_reorder2 (FILE *, int, rtx *, int *, int);
static bool s390_rtx_costs (rtx, int, int, int *);
static int s390_address_cost (rtx);
static void s390_reorg (void);
#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE s390_use_dfa_pipeline_interface
#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD s390_first_cycle_multipass_dfa_lookahead
-#undef TARGET_SCHED_REORDER2
-#define TARGET_SCHED_REORDER2 s390_sched_reorder2
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS s390_rtx_costs
#undef TARGET_PROMOTE_FUNCTION_RETURN
#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
-#undef TARGET_STRUCT_VALUE_RTX
-#define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null
-
struct gcc_target targetm = TARGET_INITIALIZER;
extern int reload_completed;
if (mode != VOIDmode && mode != GET_MODE (op))
return 0;
- if (GET_RTX_CLASS (GET_CODE (op)) != '<')
+ if (!COMPARISON_P (op))
return 0;
if (GET_CODE (XEXP (op, 0)) != REG
if (mode != VOIDmode && mode != GET_MODE (op))
return 0;
- if (GET_RTX_CLASS (GET_CODE (op)) != '<')
+ if (!COMPARISON_P (op))
return 0;
if (GET_CODE (XEXP (op, 0)) != REG
&& frame_pointer_needed
&& REGNO (base) == HARD_FRAME_POINTER_REGNUM)
|| REGNO (base) == ARG_POINTER_REGNUM
- || (REGNO (base) >= FIRST_VIRTUAL_REGISTER
- && REGNO (base) <= LAST_VIRTUAL_REGISTER)
|| (flag_pic
&& REGNO (base) == PIC_OFFSET_TABLE_REGNUM))
pointer = base_ptr = TRUE;
&& frame_pointer_needed
&& REGNO (indx) == HARD_FRAME_POINTER_REGNUM)
|| REGNO (indx) == ARG_POINTER_REGNUM
- || (REGNO (indx) >= FIRST_VIRTUAL_REGISTER
- && REGNO (indx) <= LAST_VIRTUAL_REGISTER)
|| (flag_pic
&& REGNO (indx) == PIC_OFFSET_TABLE_REGNUM))
pointer = indx_ptr = TRUE;
int even = INTVAL (op1) - 1;
op0 = gen_rtx_PLUS (Pmode, op0, GEN_INT (even));
op0 = gen_rtx_CONST (Pmode, op0);
- op1 = GEN_INT (1);
+ op1 = const1_rtx;
}
emit_move_insn (temp, op0);
return 0;
}
-/* Output symbolic constant X in assembler syntax to
- stdio stream FILE. */
+/* Output machine-dependent UNSPECs occurring in address constant X
+ in assembler syntax to stdio stream FILE. Returns true if the
+ constant X could be recognized, false otherwise. */
-void
-s390_output_symbolic_const (FILE *file, rtx x)
+bool
+s390_output_addr_const_extra (FILE *file, rtx x)
{
- switch (GET_CODE (x))
- {
- case CONST:
- case ZERO_EXTEND:
- case SIGN_EXTEND:
- s390_output_symbolic_const (file, XEXP (x, 0));
- break;
-
- case PLUS:
- s390_output_symbolic_const (file, XEXP (x, 0));
- fprintf (file, "+");
- s390_output_symbolic_const (file, XEXP (x, 1));
- break;
-
- case MINUS:
- s390_output_symbolic_const (file, XEXP (x, 0));
- fprintf (file, "-");
- s390_output_symbolic_const (file, XEXP (x, 1));
- break;
-
- case CONST_INT:
- case LABEL_REF:
- case CODE_LABEL:
- case SYMBOL_REF:
- output_addr_const (file, x);
- break;
-
- case UNSPEC:
- if (XVECLEN (x, 0) != 1)
- output_operand_lossage ("invalid UNSPEC as operand (1)");
- switch (XINT (x, 1))
- {
- case UNSPEC_GOTENT:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@GOTENT");
- break;
- case UNSPEC_GOT:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@GOT");
- break;
- case UNSPEC_GOTOFF:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@GOTOFF");
- break;
- case UNSPEC_PLT:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@PLT");
- break;
- case UNSPEC_PLTOFF:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@PLTOFF");
- break;
- case UNSPEC_TLSGD:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@TLSGD");
- break;
- case UNSPEC_TLSLDM:
- assemble_name (file, get_some_local_dynamic_name ());
- fprintf (file, "@TLSLDM");
- break;
- case UNSPEC_DTPOFF:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@DTPOFF");
- break;
- case UNSPEC_NTPOFF:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@NTPOFF");
- break;
- case UNSPEC_GOTNTPOFF:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@GOTNTPOFF");
- break;
- case UNSPEC_INDNTPOFF:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@INDNTPOFF");
- break;
- default:
- output_operand_lossage ("invalid UNSPEC as operand (2)");
- break;
- }
- break;
+ if (GET_CODE (x) == UNSPEC && XVECLEN (x, 0) == 1)
+ switch (XINT (x, 1))
+ {
+ case UNSPEC_GOTENT:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@GOTENT");
+ return true;
+ case UNSPEC_GOT:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@GOT");
+ return true;
+ case UNSPEC_GOTOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@GOTOFF");
+ return true;
+ case UNSPEC_PLT:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@PLT");
+ return true;
+ case UNSPEC_PLTOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@PLTOFF");
+ return true;
+ case UNSPEC_TLSGD:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@TLSGD");
+ return true;
+ case UNSPEC_TLSLDM:
+ assemble_name (file, get_some_local_dynamic_name ());
+ fprintf (file, "@TLSLDM");
+ return true;
+ case UNSPEC_DTPOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@DTPOFF");
+ return true;
+ case UNSPEC_NTPOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@NTPOFF");
+ return true;
+ case UNSPEC_GOTNTPOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@GOTNTPOFF");
+ return true;
+ case UNSPEC_INDNTPOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@INDNTPOFF");
+ return true;
+ }
- default:
- fatal_insn ("UNKNOWN in s390_output_symbolic_const !?", x);
- break;
- }
+ return false;
}
/* Output address operand ADDR in assembler syntax to
output_operand_lossage ("Cannot decompose address.");
if (ad.disp)
- s390_output_symbolic_const (file, ad.disp);
+ output_addr_const (file, ad.disp);
else
fprintf (file, "0");
abort ();
if (ad.disp)
- s390_output_symbolic_const (file, ad.disp);
+ output_addr_const (file, ad.disp);
else
fprintf (file, "0");
}
case CODE_LABEL:
case LABEL_REF:
case SYMBOL_REF:
- s390_output_symbolic_const (file, x);
+ output_addr_const (file, x);
break;
case CONST_INT:
return s390_use_dfa_pipeline_interface () ? 4 : 0;
}
-/* Called after issuing each insn.
- Triggers default sort algorithm to better slot instructions. */
-
-static int
-s390_sched_reorder2 (FILE *dump ATTRIBUTE_UNUSED,
- int sched_verbose ATTRIBUTE_UNUSED,
- rtx *ready ATTRIBUTE_UNUSED,
- int *pn_ready ATTRIBUTE_UNUSED,
- int clock_var ATTRIBUTE_UNUSED)
-{
- return s390_issue_rate();
-}
-
/* Split all branches that exceed the maximum distance.
Returns true if this created a new literal pool entry. */
if (pool->size >= 4096)
{
+ /* We're going to chunkify the pool, so remove the main
+ pool placeholder insn. */
+ remove_insn (pool->pool_insn);
+
s390_free_pool (pool);
pool = NULL;
}
}
-/* Output to FILE the constant pool entry EXP in mode MODE
- with alignment ALIGN. */
+/* Output the constant pool entry EXP in mode MODE with alignment ALIGN. */
void
-s390_output_pool_entry (FILE *file, rtx exp, enum machine_mode mode,
- unsigned int align)
+s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align)
{
REAL_VALUE_TYPE r;
break;
case MODE_INT:
- if (GET_CODE (exp) == CONST
- || GET_CODE (exp) == SYMBOL_REF
- || GET_CODE (exp) == LABEL_REF)
- {
- fputs (integer_asm_op (GET_MODE_SIZE (mode), TRUE), file);
- s390_output_symbolic_const (file, exp);
- fputc ('\n', file);
- }
- else
- {
- assemble_integer (exp, GET_MODE_SIZE (mode), align, 1);
- }
+ assemble_integer (exp, GET_MODE_SIZE (mode), align, 1);
break;
default:
if (cum->fprs + 1 > (TARGET_64BIT? 4 : 2))
return 0;
else
- return gen_rtx (REG, mode, cum->fprs + 16);
+ return gen_rtx_REG (mode, cum->fprs + 16);
}
else if (s390_function_arg_integer (mode, type))
{
if (cum->gprs + n_gprs > 5)
return 0;
else
- return gen_rtx (REG, mode, cum->gprs + 2);
+ return gen_rtx_REG (mode, cum->gprs + 2);
}
/* After the real arguments, expand_call calls us once again
void
s390_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
{
- emit_move_insn (gen_rtx
- (MEM, Pmode,
+ emit_move_insn (gen_rtx_MEM (Pmode,
memory_address (Pmode,
plus_constant (addr, (TARGET_64BIT ? 20 : 12) ))), cxt);
- emit_move_insn (gen_rtx
- (MEM, Pmode,
+ emit_move_insn (gen_rtx_MEM (Pmode,
memory_address (Pmode,
plus_constant (addr, (TARGET_64BIT ? 28 : 16) ))), fnaddr);
}