#include "tm_p.h"
#include "regs.h"
#include "hard-reg-set.h"
+#include "real.h"
#include "insn-config.h"
#include "conditions.h"
#include "output.h"
#define cfun_frame_layout (cfun->machine->frame_layout)
#define cfun_save_high_fprs_p (!!cfun_frame_layout.high_fprs)
#define cfun_gprs_save_area_size ((cfun_frame_layout.last_save_gpr_slot - \
- cfun_frame_layout.first_save_gpr_slot + 1) * UNITS_PER_LONG)
+ cfun_frame_layout.first_save_gpr_slot + 1) * UNITS_PER_WORD)
#define cfun_set_fpr_bit(BITNUM) (cfun->machine->frame_layout.fpr_bitmap |= \
(1 << (BITNUM)))
#define cfun_fpr_bit_p(BITNUM) (!!(cfun->machine->frame_layout.fpr_bitmap & \
return TARGET_64BIT ? DImode : SImode;
}
-static enum machine_mode
-s390_unwind_word_mode (void)
-{
- return TARGET_64BIT ? DImode : SImode;
-}
-
/* Return true if the back end supports mode MODE. */
static bool
s390_scalar_mode_supported_p (enum machine_mode mode)
{
- /* In contrast to the default implementation reject TImode constants on 31bit
- TARGET_ZARCH for ABI compliance. */
- if (!TARGET_64BIT && TARGET_ZARCH && mode == TImode)
- return false;
-
if (DECIMAL_FLOAT_MODE_P (mode))
return default_decimal_float_supported_p ();
-
- return default_scalar_mode_supported_p (mode);
+ else
+ return default_scalar_mode_supported_p (mode);
}
/* Set the has_landing_pad_p flag in struct machine_function to VALUE. */
without maintaining a stack frame back-chain. */
flag_asynchronous_unwind_tables = 1;
- if (HAVE_prefetch || optimize >= 3)
- flag_prefetch_loop_arrays = 1;
-
/* Use MVCLE instructions to decrease code size if requested. */
if (size != 0)
target_flags |= MASK_MVCLE;
}
set_param_value ("max-pending-list-length", 256);
- /* values for loop prefetching */
- set_param_value ("l1-cache-line-size", 256);
- if (!PARAM_SET_P (PARAM_L1_CACHE_SIZE))
- set_param_value ("l1-cache-size", 128);
- /* s390 has more than 2 levels and the size is much larger. Since
- we are always running virtualized assume that we only get a small
- part of the caches above l1. */
- if (!PARAM_SET_P (PARAM_L2_CACHE_SIZE))
- set_param_value ("l2-cache-size", 1500);
- if (!PARAM_SET_P (PARAM_PREFETCH_MIN_INSN_TO_MEM_RATIO))
- set_param_value ("prefetch-min-insn-to-mem-ratio", 2);
- if (!PARAM_SET_P (PARAM_SIMULTANEOUS_PREFETCHES))
- set_param_value ("simultaneous-prefetches", 6);
}
/* Map for smallest class containing reg regno. */
{
rtx left = XEXP (x, 0);
rtx right = XEXP (x, 1);
- if (TARGET_ZARCH)
+ if (TARGET_64BIT)
{
if (GET_CODE (right) == CONST_INT
&& CONST_OK_FOR_K (INTVAL (right)))
{
rtx right = XEXP (x, 1);
if (GET_CODE (right) == ZERO_EXTEND) /* 64 by 32 bit division */
- if (TARGET_ZARCH)
+ if (TARGET_64BIT)
*total = s390_cost->dsgfr;
else
*total = s390_cost->dr;
if (MEM_P (x)
&& s390_symref_operand_p (XEXP (x, 0), NULL, NULL)
&& (mode == QImode || mode == TImode || FLOAT_MODE_P (mode)
- || (!TARGET_ZARCH && mode == DImode)
+ || (!TARGET_64BIT && mode == DImode)
|| ((mode == HImode || mode == SImode || mode == DImode)
&& (!s390_check_symref_alignment (XEXP (x, 0),
GET_MODE_SIZE (mode))))))
else
{
- rtx dst_addr, count, blocks, temp, dstp1 = NULL_RTX;
+ rtx dst_addr, src_addr, count, blocks, temp, dstp1 = NULL_RTX;
rtx loop_start_label = gen_label_rtx ();
rtx loop_end_label = gen_label_rtx ();
rtx end_label = gen_label_rtx ();
mode = Pmode;
dst_addr = gen_reg_rtx (Pmode);
+ src_addr = gen_reg_rtx (Pmode);
count = gen_reg_rtx (mode);
blocks = gen_reg_rtx (mode);
return 4;
}
+
/* Annotate every literal pool reference in X by an UNSPEC_LTREF expression.
Fix up MEMs as required. */
}
if (TARGET_PACKED_STACK)
- offset = -2 * UNITS_PER_LONG;
+ offset = -2 * UNITS_PER_WORD;
else
- offset = RETURN_REGNUM * UNITS_PER_LONG;
+ offset = RETURN_REGNUM * UNITS_PER_WORD;
addr = plus_constant (frame, offset);
addr = memory_address (Pmode, addr);
if (TARGET_PACKED_STACK)
chain = plus_constant (stack_pointer_rtx,
- STACK_POINTER_OFFSET - UNITS_PER_LONG);
+ STACK_POINTER_OFFSET - UNITS_PER_WORD);
else
chain = stack_pointer_rtx;
if (cfun_frame_layout.first_restore_gpr != -1)
{
b = (cfun_frame_layout.gprs_offset
- + cfun_frame_layout.first_restore_gpr * UNITS_PER_LONG);
+ + cfun_frame_layout.first_restore_gpr * UNITS_PER_WORD);
t = b + (cfun_frame_layout.last_restore_gpr
- - cfun_frame_layout.first_restore_gpr + 1) * UNITS_PER_LONG;
+ - cfun_frame_layout.first_restore_gpr + 1) * UNITS_PER_WORD;
}
if (TARGET_64BIT && cfun_save_high_fprs_p)
if (!TARGET_PACKED_STACK)
{
cfun_frame_layout.backchain_offset = 0;
- cfun_frame_layout.f0_offset = 16 * UNITS_PER_LONG;
+ cfun_frame_layout.f0_offset = 16 * UNITS_PER_WORD;
cfun_frame_layout.f4_offset = cfun_frame_layout.f0_offset + 2 * 8;
cfun_frame_layout.f8_offset = -cfun_frame_layout.high_fprs * 8;
cfun_frame_layout.gprs_offset = (cfun_frame_layout.first_save_gpr_slot
- * UNITS_PER_LONG);
+ * UNITS_PER_WORD);
}
else if (TARGET_BACKCHAIN) /* kernel stack layout */
{
cfun_frame_layout.backchain_offset = (STACK_POINTER_OFFSET
- - UNITS_PER_LONG);
+ - UNITS_PER_WORD);
cfun_frame_layout.gprs_offset
= (cfun_frame_layout.backchain_offset
- (STACK_POINTER_REGNUM - cfun_frame_layout.first_save_gpr_slot + 1)
- * UNITS_PER_LONG);
+ * UNITS_PER_WORD);
if (TARGET_64BIT)
{
else
{
if (TARGET_BACKCHAIN)
- cfun_frame_layout.frame_size += UNITS_PER_LONG;
+ cfun_frame_layout.frame_size += UNITS_PER_WORD;
/* No alignment trouble here because f8-f15 are only saved under
64 bit. */
case GENERAL_REGS:
if (REGNO_PAIR_OK (regno, mode))
{
- if (TARGET_ZARCH
+ if (TARGET_64BIT
|| (mode != TFmode && mode != TCmode && mode != TDmode))
return true;
}
index = RETURN_REGNUM - cfun_frame_layout.first_save_gpr_slot;
gcc_assert (index >= 0);
offset = cfun_frame_layout.frame_size + cfun_frame_layout.gprs_offset;
- offset += index * UNITS_PER_LONG;
+ offset += index * UNITS_PER_WORD;
break;
case BASE_REGNUM:
if (start > last)
return insn;
- addr = plus_constant (base, offset + (start - first) * UNITS_PER_LONG);
+ addr = plus_constant (base, offset + (start - first) * UNITS_PER_WORD);
note = gen_store_multiple (gen_rtx_MEM (Pmode, addr),
gen_rtx_REG (Pmode, start),
GEN_INT (last - start + 1));
{
insn = save_gprs (stack_pointer_rtx,
cfun_frame_layout.gprs_offset +
- UNITS_PER_LONG * (cfun_frame_layout.first_save_gpr
+ UNITS_PER_WORD * (cfun_frame_layout.first_save_gpr
- cfun_frame_layout.first_save_gpr_slot),
cfun_frame_layout.first_save_gpr,
cfun_frame_layout.last_save_gpr);
addr = plus_constant (frame_pointer,
offset + cfun_frame_layout.gprs_offset
+ (i - cfun_frame_layout.first_save_gpr_slot)
- * UNITS_PER_LONG);
+ * UNITS_PER_WORD);
addr = gen_rtx_MEM (Pmode, addr);
set_mem_alias_set (addr, get_frame_alias_set ());
emit_move_insn (addr, gen_rtx_REG (Pmode, i));
offset + cfun_frame_layout.gprs_offset
+ (RETURN_REGNUM
- cfun_frame_layout.first_save_gpr_slot)
- * UNITS_PER_LONG);
+ * UNITS_PER_WORD);
addr = gen_rtx_MEM (Pmode, addr);
set_mem_alias_set (addr, get_frame_alias_set ());
emit_move_insn (return_reg, addr);
offset + cfun_frame_layout.gprs_offset
+ (cfun_frame_layout.first_restore_gpr
- cfun_frame_layout.first_save_gpr_slot)
- * UNITS_PER_LONG,
+ * UNITS_PER_WORD,
cfun_frame_layout.first_restore_gpr,
cfun_frame_layout.last_restore_gpr);
insn = emit_insn (insn);
else if (s390_function_arg_integer (mode, type))
{
int size = s390_function_arg_size (mode, type);
- cum->gprs += ((size + UNITS_PER_LONG - 1) / UNITS_PER_LONG);
+ cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD);
}
else
gcc_unreachable ();
else if (s390_function_arg_integer (mode, type))
{
int size = s390_function_arg_size (mode, type);
- int n_gprs = (size + UNITS_PER_LONG - 1) / UNITS_PER_LONG;
+ int n_gprs = (size + UNITS_PER_WORD-1) / UNITS_PER_WORD;
if (cum->gprs + n_gprs > GP_ARG_NUM_REG)
return 0;
- else if (n_gprs == 1 || UNITS_PER_WORD == UNITS_PER_LONG)
+ else
return gen_rtx_REG (mode, cum->gprs + 2);
- else if (n_gprs == 2)
- {
- rtvec p = rtvec_alloc (2);
-
- RTVEC_ELT (p, 0)
- = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, cum->gprs + 2),
- const0_rtx);
- RTVEC_ELT (p, 1)
- = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, cum->gprs + 3),
- GEN_INT (4));
-
- return gen_rtx_PARALLEL (mode, p);
- }
}
/* After the real arguments, expand_call calls us once again
int for_return ATTRIBUTE_UNUSED)
{
if (INTEGRAL_MODE_P (mode)
- && GET_MODE_SIZE (mode) < UNITS_PER_LONG)
+ && GET_MODE_SIZE (mode) < UNITS_PER_WORD)
{
if (POINTER_TYPE_P (type))
*punsignedp = POINTERS_EXTEND_UNSIGNED;
if (TARGET_HARD_FLOAT && SCALAR_FLOAT_MODE_P (mode))
return gen_rtx_REG (mode, 16);
- else if (GET_MODE_SIZE (mode) <= UNITS_PER_LONG
- || UNITS_PER_LONG == UNITS_PER_WORD)
+ else
return gen_rtx_REG (mode, 2);
- else if (GET_MODE_SIZE (mode) == 2 * UNITS_PER_LONG)
- {
- rtvec p = rtvec_alloc (2);
-
- RTVEC_ELT (p, 0)
- = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, 2), const0_rtx);
- RTVEC_ELT (p, 1)
- = gen_rtx_EXPR_LIST (SImode, gen_rtx_REG (SImode, 3), GEN_INT (4));
-
- return gen_rtx_PARALLEL (mode, p);
- }
-
- gcc_unreachable ();
}
{
t = make_tree (TREE_TYPE (sav), return_address_pointer_rtx);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
- size_int (-RETURN_REGNUM * UNITS_PER_LONG));
+ size_int (-RETURN_REGNUM * UNITS_PER_WORD));
t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
TREE_SIDE_EFFECTS (t) = 1;
/* kernel stack layout on 31 bit: It is assumed here that no padding
will be added by s390_frame_info because for va_args always an even
number of gprs has to be saved r15-r2 = 14 regs. */
- sav_ofs = 2 * UNITS_PER_LONG;
- sav_scale = UNITS_PER_LONG;
- size = UNITS_PER_LONG;
+ sav_ofs = 2 * UNITS_PER_WORD;
+ sav_scale = UNITS_PER_WORD;
+ size = UNITS_PER_WORD;
max_reg = GP_ARG_NUM_REG - n_reg;
}
else if (s390_function_arg_float (TYPE_MODE (type), type))
indirect_p = 0;
reg = fpr;
n_reg = 1;
- sav_ofs = 16 * UNITS_PER_LONG;
+ sav_ofs = 16 * UNITS_PER_WORD;
sav_scale = 8;
max_reg = FP_ARG_NUM_REG - n_reg;
}
/* Otherwise into GP registers. */
indirect_p = 0;
reg = gpr;
- n_reg = (size + UNITS_PER_LONG - 1) / UNITS_PER_LONG;
+ n_reg = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
/* kernel stack layout on 31 bit: It is assumed here that no padding
will be added by s390_frame_info because for va_args always an even
number of gprs has to be saved r15-r2 = 14 regs. */
- sav_ofs = 2 * UNITS_PER_LONG;
+ sav_ofs = 2 * UNITS_PER_WORD;
- if (size < UNITS_PER_LONG)
- sav_ofs += UNITS_PER_LONG - size;
+ if (size < UNITS_PER_WORD)
+ sav_ofs += UNITS_PER_WORD - size;
- sav_scale = UNITS_PER_LONG;
+ sav_scale = UNITS_PER_WORD;
max_reg = GP_ARG_NUM_REG - n_reg;
}
/* ... Otherwise out of the overflow area. */
t = ovf;
- if (size < UNITS_PER_LONG)
+ if (size < UNITS_PER_WORD)
t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
- size_int (UNITS_PER_LONG - size));
+ size_int (UNITS_PER_WORD - size));
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
op[0] = gen_rtx_REG (Pmode, RETURN_REGNUM);
op[1] = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
- op[1] = gen_rtx_MEM (Pmode, plus_constant (op[1], UNITS_PER_LONG));
+ op[1] = gen_rtx_MEM (Pmode, plus_constant (op[1], UNITS_PER_WORD));
op[2] = gen_rtx_REG (Pmode, 1);
op[3] = gen_rtx_SYMBOL_REF (Pmode, label);
s390_function_arg_advance (&cum, mode, type, 0);
- if (!parm_rtx)
- continue;
-
- if (REG_P (parm_rtx))
- {
+ if (parm_rtx && REG_P (parm_rtx))
+ {
for (reg = 0;
reg < HARD_REGNO_NREGS (REGNO (parm_rtx), GET_MODE (parm_rtx));
reg++)
- if (!call_used_regs[reg + REGNO (parm_rtx)])
- return true;
- }
-
- if (GET_CODE (parm_rtx) == PARALLEL)
- {
- int i;
-
- for (i = 0; i < XVECLEN (parm_rtx, 0); i++)
- {
- rtx r = XEXP (XVECEXP (parm_rtx, 0, i), 0);
-
- gcc_assert (REG_P (r));
-
- for (reg = 0;
- reg < HARD_REGNO_NREGS (REGNO (r), GET_MODE (r));
- reg++)
- if (!call_used_regs[reg + REGNO (r)])
- return true;
- }
+ if (! call_used_regs[reg + REGNO (parm_rtx)])
+ return true;
}
-
}
return false;
}
replace the symbol itself with the PLT stub. */
if (flag_pic && !SYMBOL_REF_LOCAL_P (addr_location))
{
- if (retaddr_reg != NULL_RTX)
- {
- addr_location = gen_rtx_UNSPEC (Pmode,
- gen_rtvec (1, addr_location),
- UNSPEC_PLT);
- addr_location = gen_rtx_CONST (Pmode, addr_location);
- plt_call = true;
- }
- else
- /* For -fpic code the PLT entries might use r12 which is
- call-saved. Therefore we cannot do a sibcall when
- calling directly using a symbol ref. When reaching
- this point we decided (in s390_function_ok_for_sibcall)
- to do a sibcall for a function pointer but one of the
- optimizers was able to get rid of the function pointer
- by propagating the symbol ref into the call. This
- optimization is illegal for S/390 so we turn the direct
- call into a indirect call again. */
- addr_location = force_reg (Pmode, addr_location);
+ addr_location = gen_rtx_UNSPEC (Pmode,
+ gen_rtvec (1, addr_location),
+ UNSPEC_PLT);
+ addr_location = gen_rtx_CONST (Pmode, addr_location);
+ plt_call = true;
}
/* Unless we can use the bras(l) insn, force the
{
new_insn = save_gprs (base,
off + (cfun_frame_layout.first_save_gpr
- - first) * UNITS_PER_LONG,
+ - first) * UNITS_PER_WORD,
cfun_frame_layout.first_save_gpr,
cfun_frame_layout.last_save_gpr);
new_insn = emit_insn_before (new_insn, insn);
{
new_insn = restore_gprs (base,
off + (cfun_frame_layout.first_restore_gpr
- - first) * UNITS_PER_LONG,
+ - first) * UNITS_PER_WORD,
cfun_frame_layout.first_restore_gpr,
cfun_frame_layout.last_restore_gpr);
new_insn = emit_insn_before (new_insn, insn);
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_FUSED_MADD)
-
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION s390_handle_option
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO s390_encode_section_info
-#undef TARGET_SCALAR_MODE_SUPPORTED_P
-#define TARGET_SCALAR_MODE_SUPPORTED_P s390_scalar_mode_supported_p
-
#ifdef HAVE_AS_TLS
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS true
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT s390_trampoline_init
-#undef TARGET_UNWIND_WORD_MODE
-#define TARGET_UNWIND_WORD_MODE s390_unwind_word_mode
-
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-s390.h"