summaryrefslogtreecommitdiff
path: root/gcc/config/s390/s390.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-10 16:13:17 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-10 16:13:17 +0000
commitc8ebeb0e3c6b093e649592be7d51d1c0032a1dc7 (patch)
treebb832c8ec1fee906061fa6f7a5fa3fb4e910d68c /gcc/config/s390/s390.c
parentd254eda348d5b037f433a3525bdd635e9ee07561 (diff)
downloadgcc-c8ebeb0e3c6b093e649592be7d51d1c0032a1dc7.tar.gz
2016-02-10 Basile Starynkevitch <basile@starynkevitch.net>
{{merging with more of GCC 6, using svn merge -r225091:227000 ^/trunk }} git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@233280 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390/s390.c')
-rw-r--r--gcc/config/s390/s390.c86
1 files changed, 57 insertions, 29 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 861dfb2bb35..5814694adbc 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -3321,13 +3321,26 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
*total = 0;
return true;
+ case IOR:
+ /* risbg */
+ if (GET_CODE (XEXP (x, 0)) == AND
+ && GET_CODE (XEXP (x, 1)) == ASHIFT
+ && REG_P (XEXP (XEXP (x, 0), 0))
+ && REG_P (XEXP (XEXP (x, 1), 0))
+ && CONST_INT_P (XEXP (XEXP (x, 0), 1))
+ && CONST_INT_P (XEXP (XEXP (x, 1), 1))
+ && (UINTVAL (XEXP (XEXP (x, 0), 1)) ==
+ (1UL << UINTVAL (XEXP (XEXP (x, 1), 1))) - 1))
+ {
+ *total = COSTS_N_INSNS (2);
+ return true;
+ }
case ASHIFT:
case ASHIFTRT:
case LSHIFTRT:
case ROTATE:
case ROTATERT:
case AND:
- case IOR:
case XOR:
case NEG:
case NOT:
@@ -5839,8 +5852,17 @@ s390_expand_insv (rtx dest, rtx op1, rtx op2, rtx src)
if (mode_s == VOIDmode)
{
- /* Assume const_int etc already in the proper mode. */
- src = force_reg (mode, src);
+ /* For constant zero values the representation with AND
+ appears to be folded in more situations than the (set
+ (zero_extract) ...).
+ We only do this when the start and end of the bitfield
+ remain in the same SImode chunk. That way nihf or nilf
+ can be used.
+ The AND patterns might still generate a risbg for this. */
+ if (src == const0_rtx && bitpos / 32 == (bitpos + bitsize - 1) / 32)
+ return false;
+ else
+ src = force_reg (mode, src);
}
else if (mode_s != mode)
{
@@ -6475,6 +6497,10 @@ s390_dwarf_frame_reg_mode (int regno)
{
machine_mode save_mode = default_dwarf_frame_reg_mode (regno);
+ /* Make sure not to return DImode for any GPR with -m31 -mzarch. */
+ if (GENERAL_REGNO_P (regno))
+ save_mode = Pmode;
+
/* The rightmost 64 bits of vector registers are call-clobbered. */
if (GET_MODE_SIZE (save_mode) > 8)
save_mode = DImode;
@@ -7270,12 +7296,7 @@ s390_adjust_priority (rtx_insn *insn, int priority)
if (! INSN_P (insn))
return priority;
- if (s390_tune != PROCESSOR_2084_Z990
- && s390_tune != PROCESSOR_2094_Z9_109
- && s390_tune != PROCESSOR_2097_Z10
- && s390_tune != PROCESSOR_2817_Z196
- && s390_tune != PROCESSOR_2827_ZEC12
- && s390_tune != PROCESSOR_2964_Z13)
+ if (s390_tune <= PROCESSOR_2064_Z900)
return priority;
switch (s390_safe_attr_type (insn))
@@ -7304,15 +7325,20 @@ s390_issue_rate (void)
{
case PROCESSOR_2084_Z990:
case PROCESSOR_2094_Z9_109:
+ case PROCESSOR_2094_Z9_EC:
case PROCESSOR_2817_Z196:
return 3;
case PROCESSOR_2097_Z10:
return 2;
+ case PROCESSOR_9672_G5:
+ case PROCESSOR_9672_G6:
+ case PROCESSOR_2064_Z900:
/* Starting with EC12 we use the sched_reorder hook to take care
of instruction dispatch constraints. The algorithm only
picks the best instruction and assumes only a single
instruction gets issued per cycle. */
case PROCESSOR_2827_ZEC12:
+ case PROCESSOR_2964_Z13:
default:
return 1;
}
@@ -10110,6 +10136,10 @@ s390_save_gprs_to_fprs (void)
emit_move_insn (gen_rtx_REG (DImode, cfun_gpr_save_slot (i)),
gen_rtx_REG (DImode, i));
RTX_FRAME_RELATED_P (insn) = 1;
+ /* This prevents dwarf2cfi from interpreting the set. Doing
+ so it might emit def_cfa_register infos setting an FPR as
+ new CFA. */
+ add_reg_note (insn, REG_CFA_REGISTER, PATTERN (insn));
}
}
}
@@ -11597,7 +11627,14 @@ s390_expand_tbegin (rtx dest, rtx tdb, rtx retry, bool clobber_fprs_p)
}
if (clobber_fprs_p)
- emit_insn (gen_tbegin_1 (gen_rtx_CONST_INT (VOIDmode, TBEGIN_MASK), tdb));
+ {
+ if (TARGET_VX)
+ emit_insn (gen_tbegin_1_z13 (gen_rtx_CONST_INT (VOIDmode, TBEGIN_MASK),
+ tdb));
+ else
+ emit_insn (gen_tbegin_1 (gen_rtx_CONST_INT (VOIDmode, TBEGIN_MASK),
+ tdb));
+ }
else
emit_insn (gen_tbegin_nofloat_1 (gen_rtx_CONST_INT (VOIDmode, TBEGIN_MASK),
tdb));
@@ -12918,10 +12955,7 @@ s390_reorg (void)
s390_optimize_prologue ();
/* Walk over the insns and do some >=z10 specific changes. */
- if (s390_tune == PROCESSOR_2097_Z10
- || s390_tune == PROCESSOR_2817_Z196
- || s390_tune == PROCESSOR_2827_ZEC12
- || s390_tune == PROCESSOR_2964_Z13)
+ if (s390_tune >= PROCESSOR_2097_Z10)
{
rtx_insn *insn;
bool insn_added_p = false;
@@ -13172,12 +13206,12 @@ static int
s390_sched_reorder (FILE *file, int verbose,
rtx_insn **ready, int *nreadyp, int clock ATTRIBUTE_UNUSED)
{
- if (s390_tune == PROCESSOR_2097_Z10)
- if (reload_completed && *nreadyp > 1)
- s390_z10_prevent_earlyload_conflicts (ready, nreadyp);
+ if (s390_tune == PROCESSOR_2097_Z10
+ && reload_completed
+ && *nreadyp > 1)
+ s390_z10_prevent_earlyload_conflicts (ready, nreadyp);
- if ((s390_tune == PROCESSOR_2827_ZEC12
- || s390_tune == PROCESSOR_2964_Z13)
+ if (s390_tune >= PROCESSOR_2827_ZEC12
&& reload_completed
&& *nreadyp > 1)
{
@@ -13260,8 +13294,7 @@ s390_sched_variable_issue (FILE *file, int verbose, rtx_insn *insn, int more)
{
last_scheduled_insn = insn;
- if ((s390_tune == PROCESSOR_2827_ZEC12
- || s390_tune == PROCESSOR_2964_Z13)
+ if (s390_tune >= PROCESSOR_2827_ZEC12
&& reload_completed
&& recog_memoized (insn) >= 0)
{
@@ -13339,10 +13372,7 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
unsigned i;
unsigned mem_count = 0;
- if (s390_tune != PROCESSOR_2097_Z10
- && s390_tune != PROCESSOR_2817_Z196
- && s390_tune != PROCESSOR_2827_ZEC12
- && s390_tune != PROCESSOR_2964_Z13)
+ if (s390_tune < PROCESSOR_2097_Z10)
return nunroll;
/* Count the number of memory references within the loop body. */
@@ -13521,6 +13551,7 @@ s390_option_override (void)
s390_cost = &z990_cost;
break;
case PROCESSOR_2094_Z9_109:
+ case PROCESSOR_2094_Z9_EC:
s390_cost = &z9_109_cost;
break;
case PROCESSOR_2097_Z10:
@@ -13556,10 +13587,7 @@ s390_option_override (void)
target_flags |= MASK_LONG_DOUBLE_128;
#endif
- if (s390_tune == PROCESSOR_2097_Z10
- || s390_tune == PROCESSOR_2817_Z196
- || s390_tune == PROCESSOR_2827_ZEC12
- || s390_tune == PROCESSOR_2964_Z13)
+ if (s390_tune >= PROCESSOR_2097_Z10)
{
maybe_set_param_value (PARAM_MAX_UNROLLED_INSNS, 100,
global_options.x_param_values,