/* The Blackfin code generation auxiliary output file.
- Copyright (C) 2005-2013 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 Free Software Foundation, Inc.
Contributed by Analog Devices.
This file is part of GCC.
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define IN_TARGET_CODE 1
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
+#include "backend.h"
+#include "target.h"
#include "rtl.h"
+#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
+#include "cfghooks.h"
+#include "df.h"
+#include "memmodel.h"
+#include "tm_p.h"
+#include "optabs.h"
#include "regs.h"
-#include "hard-reg-set.h"
-#include "insn-config.h"
-#include "insn-codes.h"
-#include "conditions.h"
-#include "insn-flags.h"
+#include "emit-rtl.h"
+#include "recog.h"
+#include "cgraph.h"
+#include "diagnostic-core.h"
#include "output.h"
#include "insn-attr.h"
-#include "tree.h"
#include "varasm.h"
#include "calls.h"
-#include "flags.h"
-#include "except.h"
-#include "function.h"
-#include "input.h"
-#include "target.h"
-#include "target-def.h"
+#include "explow.h"
#include "expr.h"
-#include "diagnostic-core.h"
-#include "recog.h"
-#include "optabs.h"
-#include "ggc.h"
-#include "cgraph.h"
+#include "cfgrtl.h"
#include "langhooks.h"
-#include "bfin-protos.h"
-#include "tm_p.h"
-#include "tm-preds.h"
#include "tm-constrs.h"
#include "gt-bfin.h"
-#include "basic-block.h"
-#include "timevar.h"
-#include "df.h"
#include "sel-sched.h"
#include "hw-doloop.h"
-#include "opts.h"
#include "dumpfile.h"
+#include "builtins.h"
+
+/* This file should be included last. */
+#include "target-def.h"
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
if (saveall || is_inthandler)
{
- rtx insn = emit_move_insn (predec, gen_rtx_REG (SImode, REG_ASTAT));
+ rtx_insn *insn = emit_move_insn (predec, gen_rtx_REG (SImode, REG_ASTAT));
RTX_FRAME_RELATED_P (insn) = 1;
for (dregno = REG_LT0; dregno <= REG_LB1; dregno++)
if (total_consec != 0)
{
- rtx insn;
+ rtx_insn *insn;
rtx val = GEN_INT (-total_consec * 4);
rtx pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total_consec + 2));
XVECEXP (pat, 0, 0) = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, val),
UNSPEC_PUSH_MULTIPLE);
- XVECEXP (pat, 0, total_consec + 1) = gen_rtx_SET (VOIDmode, spreg,
+ XVECEXP (pat, 0, total_consec + 1) = gen_rtx_SET (spreg,
gen_rtx_PLUS (Pmode,
spreg,
val));
rtx subpat;
if (d_to_save > 0)
{
- subpat = gen_rtx_SET (VOIDmode, memref, gen_rtx_REG (word_mode,
- dregno++));
+ subpat = gen_rtx_SET (memref, gen_rtx_REG (word_mode, dregno++));
d_to_save--;
}
else
{
- subpat = gen_rtx_SET (VOIDmode, memref, gen_rtx_REG (word_mode,
- pregno++));
+ subpat = gen_rtx_SET (memref, gen_rtx_REG (word_mode, pregno++));
}
XVECEXP (pat, 0, i + 1) = subpat;
RTX_FRAME_RELATED_P (subpat) = 1;
{
if (must_save_p (is_inthandler, dregno))
{
- rtx insn = emit_move_insn (predec, gen_rtx_REG (word_mode, dregno));
+ rtx_insn *insn =
+ emit_move_insn (predec, gen_rtx_REG (word_mode, dregno));
RTX_FRAME_RELATED_P (insn) = 1;
ndregs--;
}
{
if (must_save_p (is_inthandler, pregno))
{
- rtx insn = emit_move_insn (predec, gen_rtx_REG (word_mode, pregno));
+ rtx_insn *insn =
+ emit_move_insn (predec, gen_rtx_REG (word_mode, pregno));
RTX_FRAME_RELATED_P (insn) = 1;
npregs--;
}
&& (df_regs_ever_live_p (i)
|| (!leaf_function_p () && call_used_regs[i]))))
{
- rtx insn;
+ rtx_insn *insn;
if (i == REG_A0 || i == REG_A1)
insn = emit_move_insn (gen_rtx_MEM (PDImode, predec1),
gen_rtx_REG (PDImode, i));
int npregs_consec = saveall ? 6 : n_pregs_to_save (is_inthandler, true);
int total_consec = ndregs_consec + npregs_consec;
int i, regno;
- rtx insn;
+ rtx_insn *insn;
/* A slightly crude technique to stop flow from trying to delete "dead"
insns. */
{
rtx pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total_consec + 1));
XVECEXP (pat, 0, 0)
- = gen_rtx_SET (VOIDmode, spreg,
- gen_rtx_PLUS (Pmode, spreg,
- GEN_INT (total_consec * 4)));
+ = gen_rtx_SET (spreg, gen_rtx_PLUS (Pmode, spreg,
+ GEN_INT (total_consec * 4)));
if (npregs_consec > 0)
regno = REG_P5 + 1;
regno--;
XVECEXP (pat, 0, i + 1)
- = gen_rtx_SET (VOIDmode, gen_rtx_REG (word_mode, regno), memref);
+ = gen_rtx_SET (gen_rtx_REG (word_mode, regno), memref);
if (npregs_consec > 0)
{
static void
setup_incoming_varargs (cumulative_args_t cum,
- enum machine_mode mode ATTRIBUTE_UNUSED,
+ machine_mode mode ATTRIBUTE_UNUSED,
tree type ATTRIBUTE_UNUSED, int *pretend_size,
int no_rtl)
{
static void
frame_related_constant_load (rtx reg, HOST_WIDE_INT constant, bool related)
{
- rtx insn;
+ rtx_insn *insn;
rtx cst = GEN_INT (constant);
if (constant >= -32768 && constant < 65536)
{
rtx tmpreg;
rtx tmpreg2;
- rtx insn;
+ rtx_insn *insn;
tmpreg2 = NULL_RTX;
do
{
int size = value;
- rtx insn;
+ rtx_insn *insn;
if (size > 60)
size = 60;
emit_link_insn (rtx spreg, HOST_WIDE_INT frame_size)
{
HOST_WIDE_INT link_size = frame_size;
- rtx insn;
+ rtx_insn *insn;
int i;
if (link_size > 262140)
rtx pat = gen_movsi (gen_rtx_MEM (Pmode,
gen_rtx_PRE_DEC (Pmode, spreg)),
bfin_rets_rtx);
- rtx insn = emit_insn (pat);
+ rtx_insn *insn = emit_insn (pat);
RTX_FRAME_RELATED_P (insn) = 1;
}
if (must_save_fp_p ())
rtx pat = gen_movsi (gen_rtx_MEM (Pmode,
gen_rtx_PRE_DEC (Pmode, spreg)),
gen_rtx_REG (Pmode, REG_FP));
- rtx insn = emit_insn (pat);
+ rtx_insn *insn = emit_insn (pat);
RTX_FRAME_RELATED_P (insn) = 1;
}
add_to_reg (spreg, -frame_size, 1, 0);
HOST_WIDE_INT frame_size = get_frame_size ();
rtx predec1 = gen_rtx_PRE_DEC (SImode, spreg);
rtx predec = gen_rtx_MEM (SImode, predec1);
- rtx insn;
+ rtx_insn *insn;
tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl));
tree kspisusp = lookup_attribute ("kspisusp", attrs);
struct cgraph_local_info *i = NULL;
rtx addr;
- i = cgraph_local_info (current_function_decl);
+ i = cgraph_node::local_info (current_function_decl);
/* Functions local to the translation unit don't need to reload the
pic reg, since the caller always passes a usable one. */
tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl));
bool all = lookup_attribute ("saveall", attrs) != NULL_TREE;
+ if (flag_stack_usage_info)
+ current_function_static_stack_size = frame_size;
+
if (fkind != SUBROUTINE)
{
expand_interrupt_handler_prologue (spreg, fkind, all);
32-bit instruction. */
int
-effective_address_32bit_p (rtx op, enum machine_mode mode)
+effective_address_32bit_p (rtx op, machine_mode mode)
{
HOST_WIDE_INT offset;
static int
bfin_address_cost (rtx addr ATTRIBUTE_UNUSED,
- enum machine_mode mode ATTRIBUTE_UNUSED,
+ machine_mode mode ATTRIBUTE_UNUSED,
addr_space_t as ATTRIBUTE_UNUSED,
bool speed ATTRIBUTE_UNUSED)
{
switch (GET_CODE (x))
{
case PLUS:
- output_address (XEXP (x, 0));
+ output_address (VOIDmode, XEXP (x, 0));
fprintf (file, "+");
- output_address (XEXP (x, 1));
+ output_address (VOIDmode, XEXP (x, 1));
break;
case PRE_DEC:
fprintf (file, "--");
- output_address (XEXP (x, 0));
+ output_address (VOIDmode, XEXP (x, 0));
break;
case POST_INC:
- output_address (XEXP (x, 0));
+ output_address (VOIDmode, XEXP (x, 0));
fprintf (file, "++");
break;
case POST_DEC:
- output_address (XEXP (x, 0));
+ output_address (VOIDmode, XEXP (x, 0));
fprintf (file, "--");
break;
void
print_operand (FILE *file, rtx x, char code)
{
- enum machine_mode mode;
+ machine_mode mode;
if (code == '!')
{
(TYPE is null for libcalls where that information may not be available.) */
static void
-bfin_function_arg_advance (cumulative_args_t cum_v, enum machine_mode mode,
+bfin_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
const_tree type, bool named ATTRIBUTE_UNUSED)
{
CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
(otherwise it is an extra parameter matching an ellipsis). */
static rtx
-bfin_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
+bfin_function_arg (cumulative_args_t cum_v, machine_mode mode,
const_tree type, bool named ATTRIBUTE_UNUSED)
{
CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
stack. */
static int
-bfin_arg_partial_bytes (cumulative_args_t cum, enum machine_mode mode,
+bfin_arg_partial_bytes (cumulative_args_t cum, machine_mode mode,
tree type ATTRIBUTE_UNUSED,
bool named ATTRIBUTE_UNUSED)
{
static bool
bfin_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED,
- enum machine_mode mode ATTRIBUTE_UNUSED,
+ machine_mode mode ATTRIBUTE_UNUSED,
const_tree type, bool named ATTRIBUTE_UNUSED)
{
return type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST;
/* Not enough information. */
return false;
- this_func = cgraph_local_info (current_function_decl);
- called_func = cgraph_local_info (decl);
+ this_func = cgraph_node::local_info (current_function_decl);
+ called_func = cgraph_node::local_info (decl);
if (!called_func)
return false;
return !called_func->local || this_func->local;
/* Emit insns to move operands[1] into operands[0]. */
void
-emit_pic_move (rtx *operands, enum machine_mode mode ATTRIBUTE_UNUSED)
+emit_pic_move (rtx *operands, machine_mode mode ATTRIBUTE_UNUSED)
{
rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
should generate an insn to move OPERANDS[1] to OPERANDS[0]. */
bool
-expand_move (rtx *operands, enum machine_mode mode)
+expand_move (rtx *operands, machine_mode mode)
{
rtx op = operands[1];
if ((TARGET_ID_SHARED_LIBRARY || TARGET_FDPIC)
call = gen_rtx_CALL (VOIDmode, fnaddr, callarg1);
if (retval)
- call = gen_rtx_SET (VOIDmode, retval, call);
+ call = gen_rtx_SET (retval, call);
pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (nelts));
n = 0;
CALL_INSN_FUNCTION_USAGE (call) = use;
}
\f
-/* Return 1 if hard register REGNO can hold a value of machine-mode MODE. */
+/* Implement TARGET_HARD_REGNO_NREGS. */
-int
-hard_regno_mode_ok (int regno, enum machine_mode mode)
+static unsigned int
+bfin_hard_regno_nregs (unsigned int regno, machine_mode mode)
+{
+ if (mode == PDImode && (regno == REG_A0 || regno == REG_A1))
+ return 1;
+ if (mode == V2PDImode && (regno == REG_A0 || regno == REG_A1))
+ return 2;
+ return CLASS_MAX_NREGS (GENERAL_REGS, mode);
+}
+
+/* Implement TARGET_HARD_REGNO_MODE_OK.
+
+ Do not allow to store a value in REG_CC for any mode.
+ Do not allow to store value in pregs if mode is not SI. */
+static bool
+bfin_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
{
/* Allow only dregs to store value of mode HI or QI */
enum reg_class rclass = REGNO_REG_CLASS (regno);
if (mode == CCmode)
- return 0;
+ return false;
if (mode == V2HImode)
return D_REGNO_P (regno);
if (mode == SImode
&& TEST_HARD_REG_BIT (reg_class_contents[PROLOGUE_REGS], regno))
- return 1;
+ return true;
return TEST_HARD_REG_BIT (reg_class_contents[MOST_REGS], regno);
}
+/* Implement TARGET_MODES_TIEABLE_P. */
+
+static bool
+bfin_modes_tieable_p (machine_mode mode1, machine_mode mode2)
+{
+ return (mode1 == mode2
+ || ((GET_MODE_CLASS (mode1) == MODE_INT
+ || GET_MODE_CLASS (mode1) == MODE_FLOAT)
+ && (GET_MODE_CLASS (mode2) == MODE_INT
+ || GET_MODE_CLASS (mode2) == MODE_FLOAT)
+ && mode1 != BImode && mode2 != BImode
+ && GET_MODE_SIZE (mode1) <= UNITS_PER_WORD
+ && GET_MODE_SIZE (mode2) <= UNITS_PER_WORD));
+}
+
/* Implements target hook vector_mode_supported_p. */
static bool
-bfin_vector_mode_supported_p (enum machine_mode mode)
+bfin_vector_mode_supported_p (machine_mode mode)
{
return mode == V2HImode;
}
/* Worker function for TARGET_REGISTER_MOVE_COST. */
static int
-bfin_register_move_cost (enum machine_mode mode,
+bfin_register_move_cost (machine_mode mode,
reg_class_t class1, reg_class_t class2)
{
/* These need secondary reloads, so they're more expensive. */
program; it'll make the costs more accurate. */
static int
-bfin_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+bfin_memory_move_cost (machine_mode mode ATTRIBUTE_UNUSED,
reg_class_t rclass,
bool in ATTRIBUTE_UNUSED)
{
static reg_class_t
bfin_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
- enum machine_mode mode, secondary_reload_info *sri)
+ machine_mode mode, secondary_reload_info *sri)
{
/* If we have HImode or QImode, we can only use DREGS as secondary registers;
in most other cases we can also use PREGS. */
static struct machine_function *
bfin_init_machine_status (void)
{
- return ggc_alloc_cleared_machine_function ();
+ return ggc_cleared_alloc<machine_function> ();
}
/* Implement the TARGET_OPTION_OVERRIDE hook. */
#ifdef SUBTARGET_FDPIC_NOT_SUPPORTED
if (TARGET_FDPIC)
- error ("-mfdpic is not supported, please use a bfin-linux-uclibc target");
+ error ("%<-mfdpic%> is not supported, please use a bfin-linux-uclibc "
+ "target");
#endif
/* Library identification */
if (global_options_set.x_bfin_library_id && ! TARGET_ID_SHARED_LIBRARY)
- error ("-mshared-library-id= specified without -mid-shared-library");
+ error ("%<-mshared-library-id=%> specified without "
+ "%<-mid-shared-library%>");
if (stack_limit_rtx && TARGET_FDPIC)
{
- warning (0, "-fstack-limit- options are ignored with -mfdpic; use -mstack-check-l1");
+ warning (0, "%<-fstack-limit-%> options are ignored with %<-mfdpic%>; "
+ "use %<-mstack-check-l1%>");
stack_limit_rtx = NULL_RTX;
}
/* Don't allow the user to specify -mid-shared-library and -msep-data
together, as it makes little sense from a user's point of view... */
if (TARGET_SEP_DATA && TARGET_ID_SHARED_LIBRARY)
- error ("cannot specify both -msep-data and -mid-shared-library");
+ error ("cannot specify both %<-msep-data%> and %<-mid-shared-library%>");
/* ... internally, however, it's nearly the same. */
if (TARGET_SEP_DATA)
target_flags |= MASK_ID_SHARED_LIBRARY | MASK_LEAF_ID_SHARED_LIBRARY;
flag_pic = 0;
if (TARGET_MULTICORE && bfin_cpu_type != BFIN_CPU_BF561)
- error ("-mmulticore can only be used with BF561");
+ error ("%<-mmulticore%> can only be used with BF561");
if (TARGET_COREA && !TARGET_MULTICORE)
- error ("-mcorea should be used with -mmulticore");
+ error ("%<-mcorea%> should be used with %<-mmulticore%>");
if (TARGET_COREB && !TARGET_MULTICORE)
- error ("-mcoreb should be used with -mmulticore");
+ error ("%<-mcoreb%> should be used with %<-mmulticore%>");
if (TARGET_COREA && TARGET_COREB)
- error ("-mcorea and -mcoreb can%'t be used together");
+ error ("%<-mcorea%> and %<-mcoreb%> can%'t be used together");
flag_schedule_insns = 0;
we still prefer to use shorter sequences. */
static int
-branch_dest (rtx branch)
+branch_dest (rtx_insn *branch)
{
rtx dest;
int dest_uid;
if (x)
{
- int pred_val = XINT (x, 0);
-
- return pred_val >= REG_BR_PROB_BASE / 2;
+ return profile_probability::from_reg_br_prob_note (XINT (x, 0))
+ >= profile_probability::even ();
}
return 0;
anyway. */
void
-asm_conditional_branch (rtx insn, rtx *operands, int n_nops, int predict_taken)
+asm_conditional_branch (rtx_insn *insn, rtx *operands, int n_nops, int predict_taken)
{
int offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn));
/* Note : offset for instructions like if cc jmp; jump.[sl] offset
stored in bfin_compare_op0 and bfin_compare_op1 already. */
rtx
-bfin_gen_compare (rtx cmp, enum machine_mode mode ATTRIBUTE_UNUSED)
+bfin_gen_compare (rtx cmp, machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code1, code2;
rtx op0 = XEXP (cmp, 0), op1 = XEXP (cmp, 1);
code2 = EQ;
break;
}
- emit_insn (gen_rtx_SET (VOIDmode, tem,
- gen_rtx_fmt_ee (code1, BImode, op0, op1)));
+ emit_insn (gen_rtx_SET (tem, gen_rtx_fmt_ee (code1, BImode, op0, op1)));
}
return gen_rtx_fmt_ee (code2, BImode, tem, CONST0_RTX (BImode));
&& (D_REGNO_P (regno)
|| (regno >= REG_P0 && regno <= REG_P7 && num_zero <= 2)))
{
- emit_insn (gen_movsi (operands[0], GEN_INT (shifted)));
+ emit_insn (gen_movsi (operands[0], gen_int_mode (shifted, SImode)));
emit_insn (gen_ashlsi3 (operands[0], operands[0], GEN_INT (num_zero)));
return 1;
}
if (log2constp (val & 0xFFFF0000))
{
emit_insn (gen_movsi (operands[0], GEN_INT (val & 0xFFFF)));
- emit_insn (gen_iorsi3 (operands[0], operands[0], GEN_INT (val & 0xFFFF0000)));
+ emit_insn (gen_iorsi3 (operands[0], operands[0],
+ gen_int_mode (val & 0xFFFF0000, SImode)));
return 1;
}
else if (log2constp (val | 0xFFFF) && (val & 0x8000) != 0)
{
emit_insn (gen_movsi (operands[0], GEN_INT (tmp)));
- emit_insn (gen_andsi3 (operands[0], operands[0], GEN_INT (val | 0xFFFF)));
+ emit_insn (gen_andsi3 (operands[0], operands[0],
+ gen_int_mode (val | 0xFFFF, SImode)));
}
}
if (tmp >= -64 && tmp <= 63)
{
emit_insn (gen_movsi (operands[0], GEN_INT (tmp)));
- emit_insn (gen_movstricthi_high (operands[0], GEN_INT (val & -65536)));
+ emit_insn (gen_movstricthi_high (operands[0],
+ gen_int_mode (val & -65536,
+ SImode)));
return 1;
}
{
/* If optimizing for size, generate a sequence that has more instructions
but is shorter. */
- emit_insn (gen_movsi (operands[0], GEN_INT (shifted_compl)));
+ emit_insn (gen_movsi (operands[0], gen_int_mode (shifted_compl, SImode)));
emit_insn (gen_ashlsi3 (operands[0], operands[0],
GEN_INT (num_compl_zero)));
emit_insn (gen_one_cmplsi2 (operands[0], operands[0]));
MODE. Return false if not. */
static bool
-bfin_valid_add (enum machine_mode mode, HOST_WIDE_INT value)
+bfin_valid_add (machine_mode mode, HOST_WIDE_INT value)
{
unsigned HOST_WIDE_INT v = value > 0 ? value : -value;
int sz = GET_MODE_SIZE (mode);
}
static bool
-bfin_valid_reg_p (unsigned int regno, int strict, enum machine_mode mode,
+bfin_valid_reg_p (unsigned int regno, int strict, machine_mode mode,
enum rtx_code outer_code)
{
if (strict)
*/
static bool
-bfin_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
+bfin_legitimate_address_p (machine_mode mode, rtx x, bool strict)
{
switch (GET_CODE (x)) {
case REG:
&& REG_P (XEXP (x, 0))
&& bfin_valid_reg_p (REGNO (XEXP (x, 0)), strict, mode, POST_INC))
return true;
+ break;
case PRE_DEC:
if (LEGITIMATE_MODE_FOR_AUTOINC_P (mode)
&& XEXP (x, 0) == stack_pointer_rtx
another way. */
static bool
-bfin_cannot_force_const_mem (enum machine_mode mode ATTRIBUTE_UNUSED,
+bfin_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED,
rtx x ATTRIBUTE_UNUSED)
{
/* We have only one class of non-legitimate constants, and our movsi
crossing section boundaries. */
static bool
-bfin_legitimate_constant_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
+bfin_legitimate_constant_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
{
rtx sym;
HOST_WIDE_INT offset;
}
static bool
-bfin_rtx_costs (rtx x, int code_i, int outer_code_i, int opno, int *total,
- bool speed)
+bfin_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno,
+ int *total, bool speed)
{
- enum rtx_code code = (enum rtx_code) code_i;
+ enum rtx_code code = GET_CODE (x);
enum rtx_code outer_code = (enum rtx_code) outer_code_i;
int cost2 = COSTS_N_INSNS (1);
rtx op0, op1;
case PLUS:
op0 = XEXP (x, 0);
op1 = XEXP (x, 1);
- if (GET_MODE (x) == SImode)
+ if (mode == SImode)
{
if (GET_CODE (op0) == MULT
&& GET_CODE (XEXP (op0, 1)) == CONST_INT)
if (val == 2 || val == 4)
{
*total = cost2;
- *total += rtx_cost (XEXP (op0, 0), outer_code, opno, speed);
- *total += rtx_cost (op1, outer_code, opno, speed);
+ *total += rtx_cost (XEXP (op0, 0), mode, outer_code,
+ opno, speed);
+ *total += rtx_cost (op1, mode, outer_code, opno, speed);
return true;
}
}
*total = cost2;
if (GET_CODE (op0) != REG
&& (GET_CODE (op0) != SUBREG || GET_CODE (SUBREG_REG (op0)) != REG))
- *total += set_src_cost (op0, speed);
+ *total += set_src_cost (op0, mode, speed);
#if 0 /* We'd like to do this for accuracy, but it biases the loop optimizer
towards creating too many induction variables. */
if (!reg_or_7bit_operand (op1, SImode))
- *total += set_src_cost (op1, speed);
+ *total += set_src_cost (op1, mode, speed);
#endif
}
- else if (GET_MODE (x) == DImode)
+ else if (mode == DImode)
{
*total = 6 * cost2;
if (GET_CODE (op1) != CONST_INT
|| !satisfies_constraint_Ks7 (op1))
- *total += rtx_cost (op1, PLUS, 1, speed);
+ *total += rtx_cost (op1, mode, PLUS, 1, speed);
if (GET_CODE (op0) != REG
&& (GET_CODE (op0) != SUBREG || GET_CODE (SUBREG_REG (op0)) != REG))
- *total += rtx_cost (op0, PLUS, 0, speed);
+ *total += rtx_cost (op0, mode, PLUS, 0, speed);
}
return true;
case MINUS:
- if (GET_MODE (x) == DImode)
+ if (mode == DImode)
*total = 6 * cost2;
else
*total = cost2;
case ASHIFT:
case ASHIFTRT:
case LSHIFTRT:
- if (GET_MODE (x) == DImode)
+ if (mode == DImode)
*total = 6 * cost2;
else
*total = cost2;
op1 = XEXP (x, 1);
if (GET_CODE (op0) != REG
&& (GET_CODE (op0) != SUBREG || GET_CODE (SUBREG_REG (op0)) != REG))
- *total += rtx_cost (op0, code, 0, speed);
+ *total += rtx_cost (op0, mode, code, 0, speed);
return true;
if (GET_CODE (op0) != REG
&& (GET_CODE (op0) != SUBREG || GET_CODE (SUBREG_REG (op0)) != REG))
- *total += rtx_cost (op0, code, 0, speed);
+ *total += rtx_cost (op0, mode, code, 0, speed);
- if (GET_MODE (x) == DImode)
+ if (mode == DImode)
{
*total = 2 * cost2;
return true;
}
*total = cost2;
- if (GET_MODE (x) != SImode)
+ if (mode != SImode)
return true;
if (code == AND)
{
if (! rhs_andsi3_operand (XEXP (x, 1), SImode))
- *total += rtx_cost (XEXP (x, 1), code, 1, speed);
+ *total += rtx_cost (XEXP (x, 1), mode, code, 1, speed);
}
else
{
if (! regorlog2_operand (XEXP (x, 1), SImode))
- *total += rtx_cost (XEXP (x, 1), code, 1, speed);
+ *total += rtx_cost (XEXP (x, 1), mode, code, 1, speed);
}
return true;
if (GET_CODE (op0) != REG
&& (GET_CODE (op0) != SUBREG || GET_CODE (SUBREG_REG (op0)) != REG))
- *total += rtx_cost (op0, MULT, 0, speed);
+ *total += rtx_cost (op0, mode, MULT, 0, speed);
if (GET_CODE (op1) != REG
&& (GET_CODE (op1) != SUBREG || GET_CODE (SUBREG_REG (op1)) != REG))
- *total += rtx_cost (op1, MULT, 1, speed);
+ *total += rtx_cost (op1, mode, MULT, 1, speed);
}
return true;
/* Adjust DST and SRC by OFFSET bytes, and generate one move in mode MODE. */
static void
-single_move_for_movmem (rtx dst, rtx src, enum machine_mode mode, HOST_WIDE_INT offset)
+single_move_for_movmem (rtx dst, rtx src, machine_mode mode, HOST_WIDE_INT offset)
{
rtx scratch = gen_reg_rtx (mode);
rtx srcmem, dstmem;
memcpy can use 32 bit loads/stores. */
if (TYPE_SIZE (type)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && wi::gtu_p (TYPE_SIZE (type), 8)
+ && wi::gtu_p (wi::to_wide (TYPE_SIZE (type)), 8)
&& align < 32)
return 32;
return align;
}
static int
-bfin_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
+bfin_adjust_cost (rtx_insn *insn, int dep_type, rtx_insn *dep_insn, int cost,
+ unsigned int)
{
enum attr_type dep_insn_type;
int dep_insn_code_number;
/* Anti and output dependencies have zero cost. */
- if (REG_NOTE_KIND (link) != 0)
+ if (dep_type != 0)
return 0;
dep_insn_code_number = recog_memoized (dep_insn);
/* This function acts like NEXT_INSN, but is aware of three-insn bundles and
skips all subsequent parallel instructions if INSN is the start of such
a group. */
-static rtx
-find_next_insn_start (rtx insn)
+static rtx_insn *
+find_next_insn_start (rtx_insn *insn)
{
if (GET_MODE (insn) == SImode)
{
/* This function acts like PREV_INSN, but is aware of three-insn bundles and
skips all subsequent parallel instructions if INSN is the start of such
a group. */
-static rtx
-find_prev_insn_start (rtx insn)
+static rtx_insn *
+find_prev_insn_start (rtx_insn *insn)
{
insn = PREV_INSN (insn);
gcc_assert (GET_MODE (insn) != SImode);
/* Due to limitations in the hardware (an initial loop count of 0
does not loop 2^32 times) we must avoid to generate a hardware
loops when we cannot rule out this case. */
- if (!flag_unsafe_loop_optimizations
- && wi::geu_p (iterations_max, 0xFFFFFFFF))
- return false;
- return true;
+ return (wi::ltu_p (iterations_max, 0xFFFFFFFF));
}
/* Increment the counter for the number of loop instructions in the
/* Estimate the length of INSN conservatively. */
static int
-length_for_loop (rtx insn)
+length_for_loop (rtx_insn *insn)
{
int length = 0;
if (JUMP_P (insn) && any_condjump_p (insn) && !optimize_size)
hwloop_optimize (hwloop_info loop)
{
basic_block bb;
- rtx insn, last_insn;
+ rtx_insn *insn, *last_insn;
rtx loop_init, start_label, end_label;
- rtx iter_reg, scratchreg, scratch_init, scratch_init_insn;
+ rtx iter_reg, scratchreg, scratch_init;
+ rtx_insn *scratch_init_insn;
rtx lc_reg, lt_reg, lb_reg;
- rtx seq, seq_end;
+ rtx seq_end;
+ rtx_insn *seq;
int length;
bool clobber0, clobber1;
scratchreg = NULL_RTX;
scratch_init = iter_reg;
- scratch_init_insn = NULL_RTX;
+ scratch_init_insn = NULL;
if (!PREG_P (iter_reg) && loop->incoming_src)
{
basic_block bb_in = loop->incoming_src;
}
else
{
- last_insn = NULL_RTX;
+ last_insn = NULL;
break;
}
}
point. */
if (!loop->incoming_src && loop->head != loop->incoming_dest)
{
- rtx label = BB_HEAD (loop->incoming_dest);
+ rtx_insn *label = BB_HEAD (loop->incoming_dest);
/* If we're jumping to the final basic block in the loop, and there's
only one cheap instruction before the end (typically an increment of
an induction variable), we can just emit a copy here instead of a
}
else
{
- emit_jump_insn (gen_jump (label));
+ rtx_insn *ret = emit_jump_insn (gen_jump (label));
+ JUMP_LABEL (ret) = label;
+ LABEL_NUSES (label)++;
seq_end = emit_barrier ();
}
}
if (loop->incoming_src)
{
- rtx prev = BB_END (loop->incoming_src);
+ rtx_insn *prev = BB_END (loop->incoming_src);
if (vec_safe_length (loop->incoming) > 1
|| !(loop->incoming->last ()->flags & EDGE_FALLTHRU))
{
gcc_assert (JUMP_P (prev));
prev = PREV_INSN (prev);
+ emit_insn_after (seq, prev);
+ }
+ else
+ {
+ emit_insn_after (seq, prev);
+ BB_END (loop->incoming_src) = prev;
+ basic_block new_bb = create_basic_block (seq, seq_end,
+ loop->head->prev_bb);
+ edge e = loop->incoming->last ();
+ gcc_assert (e->flags & EDGE_FALLTHRU);
+ redirect_edge_succ (e, new_bb);
+ make_edge (new_bb, loop->head, 0);
}
- emit_insn_after (seq, prev);
}
else
{
edge e;
edge_iterator ei;
-#ifdef ENABLE_CHECKING
- if (loop->head != loop->incoming_dest)
+ if (flag_checking && loop->head != loop->incoming_dest)
{
/* We aren't entering the loop at the top. Since we've established
that the loop is entered only at one point, this means there
FOR_EACH_EDGE (e, ei, loop->head->preds)
gcc_assert (!(e->flags & EDGE_FALLTHRU));
}
-#endif
emit_insn_before (seq, BB_HEAD (loop->head));
seq = emit_label_before (gen_label_rtx (), seq);
delete_insn (loop->loop_end);
/* Insert the loop end label before the last instruction of the loop. */
- emit_label_before (loop->end_label, loop->last_insn);
+ emit_label_before (as_a <rtx_code_label *> (loop->end_label),
+ loop->last_insn);
return true;
}
else
{
splitting_loops = 1;
- try_split (PATTERN (insn), insn, 1);
+ try_split (PATTERN (insn), safe_as_a <rtx_insn *> (insn), 1);
splitting_loops = 0;
}
}
loop counter. Otherwise, return NULL_RTX. */
static rtx
-hwloop_pattern_reg (rtx insn)
+hwloop_pattern_reg (rtx_insn *insn)
{
rtx reg;
/* Possibly generate a SEQUENCE out of three insns found in SLOT.
Returns true if we modified the insn chain, false otherwise. */
static bool
-gen_one_bundle (rtx slot[3])
+gen_one_bundle (rtx_insn *slot[3])
{
gcc_assert (slot[1] != NULL_RTX);
/* Verify that we really can do the multi-issue. */
if (slot[0])
{
- rtx t = NEXT_INSN (slot[0]);
+ rtx_insn *t = NEXT_INSN (slot[0]);
while (t != slot[1])
{
if (! NOTE_P (t) || NOTE_KIND (t) != NOTE_INSN_DELETED)
}
if (slot[2])
{
- rtx t = NEXT_INSN (slot[1]);
+ rtx_insn *t = NEXT_INSN (slot[1]);
while (t != slot[2])
{
if (! NOTE_P (t) || NOTE_KIND (t) != NOTE_INSN_DELETED)
bfin_gen_bundles (void)
{
basic_block bb;
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
{
- rtx insn, next;
- rtx slot[3];
+ rtx_insn *insn, *next;
+ rtx_insn *slot[3];
int n_filled = 0;
- slot[0] = slot[1] = slot[2] = NULL_RTX;
+ slot[0] = slot[1] = slot[2] = NULL;
for (insn = BB_HEAD (bb);; insn = next)
{
int at_end;
- rtx delete_this = NULL_RTX;
+ rtx_insn *delete_this = NULL;
if (NONDEBUG_INSN_P (insn))
{
}
}
n_filled = 0;
- slot[0] = slot[1] = slot[2] = NULL_RTX;
+ slot[0] = slot[1] = slot[2] = NULL;
}
if (delete_this != NULL_RTX)
delete_insn (delete_this);
reorder_var_tracking_notes (void)
{
basic_block bb;
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
{
- rtx insn, next;
- rtx queue = NULL_RTX;
+ rtx_insn *insn, *next;
+ rtx_insn *queue = NULL;
bool in_bundle = false;
for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = next)
{
while (queue)
{
- rtx next_queue = PREV_INSN (queue);
- PREV_INSN (NEXT_INSN (insn)) = queue;
- NEXT_INSN (queue) = NEXT_INSN (insn);
- NEXT_INSN (insn) = queue;
- PREV_INSN (queue) = insn;
+ rtx_insn *next_queue = PREV_INSN (queue);
+ SET_PREV_INSN (NEXT_INSN (insn)) = queue;
+ SET_NEXT_INSN (queue) = NEXT_INSN (insn);
+ SET_NEXT_INSN (insn) = queue;
+ SET_PREV_INSN (queue) = insn;
queue = next_queue;
}
in_bundle = false;
{
if (in_bundle)
{
- rtx prev = PREV_INSN (insn);
- PREV_INSN (next) = prev;
- NEXT_INSN (prev) = next;
+ rtx_insn *prev = PREV_INSN (insn);
+ SET_PREV_INSN (next) = prev;
+ SET_NEXT_INSN (prev) = next;
- PREV_INSN (insn) = queue;
+ SET_PREV_INSN (insn) = queue;
queue = insn;
}
}
}
\f
/* On some silicon revisions, functions shorter than a certain number of cycles
- can cause unpredictable behaviour. Work around this by adding NOPs as
+ can cause unpredictable behavior. Work around this by adding NOPs as
needed. */
static void
workaround_rts_anomaly (void)
{
- rtx insn, first_insn = NULL_RTX;
+ rtx_insn *insn, *first_insn = NULL;
int cycles = 4;
if (! ENABLE_WA_RETS)
SEQUENCEs. */
static enum attr_type
-type_for_anomaly (rtx insn)
+type_for_anomaly (rtx_insn *insn)
{
rtx pat = PATTERN (insn);
- if (GET_CODE (pat) == SEQUENCE)
+ if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (pat))
{
enum attr_type t;
- t = get_attr_type (XVECEXP (pat, 0, 1));
+ t = get_attr_type (seq->insn (1));
if (t == TYPE_MCLD)
return t;
- t = get_attr_type (XVECEXP (pat, 0, 2));
+ t = get_attr_type (seq->insn (2));
if (t == TYPE_MCLD)
return t;
return TYPE_MCST;
/* Return nonzero if INSN contains any loads that may trap. */
static bool
-trapping_loads_p (rtx insn, int np_reg, bool after_np_branch)
+trapping_loads_p (rtx_insn *insn, int np_reg, bool after_np_branch)
{
rtx mem = SET_SRC (single_set (insn));
/* Return INSN if it is of TYPE_MCLD. Alternatively, if INSN is the start of
a three-insn bundle, see if one of them is a load and return that if so.
- Return NULL_RTX if the insn does not contain loads. */
-static rtx
-find_load (rtx insn)
+ Return NULL if the insn does not contain loads. */
+static rtx_insn *
+find_load (rtx_insn *insn)
{
if (!NONDEBUG_INSN_P (insn))
- return NULL_RTX;
+ return NULL;
if (get_attr_type (insn) == TYPE_MCLD)
return insn;
if (GET_MODE (insn) != SImode)
- return NULL_RTX;
+ return NULL;
do {
insn = NEXT_INSN (insn);
if ((GET_MODE (insn) == SImode || GET_MODE (insn) == QImode)
&& get_attr_type (insn) == TYPE_MCLD)
return insn;
} while (GET_MODE (insn) != QImode);
- return NULL_RTX;
+ return NULL;
}
/* Determine whether PAT is an indirect call pattern. */
static void
workaround_speculation (void)
{
- rtx insn, next;
- rtx last_condjump = NULL_RTX;
+ rtx_insn *insn, *next;
+ rtx_insn *last_condjump = NULL;
int cycles_since_jump = INT_MAX;
int delay_added = 0;
}
else if (NONDEBUG_INSN_P (insn))
{
- rtx load_insn = find_load (insn);
+ rtx_insn *load_insn = find_load (insn);
enum attr_type type = type_for_anomaly (insn);
if (cycles_since_jump < INT_MAX)
&& (INSN_CODE (insn) == CODE_FOR_cbranch_predicted_taken
|| cbranch_predicted_taken_p (insn)))
{
- rtx target = JUMP_LABEL (insn);
- rtx label = target;
- rtx next_tgt;
+ rtx_insn *target = JUMP_LABEL_AS_INSN (insn);
+ rtx_insn *label = target;
+ rtx_insn *next_tgt;
cycles_since_jump = 0;
for (; target && cycles_since_jump < 3; target = next_tgt)
if (NONDEBUG_INSN_P (target))
{
- rtx load_insn = find_load (target);
+ rtx_insn *load_insn = find_load (target);
enum attr_type type = type_for_anomaly (target);
int delay_needed = 0;
if (cycles_since_jump < INT_MAX)
if (delay_needed > cycles_since_jump)
{
- rtx prev = prev_real_insn (label);
+ rtx_insn *prev = prev_real_insn (label);
delay_needed -= cycles_since_jump;
if (dump_file)
fprintf (dump_file, "Adding %d nops after %d\n",
static void
add_sched_insns_for_speculation (void)
{
- rtx insn;
+ rtx_insn *insn;
if (! ENABLE_WA_SPECULATIVE_LOADS && ! ENABLE_WA_SPECULATIVE_SYNCS
&& ! ENABLE_WA_INDIRECT_CALLS)
if (any_condjump_p (insn)
&& !cbranch_predicted_taken_p (insn))
{
- rtx n = next_real_insn (insn);
+ rtx_insn *n = next_real_insn (insn);
emit_insn_before (gen_stall (GEN_INT (3)), n);
}
}
&& any_condjump_p (insn)
&& (cbranch_predicted_taken_p (insn)))
{
- rtx target = JUMP_LABEL (insn);
- rtx next = next_real_insn (target);
+ rtx_insn *target = JUMP_LABEL_AS_INSN (insn);
+ rtx_insn *next = next_real_insn (target);
if (GET_CODE (PATTERN (next)) == UNSPEC_VOLATILE
&& get_attr_type (next) == TYPE_STALL)
/* The decl may have already been given a section attribute
from a previous declaration. Ensure they match. */
- else if (DECL_SECTION_NAME (decl) != NULL_TREE
- && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+ else if (DECL_SECTION_NAME (decl) != NULL
+ && strcmp (DECL_SECTION_NAME (decl),
".l1.text") != 0)
{
error ("section of %q+D conflicts with previous declaration",
*no_add_attrs = true;
}
else
- DECL_SECTION_NAME (decl) = build_string (9, ".l1.text");
+ set_decl_section_name (decl, ".l1.text");
return NULL_TREE;
}
/* The decl may have already been given a section attribute
from a previous declaration. Ensure they match. */
- if (DECL_SECTION_NAME (decl) != NULL_TREE
- && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+ if (DECL_SECTION_NAME (decl) != NULL
+ && strcmp (DECL_SECTION_NAME (decl),
section_name) != 0)
{
error ("section of %q+D conflicts with previous declaration",
*no_add_attrs = true;
}
else
- DECL_SECTION_NAME (decl)
- = build_string (strlen (section_name) + 1, section_name);
+ set_decl_section_name (decl, section_name);
}
return NULL_TREE;
if (TREE_CODE (decl) == FUNCTION_DECL)
{
- if (DECL_SECTION_NAME (decl) != NULL_TREE
- && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+ if (DECL_SECTION_NAME (decl) != NULL
+ && strcmp (DECL_SECTION_NAME (decl),
".l2.text") != 0)
{
error ("section of %q+D conflicts with previous declaration",
*no_add_attrs = true;
}
else
- DECL_SECTION_NAME (decl) = build_string (9, ".l2.text");
+ set_decl_section_name (decl, ".l2.text");
}
else if (TREE_CODE (decl) == VAR_DECL)
{
- if (DECL_SECTION_NAME (decl) != NULL_TREE
- && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+ if (DECL_SECTION_NAME (decl) != NULL
+ && strcmp (DECL_SECTION_NAME (decl),
".l2.data") != 0)
{
error ("section of %q+D conflicts with previous declaration",
*no_add_attrs = true;
}
else
- DECL_SECTION_NAME (decl) = build_string (9, ".l2.data");
+ set_decl_section_name (decl, ".l2.data");
}
return NULL_TREE;
/* Table of valid machine attributes. */
static const struct attribute_spec bfin_attribute_table[] =
{
- /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
- affects_type_identity } */
- { "interrupt_handler", 0, 0, false, true, true, handle_int_attribute,
- false },
- { "exception_handler", 0, 0, false, true, true, handle_int_attribute,
- false },
- { "nmi_handler", 0, 0, false, true, true, handle_int_attribute, false },
- { "nesting", 0, 0, false, true, true, NULL, false },
- { "kspisusp", 0, 0, false, true, true, NULL, false },
- { "saveall", 0, 0, false, true, true, NULL, false },
- { "longcall", 0, 0, false, true, true, bfin_handle_longcall_attribute,
- false },
- { "shortcall", 0, 0, false, true, true, bfin_handle_longcall_attribute,
- false },
- { "l1_text", 0, 0, true, false, false, bfin_handle_l1_text_attribute,
- false },
- { "l1_data", 0, 0, true, false, false, bfin_handle_l1_data_attribute,
- false },
- { "l1_data_A", 0, 0, true, false, false, bfin_handle_l1_data_attribute,
- false },
- { "l1_data_B", 0, 0, true, false, false, bfin_handle_l1_data_attribute,
- false },
- { "l2", 0, 0, true, false, false, bfin_handle_l2_attribute, false },
- { NULL, 0, 0, false, false, false, NULL, false }
+ /* { name, min_len, max_len, decl_req, type_req, fn_type_req,
+ affects_type_identity, handler, exclude } */
+ { "interrupt_handler", 0, 0, false, true, true, false,
+ handle_int_attribute, NULL },
+ { "exception_handler", 0, 0, false, true, true, false,
+ handle_int_attribute, NULL },
+ { "nmi_handler", 0, 0, false, true, true, false, handle_int_attribute,
+ NULL },
+ { "nesting", 0, 0, false, true, true, false, NULL, NULL },
+ { "kspisusp", 0, 0, false, true, true, false, NULL, NULL },
+ { "saveall", 0, 0, false, true, true, false, NULL, NULL },
+ { "longcall", 0, 0, false, true, true, false,
+ bfin_handle_longcall_attribute, NULL },
+ { "shortcall", 0, 0, false, true, true, false,
+ bfin_handle_longcall_attribute, NULL },
+ { "l1_text", 0, 0, true, false, false, false,
+ bfin_handle_l1_text_attribute, NULL },
+ { "l1_data", 0, 0, true, false, false, false,
+ bfin_handle_l1_data_attribute, NULL },
+ { "l1_data_A", 0, 0, true, false, false, false,
+ bfin_handle_l1_data_attribute, NULL },
+ { "l1_data_B", 0, 0, true, false, false, false,
+ bfin_handle_l1_data_attribute, NULL },
+ { "l2", 0, 0, true, false, false, false, bfin_handle_l2_attribute, NULL },
+ { NULL, 0, 0, false, false, false, false, NULL, NULL }
};
\f
/* Implementation of TARGET_ASM_INTEGER. When using FD-PIC, we need to
where we expect a vector. To avoid crashing, use one of the vector
clear instructions. */
static rtx
-safe_vector_operand (rtx x, enum machine_mode mode)
+safe_vector_operand (rtx x, machine_mode mode)
{
if (x != const0_rtx)
return x;
tree arg1 = CALL_EXPR_ARG (exp, 1);
rtx op0 = expand_normal (arg0);
rtx op1 = expand_normal (arg1);
- enum machine_mode op0mode = GET_MODE (op0);
- enum machine_mode op1mode = GET_MODE (op1);
- enum machine_mode tmode = insn_data[icode].operand[0].mode;
- enum machine_mode mode0 = insn_data[icode].operand[1].mode;
- enum machine_mode mode1 = insn_data[icode].operand[2].mode;
+ machine_mode op0mode = GET_MODE (op0);
+ machine_mode op1mode = GET_MODE (op1);
+ machine_mode tmode = insn_data[icode].operand[0].mode;
+ machine_mode mode0 = insn_data[icode].operand[1].mode;
+ machine_mode mode1 = insn_data[icode].operand[2].mode;
if (VECTOR_MODE_P (mode0))
op0 = safe_vector_operand (op0, mode0);
rtx pat;
tree arg0 = CALL_EXPR_ARG (exp, 0);
rtx op0 = expand_normal (arg0);
- enum machine_mode op0mode = GET_MODE (op0);
- enum machine_mode tmode = insn_data[icode].operand[0].mode;
- enum machine_mode mode0 = insn_data[icode].operand[1].mode;
+ machine_mode op0mode = GET_MODE (op0);
+ machine_mode tmode = insn_data[icode].operand[0].mode;
+ machine_mode mode0 = insn_data[icode].operand[1].mode;
if (! target
|| GET_MODE (target) != tmode
static rtx
bfin_expand_builtin (tree exp, rtx target ATTRIBUTE_UNUSED,
rtx subtarget ATTRIBUTE_UNUSED,
- enum machine_mode mode ATTRIBUTE_UNUSED,
+ machine_mode mode ATTRIBUTE_UNUSED,
int ignore ATTRIBUTE_UNUSED)
{
size_t i;
unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
tree arg0, arg1, arg2;
rtx op0, op1, op2, accvec, pat, tmp1, tmp2, a0reg, a1reg;
- enum machine_mode tmode, mode0;
+ machine_mode tmode, mode0;
switch (fcode)
{
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY bfin_return_in_memory
+#undef TARGET_LRA_P
+#define TARGET_LRA_P hook_bool_void_false
+
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P bfin_legitimate_address_p
#undef TARGET_CAN_USE_DOLOOP_P
#define TARGET_CAN_USE_DOLOOP_P bfin_can_use_doloop_p
+#undef TARGET_HARD_REGNO_NREGS
+#define TARGET_HARD_REGNO_NREGS bfin_hard_regno_nregs
+#undef TARGET_HARD_REGNO_MODE_OK
+#define TARGET_HARD_REGNO_MODE_OK bfin_hard_regno_mode_ok
+
+#undef TARGET_MODES_TIEABLE_P
+#define TARGET_MODES_TIEABLE_P bfin_modes_tieable_p
+
+#undef TARGET_CONSTANT_ALIGNMENT
+#define TARGET_CONSTANT_ALIGNMENT constant_alignment_word_strings
+
struct gcc_target targetm = TARGET_INITIALIZER;