+2010-06-21 Nick Clifton <nickc@redhat.com>
+
+ * config/rx/rx.h (PTRDIFF_TYPE): Define.
+ (SMALL_REGISTER_CLASS): Define (to zero).
+ (PRINT_OPERAND): Delete.
+ (PRINT_OPERAND_ADDRESS): Delete.
+ * config/rx/rx-protos.h (rx_print_operand): Delete prototype.
+ (rx_print_operand_address): Delete prototype.
+ * config/rx/rx.c (rx_print_operand): Make static.
+ Allow %H and %L to handle CONST_DOUBLEs.
+ (rx_print_operand_address): Make static.
+ (rx_gen_move_template): Rename local variable 'template' to
+ out_template.
+ (rx_function_arg): Do not pass unknown sized objects in
+ registers.
+ (TARGET_PRINT_OPERAND): Define.
+ (TARGET_PRINT_OPERAND_ADDRESS): Define.
+
2010-06-21 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (POD2MAN): Provide --date from $(DATESTAMP).
#include "target-def.h"
#include "langhooks.h"
\f
+static void rx_print_operand (FILE *, rtx, int);
+
enum rx_cpu_types rx_cpu_type = RX600;
\f
/* Return true if OP is a reference to an object in a small data area. */
assembler syntax for an instruction operand that is a memory
reference whose address is ADDR. */
-void
+static void
rx_print_operand_address (FILE * file, rtx addr)
{
switch (GET_CODE (addr))
%F Print a condition code flag name.
%H Print high part of a DImode register, integer or address.
%L Print low part of a DImode register, integer or address.
+ %N Print the negation of the immediate value.
%Q If the operand is a MEM, then correctly generate
register indirect or register relative addressing. */
-void
+static void
rx_print_operand (FILE * file, rtx op, int letter)
{
switch (letter)
case 0xc: fprintf (file, "intb"); break;
default:
warning (0, "unreocgnized control register number: %d - using 'psw'",
- INTVAL (op));
+ (int) INTVAL (op));
fprintf (file, "psw");
break;
}
break;
case 'H':
- if (REG_P (op))
- fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 0 : 1)]);
- else if (CONST_INT_P (op))
+ switch (GET_CODE (op))
{
- HOST_WIDE_INT v = INTVAL (op);
+ case REG:
+ fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 0 : 1)]);
+ break;
+ case CONST_INT:
+ {
+ HOST_WIDE_INT v = INTVAL (op);
+ fprintf (file, "#");
+ /* Trickery to avoid problems with shifting 32 bits at a time. */
+ v = v >> 16;
+ v = v >> 16;
+ rx_print_integer (file, v);
+ break;
+ }
+ case CONST_DOUBLE:
fprintf (file, "#");
- /* Trickery to avoid problems with shifting 32 bits at a time. */
- v = v >> 16;
- v = v >> 16;
- rx_print_integer (file, v);
- }
- else
- {
- gcc_assert (MEM_P (op));
-
+ rx_print_integer (file, CONST_DOUBLE_HIGH (op));
+ break;
+ case MEM:
if (! WORDS_BIG_ENDIAN)
op = adjust_address (op, SImode, 4);
output_address (XEXP (op, 0));
+ break;
+ default:
+ gcc_unreachable ();
}
break;
case 'L':
- if (REG_P (op))
- fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 1 : 0)]);
- else if (CONST_INT_P (op))
+ switch (GET_CODE (op))
{
+ case REG:
+ fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 1 : 0)]);
+ break;
+ case CONST_INT:
fprintf (file, "#");
rx_print_integer (file, INTVAL (op) & 0xffffffff);
- }
- else
- {
- gcc_assert (MEM_P (op));
-
+ break;
+ case CONST_DOUBLE:
+ fprintf (file, "#");
+ rx_print_integer (file, CONST_DOUBLE_LOW (op));
+ break;
+ case MEM:
if (WORDS_BIG_ENDIAN)
op = adjust_address (op, SImode, 4);
output_address (XEXP (op, 0));
+ break;
+ default:
+ gcc_unreachable ();
}
break;
char *
rx_gen_move_template (rtx * operands, bool is_movu)
{
- static char template [64];
+ static char out_template [64];
const char * extension = TARGET_AS100_SYNTAX ? ".L" : "";
const char * src_template;
const char * dst_template;
else
dst_template = "%0";
- sprintf (template, "%s%s\t%s, %s", is_movu ? "movu" : "mov",
+ sprintf (out_template, "%s%s\t%s, %s", is_movu ? "movu" : "mov",
extension, src_template, dst_template);
- return template;
+ return out_template;
}
/* Returns an assembler template for a conditional branch instruction. */
{
enum rtx_code code = GET_CODE (condition);
-
if ((cc_status.flags & CC_NO_OVERFLOW) && ! rx_float_compare_mode)
gcc_assert (code != GT && code != GE && code != LE && code != LT);
/* An exploded version of rx_function_arg_size. */
size = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode);
+ /* If the size is not known it cannot be passed in registers. */
+ if (size < 1)
+ return NULL_RTX;
rounded_size = rx_round_up (size, UNITS_PER_WORD);
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT rx_trampoline_init
+#undef TARGET_PRINT_OPERAND
+#define TARGET_PRINT_OPERAND rx_print_operand
+
+#undef TARGET_PRINT_OPERAND_ADDRESS
+#define TARGET_PRINT_OPERAND_ADDRESS rx_print_operand_address
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* #include "gt-rx.h" */
#define POINTER_SIZE 32
#undef SIZE_TYPE
#define SIZE_TYPE "long unsigned int"
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "long int"
#define POINTERS_EXTEND_UNSIGNED 1
#define FUNCTION_MODE QImode
#define CASE_VECTOR_MODE Pmode
GR_REGS, LIM_REG_CLASSES \
}
+#define SMALL_REGISTER_CLASSES 0
#define N_REG_CLASSES (int) LIM_REG_CLASSES
#define CLASS_MAX_NREGS(CLASS, MODE) ((GET_MODE_SIZE (MODE) \
+ UNITS_PER_WORD - 1) \
they contain are always computed between two same-section symbols. */
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
\f
-#define PRINT_OPERAND(FILE, X, CODE) \
- rx_print_operand (FILE, X, CODE)
-#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
- rx_print_operand_address (FILE, ADDR)
-\f
#define CC_NO_CARRY 0400
#define NOTICE_UPDATE_CC(EXP, INSN) rx_notice_update_cc (EXP, INSN)