/* Subroutines used for code generation on Vitesse IQ2000 processors
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "debug.h"
#include "target.h"
#include "target-def.h"
+#include "langhooks.h"
/* Enumeration for all of the relational tests, so that we can build
arrays indexed by the test type, and not worry about the order
int num_gp; /* Number of gp registers saved. */
} iq2000_frame_info;
-struct machine_function GTY(())
+struct GTY(()) machine_function
{
/* Current frame information, calculated by compute_frame_size. */
long total_size; /* # bytes that the entire frame takes up. */
/* What type of branch to use. */
enum cmp_type branch_type;
-/* Strings to hold which cpu and instruction set architecture to use. */
-const char * iq2000_cpu_string; /* For -mcpu=<xxx>. */
-const char * iq2000_arch_string; /* For -march=<xxx>. */
-
-
/* Local variables. */
/* The next branch instruction is a branch likely, not branch normal. */
/* # of nops needed by previous insn. */
static int dslots_number_nops;
-/* Number of 1/2/3 word references to data items (ie, not jal's). */
+/* Number of 1/2/3 word references to data items (i.e., not jal's). */
static int num_refs[3];
/* Registers to check for load delay. */
static rtx iq2000_load_reg3;
static rtx iq2000_load_reg4;
-/* The target cpu for code generation. */
-static enum processor_type iq2000_arch;
-
/* Mode used for saving/restoring general purpose registers. */
static enum machine_mode gpr_mode;
\f
/* Initialize the GCC target structure. */
static struct machine_function* iq2000_init_machine_status (void);
-static void iq2000_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT);
+static bool iq2000_handle_option (size_t, const char *, int);
+static section *iq2000_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT);
static void iq2000_init_builtins (void);
static rtx iq2000_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
-static bool iq2000_return_in_memory (tree, tree);
+static bool iq2000_return_in_memory (const_tree, const_tree);
static void iq2000_setup_incoming_varargs (CUMULATIVE_ARGS *,
enum machine_mode, tree, int *,
int);
-static bool iq2000_rtx_costs (rtx, int, int, int *);
-static int iq2000_address_cost (rtx);
-static void iq2000_select_section (tree, int, unsigned HOST_WIDE_INT);
-static bool iq2000_return_in_memory (tree, tree);
+static bool iq2000_rtx_costs (rtx, int, int, int *, bool);
+static int iq2000_address_cost (rtx, bool);
+static section *iq2000_select_section (tree, int, unsigned HOST_WIDE_INT);
+static bool iq2000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
+ const_tree, bool);
+static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
+static void iq2000_va_start (tree, rtx);
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS iq2000_init_builtins
#define TARGET_EXPAND_BUILTIN iq2000_expand_builtin
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION iq2000_select_rtx_section
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION iq2000_handle_option
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS iq2000_rtx_costs
#undef TARGET_ADDRESS_COST
#undef TARGET_ASM_SELECT_SECTION
#define TARGET_ASM_SELECT_SECTION iq2000_select_section
+/* The assembler supports switchable .bss sections, but
+ iq2000_select_section doesn't yet make use of them. */
+#undef TARGET_HAVE_SWITCHABLE_BSS_SECTIONS
+#define TARGET_HAVE_SWITCHABLE_BSS_SECTIONS false
+
#undef TARGET_PROMOTE_FUNCTION_ARGS
-#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true
+#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_const_tree_true
#undef TARGET_PROMOTE_FUNCTION_RETURN
-#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
+#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_const_tree_true
#undef TARGET_PROMOTE_PROTOTYPES
-#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
+#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
-#undef TARGET_STRUCT_VALUE_RTX
-#define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY iq2000_return_in_memory
+#undef TARGET_PASS_BY_REFERENCE
+#define TARGET_PASS_BY_REFERENCE iq2000_pass_by_reference
+#undef TARGET_CALLEE_COPIES
+#define TARGET_CALLEE_COPIES hook_callee_copies_named
+#undef TARGET_ARG_PARTIAL_BYTES
+#define TARGET_ARG_PARTIAL_BYTES iq2000_arg_partial_bytes
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS iq2000_setup_incoming_varargs
#undef TARGET_STRICT_ARGUMENT_NAMING
#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
+#undef TARGET_EXPAND_BUILTIN_VA_START
+#define TARGET_EXPAND_BUILTIN_VA_START iq2000_va_start
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
-/* Return 1 if OP can be used as an operand where a register or 16 bit unsigned
- integer is needed. */
-
-int
-uns_arith_operand (rtx op, enum machine_mode mode)
-{
- if (GET_CODE (op) == CONST_INT && SMALL_INT_UNSIGNED (op))
- return 1;
-
- return register_operand (op, mode);
-}
-
-/* Return 1 if OP can be used as an operand where a 16 bit integer is needed. */
-
-int
-arith_operand (rtx op, enum machine_mode mode)
-{
- if (GET_CODE (op) == CONST_INT && SMALL_INT (op))
- return 1;
-
- return register_operand (op, mode);
-}
-
-/* Return 1 if OP is a integer which fits in 16 bits. */
-
-int
-small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
-{
- return (GET_CODE (op) == CONST_INT && SMALL_INT (op));
-}
-
-/* Return 1 if OP is a 32 bit integer which is too big to be loaded with one
- instruction. */
-
-int
-large_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
-{
- HOST_WIDE_INT value;
-
- if (GET_CODE (op) != CONST_INT)
- return 0;
-
- value = INTVAL (op);
-
- /* IOR reg,$r0,value. */
- if ((value & ~ ((HOST_WIDE_INT) 0x0000ffff)) == 0)
- return 0;
-
- /* SUBU reg,$r0,value. */
- if (((unsigned HOST_WIDE_INT) (value + 32768)) <= 32767)
- return 0;
-
- /* LUI reg,value >> 16. */
- if ((value & 0x0000ffff) == 0)
- return 0;
-
- return 1;
-}
-
-/* Return 1 if OP is a register or the constant 0. */
-
-int
-reg_or_0_operand (rtx op, enum machine_mode mode)
-{
- switch (GET_CODE (op))
- {
- case CONST_INT:
- return INTVAL (op) == 0;
-
- case CONST_DOUBLE:
- return op == CONST0_RTX (mode);
-
- case REG:
- case SUBREG:
- return register_operand (op, mode);
-
- default:
- break;
- }
-
- return 0;
-}
-
-/* Return 1 if OP is a memory operand that fits in a single instruction
- (ie, register + small offset). */
-
-int
-simple_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
-{
- rtx addr, plus0, plus1;
-
- /* Eliminate non-memory operations. */
- if (GET_CODE (op) != MEM)
- return 0;
-
- /* Dword operations really put out 2 instructions, so eliminate them. */
- if (GET_MODE_SIZE (GET_MODE (op)) > (unsigned) UNITS_PER_WORD)
- return 0;
-
- /* Decode the address now. */
- addr = XEXP (op, 0);
- switch (GET_CODE (addr))
- {
- case REG:
- case LO_SUM:
- return 1;
-
- case CONST_INT:
- return SMALL_INT (addr);
-
- case PLUS:
- plus0 = XEXP (addr, 0);
- plus1 = XEXP (addr, 1);
- if (GET_CODE (plus0) == REG
- && GET_CODE (plus1) == CONST_INT && SMALL_INT (plus1)
- && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */)
- return 1;
-
- else if (GET_CODE (plus1) == REG
- && GET_CODE (plus0) == CONST_INT && SMALL_INT (plus0)
- && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */)
- return 1;
-
- else
- return 0;
-
- case SYMBOL_REF:
- return 0;
-
- default:
- break;
- }
-
- return 0;
-}
-
-/* Return nonzero if the code of this rtx pattern is EQ or NE. */
-
-int
-equality_op (rtx op, enum machine_mode mode)
-{
- if (mode != GET_MODE (op))
- return 0;
-
- return GET_CODE (op) == EQ || GET_CODE (op) == NE;
-}
-
-/* Return nonzero if the code is a relational operations (EQ, LE, etc). */
-
-int
-cmp_op (rtx op, enum machine_mode mode)
-{
- if (mode != GET_MODE (op))
- return 0;
-
- return GET_RTX_CLASS (GET_CODE (op)) == '<';
-}
-
-/* Return nonzero if the operand is either the PC or a label_ref. */
-
-int
-pc_or_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
-{
- if (op == pc_rtx)
- return 1;
-
- if (GET_CODE (op) == LABEL_REF)
- return 1;
-
- return 0;
-}
-
-/* Return nonzero if OP is a valid operand for a call instruction. */
-
-int
-call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
-{
- return (CONSTANT_ADDRESS_P (op)
- || (GET_CODE (op) == REG && op != arg_pointer_rtx
- && ! (REGNO (op) >= FIRST_PSEUDO_REGISTER
- && REGNO (op) <= LAST_VIRTUAL_REGISTER)));
-}
-
-/* Return nonzero if OP is valid as a source operand for a move instruction. */
-
-int
-move_operand (rtx op, enum machine_mode mode)
-{
- /* Accept any general operand after reload has started; doing so
- avoids losing if reload does an in-place replacement of a register
- with a SYMBOL_REF or CONST. */
- return (general_operand (op, mode)
- && (! (iq2000_check_split (op, mode))
- || reload_in_progress || reload_completed));
-}
-
-/* Return nonzero if OP is a constant power of 2. */
-
-int
-power_of_2_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
-{
- int intval;
-
- if (GET_CODE (op) != CONST_INT)
- return 0;
- else
- intval = INTVAL (op);
-
- return ((intval & ((unsigned)(intval) - 1)) == 0);
-}
-
/* Return nonzero if we split the address into high and low parts. */
int
{
error (reason);
debug_rtx (insn);
- abort ();
+ fancy_abort (__FILE__, __LINE__, __FUNCTION__);
}
\f
/* Return the appropriate instructions to move one operand to another. */
/* Provide the costs of an addressing mode that contains ADDR. */
static int
-iq2000_address_cost (rtx addr)
+iq2000_address_cost (rtx addr, bool speed)
{
switch (GET_CODE (addr))
{
case LABEL_REF:
case HIGH:
case LO_SUM:
- return iq2000_address_cost (plus1) + 1;
+ return iq2000_address_cost (plus1, speed) + 1;
default:
break;
rtx reg2;
test = map_test_to_internal_test (test_code);
- if (test == ITEST_MAX)
- abort ();
+ gcc_assert (test != ITEST_MAX);
p_info = &info[(int) test];
eqne_p = (p_info->test_code == XOR);
{
if (p_info->const_add != 0)
{
- HOST_WIDE_INT new = INTVAL (cmp1) + p_info->const_add;
+ HOST_WIDE_INT new_const = INTVAL (cmp1) + p_info->const_add;
/* If modification of cmp1 caused overflow,
we would get the wrong answer if we follow the usual path;
thus, x > 0xffffffffU would turn into x > 0U. */
if ((p_info->unsignedp
- ? (unsigned HOST_WIDE_INT) new >
+ ? (unsigned HOST_WIDE_INT) new_const >
(unsigned HOST_WIDE_INT) INTVAL (cmp1)
- : new > INTVAL (cmp1))
+ : new_const > INTVAL (cmp1))
!= (p_info->const_add > 0))
{
/* This test is always true, but if INVERT is true then
return result;
}
else
- cmp1 = GEN_INT (new);
+ cmp1 = GEN_INT (new_const);
}
}
"function_adv({gp reg found = %d, arg # = %2d, words = %2d}, %4s, ",
cum->gp_reg_found, cum->arg_number, cum->arg_words,
GET_MODE_NAME (mode));
- fprintf (stderr, HOST_PTR_PRINTF, (const PTR) type);
+ fprintf (stderr, "%p", (void *) type);
fprintf (stderr, ", %d )\n\n", named);
}
break;
default:
- if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT
- && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT)
- abort ();
+ gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
+ || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT);
cum->gp_reg_found = 1;
cum->arg_words += ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1)
cum->arg_words += 2;
break;
+ case TImode:
+ cum->gp_reg_found = 1;
+ cum->arg_words += 4;
+ break;
+
case QImode:
case HImode:
case SImode:
and type TYPE in CUM, or 0 if the argument is to be passed on the stack. */
struct rtx_def *
-function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
+function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type,
int named)
{
rtx ret;
"function_arg( {gp reg found = %d, arg # = %2d, words = %2d}, %4s, ",
cum->gp_reg_found, cum->arg_number, cum->arg_words,
GET_MODE_NAME (mode));
- fprintf (stderr, HOST_PTR_PRINTF, (const PTR) type);
+ fprintf (stderr, "%p", (const void *) type);
fprintf (stderr, ", %d ) = ", named);
}
break;
default:
- if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT
- && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT)
- abort ();
+ gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
+ || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT);
/* Drops through. */
case BLKmode:
case DImode:
cum->arg_words += (cum->arg_words & 1);
regbase = GP_ARG_FIRST;
+ break;
+
+ case TImode:
+ cum->arg_words += (cum->arg_words & 3);
+ regbase = GP_ARG_FIRST;
+ break;
}
if (*arg_words >= (unsigned) MAX_ARGS_IN_REGISTERS)
}
else
{
- if (regbase == -1)
- abort ();
+ gcc_assert (regbase != -1);
if (! type || TREE_CODE (type) != RECORD_TYPE
|| ! named || ! TYPE_SIZE_UNIT (type)
return ret;
}
-int
-function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
- tree type ATTRIBUTE_UNUSED,
- int named ATTRIBUTE_UNUSED)
+static int
+iq2000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type ATTRIBUTE_UNUSED,
+ bool named ATTRIBUTE_UNUSED)
{
- if (mode == DImode
- && cum->arg_words == MAX_ARGS_IN_REGISTERS - (unsigned)1)
+ if (mode == DImode && cum->arg_words == MAX_ARGS_IN_REGISTERS - 1)
{
if (TARGET_DEBUG_D_MODE)
- fprintf (stderr, "function_arg_partial_nregs = 1\n");
-
- return 1;
+ fprintf (stderr, "iq2000_arg_partial_bytes=%d\n", UNITS_PER_WORD);
+ return UNITS_PER_WORD;
}
return 0;
\f
/* Implement va_start. */
-void
+static void
iq2000_va_start (tree valist, rtx nextarg)
{
int int_arg_words;
/* Find out how many non-float named formals. */
int gpr_save_area_size;
/* Note UNITS_PER_WORD is 4 bytes. */
- int_arg_words = current_function_args_info.arg_words;
+ int_arg_words = crtl->args.info.arg_words;
if (int_arg_words < 8 )
/* Adjust for the prologue's economy measure. */
nextarg = plus_constant (nextarg, - gpr_save_area_size);
std_expand_builtin_va_start (valist, nextarg);
}
-
-/* Implement va_arg. */
-
-rtx
-iq2000_va_arg (tree valist, tree type)
-{
- HOST_WIDE_INT size, rsize;
- rtx addr_rtx;
- tree t;
- int indirect;
- rtx r, lab_over = NULL_RTX, lab_false;
- tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff;
- tree ovfl, gtop, ftop, goff, foff;
-
- size = int_size_in_bytes (type);
- rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
- indirect
- = function_arg_pass_by_reference (NULL, TYPE_MODE (type), type, 0);
- if (indirect)
- {
- size = POINTER_SIZE / BITS_PER_UNIT;
- rsize = UNITS_PER_WORD;
- }
-
- addr_rtx = gen_reg_rtx (Pmode);
-
- {
- /* Case of all args in a merged stack. No need to check bounds,
- just advance valist along the stack. */
- tree gpr = valist;
-
- if (! indirect
- && TYPE_ALIGN (type) > (unsigned) BITS_PER_WORD)
- {
- t = build (PLUS_EXPR, TREE_TYPE (gpr), gpr,
- build_int_2 (2*UNITS_PER_WORD - 1, 0));
- t = build (BIT_AND_EXPR, TREE_TYPE (t), t,
- build_int_2 (-2*UNITS_PER_WORD, -1));
- t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, t);
- expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- }
-
- t = build (POSTINCREMENT_EXPR, TREE_TYPE (gpr), gpr,
- size_int (rsize));
- r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
- if (r != addr_rtx)
- emit_move_insn (addr_rtx, r);
-
- /* Flush the POSTINCREMENT. */
- emit_queue();
-
- if (indirect)
- {
- r = gen_rtx_MEM (Pmode, addr_rtx);
- set_mem_alias_set (r, get_varargs_alias_set ());
- emit_move_insn (addr_rtx, r);
- }
- else
- {
- if (BYTES_BIG_ENDIAN && rsize != size)
- addr_rtx = plus_constant (addr_rtx, rsize - size);
- }
- return addr_rtx;
- }
-
- /* Not a simple merged stack. Need ptrs and indexes left by va_start. */
- f_ovfl = TYPE_FIELDS (va_list_type_node);
- f_gtop = TREE_CHAIN (f_ovfl);
- f_ftop = TREE_CHAIN (f_gtop);
- f_goff = TREE_CHAIN (f_ftop);
- f_foff = TREE_CHAIN (f_goff);
-
- ovfl = build (COMPONENT_REF, TREE_TYPE (f_ovfl), valist, f_ovfl);
- gtop = build (COMPONENT_REF, TREE_TYPE (f_gtop), valist, f_gtop);
- ftop = build (COMPONENT_REF, TREE_TYPE (f_ftop), valist, f_ftop);
- goff = build (COMPONENT_REF, TREE_TYPE (f_goff), valist, f_goff);
- foff = build (COMPONENT_REF, TREE_TYPE (f_foff), valist, f_foff);
-
- lab_false = gen_label_rtx ();
- lab_over = gen_label_rtx ();
-
- if (TREE_CODE (type) == REAL_TYPE)
- {
- /* Emit code to branch if foff == 0. */
- r = expand_expr (foff, NULL_RTX, TYPE_MODE (TREE_TYPE (foff)),
- EXPAND_NORMAL);
- emit_cmp_and_jump_insns (r, const0_rtx, EQ,
- const1_rtx, GET_MODE (r), 1, lab_false);
-
- /* Emit code for addr_rtx = ftop - foff. */
- t = build (MINUS_EXPR, TREE_TYPE (ftop), ftop, foff );
- r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
- if (r != addr_rtx)
- emit_move_insn (addr_rtx, r);
-
- /* Emit code for foff-=8.
- Advances the offset up FPR save area by one double. */
- t = build (MINUS_EXPR, TREE_TYPE (foff), foff, build_int_2 (8, 0));
- t = build (MODIFY_EXPR, TREE_TYPE (foff), foff, t);
- expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- emit_queue ();
- emit_jump (lab_over);
- emit_barrier ();
- emit_label (lab_false);
-
- /* If a 4-byte int is followed by an 8-byte float, then
- natural alignment causes a 4 byte gap.
- So, dynamically adjust ovfl up to a multiple of 8. */
- t = build (BIT_AND_EXPR, TREE_TYPE (ovfl), ovfl,
- build_int_2 (7, 0));
- t = build (PLUS_EXPR, TREE_TYPE (ovfl), ovfl, t);
- t = build (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
- expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- /* Emit code for addr_rtx = the ovfl pointer into overflow area.
- Postincrement the ovfl pointer by 8. */
- t = build (POSTINCREMENT_EXPR, TREE_TYPE(ovfl), ovfl,
- size_int (8));
- r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
- if (r != addr_rtx)
- emit_move_insn (addr_rtx, r);
-
- emit_queue();
- emit_label (lab_over);
- return addr_rtx;
- }
- else
- {
- /* Not REAL_TYPE. */
- int step_size;
-
- if (TREE_CODE (type) == INTEGER_TYPE
- && TYPE_PRECISION (type) == 64)
- {
- /* int takes 32 bits of the GPR save area, but
- longlong takes an aligned 64 bits. So, emit code
- to zero the low order bits of goff, thus aligning
- the later calculation of (gtop-goff) upwards. */
- t = build (BIT_AND_EXPR, TREE_TYPE (goff), goff,
- build_int_2 (-8, -1));
- t = build (MODIFY_EXPR, TREE_TYPE (goff), goff, t);
- expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- }
-
- /* Emit code to branch if goff == 0. */
- r = expand_expr (goff, NULL_RTX, TYPE_MODE (TREE_TYPE (goff)),
- EXPAND_NORMAL);
- emit_cmp_and_jump_insns (r, const0_rtx, EQ,
- const1_rtx, GET_MODE (r), 1, lab_false);
-
- /* Emit code for addr_rtx = gtop - goff. */
- t = build (MINUS_EXPR, TREE_TYPE (gtop), gtop, goff);
- r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
- if (r != addr_rtx)
- emit_move_insn (addr_rtx, r);
-
- if (TYPE_PRECISION (type) == 64)
- step_size = 8;
- else
- step_size = UNITS_PER_WORD;
-
- /* Emit code for goff = goff - step_size.
- Advances the offset up GPR save area over the item. */
- t = build (MINUS_EXPR, TREE_TYPE (goff), goff,
- build_int_2 (step_size, 0));
- t = build (MODIFY_EXPR, TREE_TYPE (goff), goff, t);
- expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- emit_queue();
- emit_jump (lab_over);
- emit_barrier ();
- emit_label (lab_false);
-
- /* Emit code for addr_rtx -> overflow area, postinc by step_size. */
- t = build (POSTINCREMENT_EXPR, TREE_TYPE(ovfl), ovfl,
- size_int (step_size));
- r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
- if (r != addr_rtx)
- emit_move_insn (addr_rtx, r);
-
- emit_queue();
- emit_label (lab_over);
-
- if (indirect)
- {
- r = gen_rtx_MEM (Pmode, addr_rtx);
- set_mem_alias_set (r, get_varargs_alias_set ());
- emit_move_insn (addr_rtx, r);
- }
- else
- {
- if (BYTES_BIG_ENDIAN && rsize != size)
- addr_rtx = plus_constant (addr_rtx, rsize - size);
- }
- return addr_rtx;
- }
-}
\f
/* Allocate a chunk of memory for per-function machine-dependent data. */
{
struct machine_function *f;
- f = ggc_alloc_cleared (sizeof (struct machine_function));
+ f = GGC_CNEW (struct machine_function);
return f;
}
-static enum processor_type
-iq2000_parse_cpu (const char * cpu_string)
-{
- const char *p = cpu_string;
- enum processor_type cpu;
+/* Implement TARGET_HANDLE_OPTION. */
- cpu = PROCESSOR_DEFAULT;
- switch (p[2])
+static bool
+iq2000_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+{
+ switch (code)
{
- case '1':
- if (!strcmp (p, "iq10"))
- cpu = PROCESSOR_IQ10;
- break;
- case '2':
- if (!strcmp (p, "iq2000"))
- cpu = PROCESSOR_IQ2000;
- break;
- }
+ case OPT_mcpu_:
+ if (strcmp (arg, "iq10") == 0)
+ iq2000_tune = PROCESSOR_IQ10;
+ else if (strcmp (arg, "iq2000") == 0)
+ iq2000_tune = PROCESSOR_IQ2000;
+ else
+ return false;
+ return true;
+
+ case OPT_march_:
+ /* This option has no effect at the moment. */
+ return (strcmp (arg, "default") == 0
+ || strcmp (arg, "DEFAULT") == 0
+ || strcmp (arg, "iq2000") == 0);
- return cpu;
+ default:
+ return true;
+ }
}
/* Detect any conflicts in the switches. */
void
override_options (void)
{
- enum processor_type iq2000_cpu;
-
target_flags &= ~MASK_GPOPT;
iq2000_isa = IQ2000_ISA_DEFAULT;
/* Identify the processor type. */
- if (iq2000_cpu_string != 0)
- {
- iq2000_cpu = iq2000_parse_cpu (iq2000_cpu_string);
- if (iq2000_cpu == PROCESSOR_DEFAULT)
- {
- error ("bad value (%s) for -mcpu= switch", iq2000_arch_string);
- iq2000_cpu_string = "default";
- }
- iq2000_arch = iq2000_cpu;
- iq2000_tune = iq2000_cpu;
- }
-
- if (iq2000_arch_string == 0
- || ! strcmp (iq2000_arch_string, "default")
- || ! strcmp (iq2000_arch_string, "DEFAULT"))
- {
- switch (iq2000_isa)
- {
- default:
- iq2000_arch_string = "iq2000";
- iq2000_arch = PROCESSOR_IQ2000;
- break;
- }
- }
- else
- {
- iq2000_arch = iq2000_parse_cpu (iq2000_arch_string);
- if (iq2000_arch == PROCESSOR_DEFAULT)
- {
- error ("bad value (%s) for -march= switch", iq2000_arch_string);
- iq2000_arch_string = "default";
- }
- if (iq2000_arch == PROCESSOR_IQ10)
- {
- error ("The compiler does not support -march=%s.", iq2000_arch_string);
- iq2000_arch_string = "default";
- }
- }
-
iq2000_print_operand_punct['?'] = 1;
iq2000_print_operand_punct['#'] = 1;
iq2000_print_operand_punct['&'] = 1;
mask = 0;
extra_size = IQ2000_STACK_ALIGN ((0));
var_size = IQ2000_STACK_ALIGN (size);
- args_size = IQ2000_STACK_ALIGN (current_function_outgoing_args_size);
+ args_size = IQ2000_STACK_ALIGN (crtl->outgoing_args_size);
/* If a function dynamically allocates the stack and
has 0 for STACK_DYNAMIC_OFFSET then allocate some stack space. */
- if (args_size == 0 && current_function_calls_alloca)
+ if (args_size == 0 && cfun->calls_alloca)
args_size = 4 * UNITS_PER_WORD;
total_size = var_size + args_size + extra_size;
}
/* We need to restore these for the handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
&& ! profile_flag)
total_size = extra_size = 0;
- total_size += IQ2000_STACK_ALIGN (current_function_pretend_args_size);
+ total_size += IQ2000_STACK_ALIGN (crtl->args.pretend_args_size);
/* Save other computed information. */
cfun->machine->total_size = total_size;
HOST_WIDE_INT gp_offset;
HOST_WIDE_INT end_offset;
- if (frame_pointer_needed
- && ! BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST))
- abort ();
+ gcc_assert (!frame_pointer_needed
+ || BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST));
if (mask == 0)
{
if (gp_offset < 0 || end_offset < 0)
internal_error
- ("gp_offset (%ld) or end_offset (%ld) is less than zero.",
+ ("gp_offset (%ld) or end_offset (%ld) is less than zero",
(long) gp_offset, (long) end_offset);
else if (gp_offset < 32768)
gen_rtx_PLUS (Pmode, base_reg_rtx,
GEN_INT (gp_offset - base_offset)));
- if (! current_function_calls_eh_return)
- RTX_UNCHANGING_P (mem_rtx) = 1;
-
reg_rtx = gen_rtx_REG (gpr_mode, regno);
if (store_p)
/* If struct value address is treated as the first argument. */
if (aggregate_value_p (DECL_RESULT (fndecl), fndecl)
- && ! current_function_returns_pcc_struct
+ && !cfun->returns_pcc_struct
&& targetm.calls.struct_value_rtx (TREE_TYPE (fndecl), 1) == 0)
{
tree type = build_pointer_type (fntype);
variable arguments.
This is only needed if store_args_on_stack is true. */
- INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0);
+ INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0, 0);
regno = GP_ARG_FIRST;
for (cur_arg = fnargs; cur_arg != 0; cur_arg = next_arg)
{
int words;
- if (GET_CODE (entry_parm) != REG)
- abort ();
+ gcc_assert (GET_CODE (entry_parm) == REG);
/* Passed in a register, so will get homed automatically. */
if (GET_MODE (entry_parm) == BLKmode)
PUT_CODE (SET_SRC (pattern), ASHIFTRT);
insn = emit_insn (pattern);
-
- /* Global life information isn't valid at this point, so we
- can't check whether these shifts are actually used. Mark
- them MAYBE_DEAD so that flow2 will remove them, and not
- complain about dead code in the prologue. */
- REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
- REG_NOTES (insn));
}
}
if (iq2000_can_use_return_insn ())
{
- emit_insn (gen_return ());
+ emit_jump_insn (gen_return ());
return;
}
save_restore_insns (0);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
rtx eh_ofs = EH_RETURN_STACKADJ_RTX;
emit_insn (gen_addsi3 (eh_ofs, eh_ofs, tsize_rtx));
emit_insn (gen_blockage ());
- if (tsize != 0 || current_function_calls_eh_return)
+ if (tsize != 0 || crtl->calls_eh_return)
{
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
tsize_rtx));
}
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
/* Perform the additional bump for __throw. */
emit_move_insn (gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM),
stack_pointer_rtx);
- emit_insn (gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode,
- HARD_FRAME_POINTER_REGNUM)));
+ emit_use (gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM));
emit_jump_insn (gen_eh_return_internal ());
}
else
if (! reload_completed)
return 0;
- if (regs_ever_live[31] || profile_flag)
+ if (df_regs_ever_live_p (31) || profile_flag)
return 0;
if (cfun->machine->initialized)
if (GET_CODE (x) == CONST)
return symbolic_expression_p (XEXP (x, 0));
- if (GET_RTX_CLASS (GET_CODE (x)) == '1')
+ if (UNARY_P (x))
return symbolic_expression_p (XEXP (x, 0));
- if (GET_RTX_CLASS (GET_CODE (x)) == 'c'
- || GET_RTX_CLASS (GET_CODE (x)) == '2')
+ if (ARITHMETIC_P (x))
return (symbolic_expression_p (XEXP (x, 0))
|| symbolic_expression_p (XEXP (x, 1)));
/* Choose the section to use for the constant rtx expression X that has
mode MODE. */
-static void
+static section *
iq2000_select_rtx_section (enum machine_mode mode, rtx x ATTRIBUTE_UNUSED,
unsigned HOST_WIDE_INT align)
{
/* For embedded applications, always put constants in read-only data,
in order to reduce RAM usage. */
- /* For embedded applications, always put constants in read-only data,
- in order to reduce RAM usage. */
- mergeable_constant_section (mode, align, 0);
+ return mergeable_constant_section (mode, align, 0);
}
/* Choose the section to use for DECL. RELOC is true if its value contains
ENCODE_SECTION_INFO in iq2000.h so that references to these symbols
are done correctly. */
-static void
+static section *
iq2000_select_section (tree decl, int reloc ATTRIBUTE_UNUSED,
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
{
/* For embedded applications, always put an object in read-only data
if possible, in order to reduce RAM usage. */
- if (((TREE_CODE (decl) == VAR_DECL
- && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl)
- && DECL_INITIAL (decl)
- && (DECL_INITIAL (decl) == error_mark_node
- || TREE_CONSTANT (DECL_INITIAL (decl))))
- /* Deal with calls from output_constant_def_contents. */
- || (TREE_CODE (decl) != VAR_DECL
- && (TREE_CODE (decl) != STRING_CST
- || !flag_writable_strings))))
- readonly_data_section ();
+ if ((TREE_CODE (decl) == VAR_DECL
+ && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl)
+ && DECL_INITIAL (decl)
+ && (DECL_INITIAL (decl) == error_mark_node
+ || TREE_CONSTANT (DECL_INITIAL (decl))))
+ /* Deal with calls from output_constant_def_contents. */
+ || TREE_CODE (decl) != VAR_DECL)
+ return readonly_data_section;
else
- data_section ();
+ return data_section;
}
else
{
/* For hosted applications, always put an object in small data if
possible, as this gives the best performance. */
- if (((TREE_CODE (decl) == VAR_DECL
- && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl)
- && DECL_INITIAL (decl)
- && (DECL_INITIAL (decl) == error_mark_node
- || TREE_CONSTANT (DECL_INITIAL (decl))))
- /* Deal with calls from output_constant_def_contents. */
- || (TREE_CODE (decl) != VAR_DECL
- && (TREE_CODE (decl) != STRING_CST
- || !flag_writable_strings))))
- readonly_data_section ();
+ if ((TREE_CODE (decl) == VAR_DECL
+ && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl)
+ && DECL_INITIAL (decl)
+ && (DECL_INITIAL (decl) == error_mark_node
+ || TREE_CONSTANT (DECL_INITIAL (decl))))
+ /* Deal with calls from output_constant_def_contents. */
+ || TREE_CODE (decl) != VAR_DECL)
+ return readonly_data_section;
else
- data_section ();
+ return data_section;
}
}
/* Return register to use for a function return value with VALTYPE for function
FUNC. */
rtx
-iq2000_function_value (tree valtype, tree func ATTRIBUTE_UNUSED)
+iq2000_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
{
int reg = GP_RETURN;
enum machine_mode mode = TYPE_MODE (valtype);
- int unsignedp = TREE_UNSIGNED (valtype);
+ int unsignedp = TYPE_UNSIGNED (valtype);
/* Since we define TARGET_PROMOTE_FUNCTION_RETURN that returns true,
we must promote the mode just as PROMOTE_MODE does. */
return gen_rtx_REG (mode, reg);
}
\f
-/* The implementation of FUNCTION_ARG_PASS_BY_REFERENCE. Return
- nonzero when an argument must be passed by reference. */
+/* Return true when an argument must be passed by reference. */
-int
-function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
- enum machine_mode mode, tree type,
- int named ATTRIBUTE_UNUSED)
+static bool
+iq2000_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
{
int size;
/* We must pass by reference if we would be both passing in registers
and the stack. This is because any subsequent partial arg would be
handled incorrectly in this case. */
- if (cum && MUST_PASS_IN_STACK (mode, type))
+ if (cum && targetm.calls.must_pass_in_stack (mode, type))
{
/* Don't pass the actual CUM to FUNCTION_ARG, because we would
get double copies of any offsets generated for small structs
}
default:
- abort ();
+ gcc_unreachable ();
}
/* NOTREACHED */
return 0;
}
-#define def_builtin(NAME, TYPE, CODE) \
- builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, NULL_TREE)
+#define def_builtin(NAME, TYPE, CODE) \
+ add_builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
+ NULL, NULL_TREE)
static void
iq2000_init_builtins (void)
def_builtin ("__builtin_syscall", void_ftype, IQ2000_BUILTIN_SYSCALL);
}
-/* Builtin for ICODE having ARGCOUNT args in ARGLIST where each arg
+/* Builtin for ICODE having ARGCOUNT args in EXP where each arg
has an rtx CODE. */
static rtx
-expand_one_builtin (enum insn_code icode, rtx target, tree arglist,
+expand_one_builtin (enum insn_code icode, rtx target, tree exp,
enum rtx_code *code, int argcount)
{
rtx pat;
mode[0] = insn_data[icode].operand[0].mode;
for (i = 0; i < argcount; i++)
{
- arg[i] = TREE_VALUE (arglist);
- arglist = TREE_CHAIN (arglist);
+ arg[i] = CALL_EXPR_ARG (exp, i);
op[i] = expand_expr (arg[i], NULL_RTX, VOIDmode, 0);
mode[i] = insn_data[icode].operand[i].mode;
if (code[i] == CONST_INT && GET_CODE (op[i]) != CONST_INT)
- error ("argument `%d' is not a constant", i + 1);
+ error ("argument %qd is not a constant", i + 1);
if (code[i] == REG
&& ! (*insn_data[icode].operand[i].predicate) (op[i], mode[i]))
op[i] = copy_to_mode_reg (mode[i], op[i]);
pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]);
break;
default:
- abort ();
+ gcc_unreachable ();
}
if (! pat)
enum machine_mode mode ATTRIBUTE_UNUSED,
int ignore ATTRIBUTE_UNUSED)
{
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
- tree arglist = TREE_OPERAND (exp, 1);
+ tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
int fcode = DECL_FUNCTION_CODE (fndecl);
enum rtx_code code [5];
break;
case IQ2000_BUILTIN_ADO16:
- return expand_one_builtin (CODE_FOR_ado16, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_ado16, target, exp, code, 2);
case IQ2000_BUILTIN_RAM:
code[1] = CONST_INT;
code[2] = CONST_INT;
code[3] = CONST_INT;
- return expand_one_builtin (CODE_FOR_ram, target, arglist, code, 4);
+ return expand_one_builtin (CODE_FOR_ram, target, exp, code, 4);
case IQ2000_BUILTIN_CHKHDR:
- return expand_one_builtin (CODE_FOR_chkhdr, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_chkhdr, target, exp, code, 2);
case IQ2000_BUILTIN_PKRL:
- return expand_one_builtin (CODE_FOR_pkrl, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_pkrl, target, exp, code, 2);
case IQ2000_BUILTIN_CFC0:
code[0] = CONST_INT;
- return expand_one_builtin (CODE_FOR_cfc0, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_cfc0, target, exp, code, 1);
case IQ2000_BUILTIN_CFC1:
code[0] = CONST_INT;
- return expand_one_builtin (CODE_FOR_cfc1, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_cfc1, target, exp, code, 1);
case IQ2000_BUILTIN_CFC2:
code[0] = CONST_INT;
- return expand_one_builtin (CODE_FOR_cfc2, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_cfc2, target, exp, code, 1);
case IQ2000_BUILTIN_CFC3:
code[0] = CONST_INT;
- return expand_one_builtin (CODE_FOR_cfc3, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_cfc3, target, exp, code, 1);
case IQ2000_BUILTIN_CTC0:
code[1] = CONST_INT;
- return expand_one_builtin (CODE_FOR_ctc0, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_ctc0, target, exp, code, 2);
case IQ2000_BUILTIN_CTC1:
code[1] = CONST_INT;
- return expand_one_builtin (CODE_FOR_ctc1, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_ctc1, target, exp, code, 2);
case IQ2000_BUILTIN_CTC2:
code[1] = CONST_INT;
- return expand_one_builtin (CODE_FOR_ctc2, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_ctc2, target, exp, code, 2);
case IQ2000_BUILTIN_CTC3:
code[1] = CONST_INT;
- return expand_one_builtin (CODE_FOR_ctc3, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_ctc3, target, exp, code, 2);
case IQ2000_BUILTIN_MFC0:
code[0] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mfc0, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_mfc0, target, exp, code, 1);
case IQ2000_BUILTIN_MFC1:
code[0] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mfc1, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_mfc1, target, exp, code, 1);
case IQ2000_BUILTIN_MFC2:
code[0] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mfc2, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_mfc2, target, exp, code, 1);
case IQ2000_BUILTIN_MFC3:
code[0] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mfc3, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_mfc3, target, exp, code, 1);
case IQ2000_BUILTIN_MTC0:
code[1] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mtc0, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_mtc0, target, exp, code, 2);
case IQ2000_BUILTIN_MTC1:
code[1] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mtc1, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_mtc1, target, exp, code, 2);
case IQ2000_BUILTIN_MTC2:
code[1] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mtc2, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_mtc2, target, exp, code, 2);
case IQ2000_BUILTIN_MTC3:
code[1] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mtc3, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_mtc3, target, exp, code, 2);
case IQ2000_BUILTIN_LUR:
- return expand_one_builtin (CODE_FOR_lur, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_lur, target, exp, code, 2);
case IQ2000_BUILTIN_RB:
- return expand_one_builtin (CODE_FOR_rb, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_rb, target, exp, code, 2);
case IQ2000_BUILTIN_RX:
- return expand_one_builtin (CODE_FOR_rx, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_rx, target, exp, code, 2);
case IQ2000_BUILTIN_SRRD:
- return expand_one_builtin (CODE_FOR_srrd, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_srrd, target, exp, code, 1);
case IQ2000_BUILTIN_SRWR:
- return expand_one_builtin (CODE_FOR_srwr, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_srwr, target, exp, code, 2);
case IQ2000_BUILTIN_WB:
- return expand_one_builtin (CODE_FOR_wb, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_wb, target, exp, code, 2);
case IQ2000_BUILTIN_WX:
- return expand_one_builtin (CODE_FOR_wx, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_wx, target, exp, code, 2);
case IQ2000_BUILTIN_LUC32L:
- return expand_one_builtin (CODE_FOR_luc32l, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_luc32l, target, exp, code, 2);
case IQ2000_BUILTIN_LUC64:
- return expand_one_builtin (CODE_FOR_luc64, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_luc64, target, exp, code, 2);
case IQ2000_BUILTIN_LUC64L:
- return expand_one_builtin (CODE_FOR_luc64l, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_luc64l, target, exp, code, 2);
case IQ2000_BUILTIN_LUK:
- return expand_one_builtin (CODE_FOR_luk, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_luk, target, exp, code, 2);
case IQ2000_BUILTIN_LULCK:
- return expand_one_builtin (CODE_FOR_lulck, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_lulck, target, exp, code, 1);
case IQ2000_BUILTIN_LUM32:
- return expand_one_builtin (CODE_FOR_lum32, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_lum32, target, exp, code, 2);
case IQ2000_BUILTIN_LUM32L:
- return expand_one_builtin (CODE_FOR_lum32l, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_lum32l, target, exp, code, 2);
case IQ2000_BUILTIN_LUM64:
- return expand_one_builtin (CODE_FOR_lum64, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_lum64, target, exp, code, 2);
case IQ2000_BUILTIN_LUM64L:
- return expand_one_builtin (CODE_FOR_lum64l, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_lum64l, target, exp, code, 2);
case IQ2000_BUILTIN_LURL:
- return expand_one_builtin (CODE_FOR_lurl, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_lurl, target, exp, code, 2);
case IQ2000_BUILTIN_MRGB:
code[2] = CONST_INT;
- return expand_one_builtin (CODE_FOR_mrgb, target, arglist, code, 3);
+ return expand_one_builtin (CODE_FOR_mrgb, target, exp, code, 3);
case IQ2000_BUILTIN_SRRDL:
- return expand_one_builtin (CODE_FOR_srrdl, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_srrdl, target, exp, code, 1);
case IQ2000_BUILTIN_SRULCK:
- return expand_one_builtin (CODE_FOR_srulck, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_srulck, target, exp, code, 1);
case IQ2000_BUILTIN_SRWRU:
- return expand_one_builtin (CODE_FOR_srwru, target, arglist, code, 2);
+ return expand_one_builtin (CODE_FOR_srwru, target, exp, code, 2);
case IQ2000_BUILTIN_TRAPQFL:
- return expand_one_builtin (CODE_FOR_trapqfl, target, arglist, code, 0);
+ return expand_one_builtin (CODE_FOR_trapqfl, target, exp, code, 0);
case IQ2000_BUILTIN_TRAPQNE:
- return expand_one_builtin (CODE_FOR_trapqne, target, arglist, code, 0);
+ return expand_one_builtin (CODE_FOR_trapqne, target, exp, code, 0);
case IQ2000_BUILTIN_TRAPREL:
- return expand_one_builtin (CODE_FOR_traprel, target, arglist, code, 1);
+ return expand_one_builtin (CODE_FOR_traprel, target, exp, code, 1);
case IQ2000_BUILTIN_WBU:
- return expand_one_builtin (CODE_FOR_wbu, target, arglist, code, 3);
+ return expand_one_builtin (CODE_FOR_wbu, target, exp, code, 3);
case IQ2000_BUILTIN_SYSCALL:
- return expand_one_builtin (CODE_FOR_syscall, target, arglist, code, 0);
+ return expand_one_builtin (CODE_FOR_syscall, target, exp, code, 0);
}
return NULL_RTX;
/* Worker function for TARGET_RETURN_IN_MEMORY. */
static bool
-iq2000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+iq2000_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
{
return ((int_size_in_bytes (type) > (2 * UNITS_PER_WORD))
|| (int_size_in_bytes (type) == -1));
else if (letter == 'Z')
{
- int regnum;
-
- if (code != REG)
- abort ();
-
- regnum = REGNO (op);
- abort ();
-
- fprintf (file, "%s,", reg_names[regnum]);
+ gcc_unreachable ();
}
else if (code == REG || code == SUBREG)
}
static bool
-iq2000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int * total)
+iq2000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int * total,
+ bool speed ATTRIBUTE_UNUSED)
{
enum machine_mode mode = GET_MODE (x);