Commit 31e727b0 by Nick Clifton Committed by Nick Clifton

rx.h (PTRDIFF_TYPE): Define.

        * 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.

From-SVN: r161068
parent b361b153
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> 2010-06-21 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (POD2MAN): Provide --date from $(DATESTAMP). * Makefile.in (POD2MAN): Provide --date from $(DATESTAMP).
......
...@@ -41,8 +41,6 @@ extern bool rx_is_legitimate_constant (rtx); ...@@ -41,8 +41,6 @@ extern bool rx_is_legitimate_constant (rtx);
extern bool rx_is_mode_dependent_addr (rtx); extern bool rx_is_mode_dependent_addr (rtx);
extern bool rx_is_restricted_memory_address (rtx, Mmode); extern bool rx_is_restricted_memory_address (rtx, Mmode);
extern void rx_notice_update_cc (rtx body, rtx insn); extern void rx_notice_update_cc (rtx body, rtx insn);
extern void rx_print_operand (FILE *, rtx, int);
extern void rx_print_operand_address (FILE *, rtx);
#endif #endif
#ifdef TREE_CODE #ifdef TREE_CODE
......
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
#include "target-def.h" #include "target-def.h"
#include "langhooks.h" #include "langhooks.h"
static void rx_print_operand (FILE *, rtx, int);
enum rx_cpu_types rx_cpu_type = RX600; enum rx_cpu_types rx_cpu_type = RX600;
/* Return true if OP is a reference to an object in a small data area. */ /* Return true if OP is a reference to an object in a small data area. */
...@@ -254,7 +256,7 @@ rx_is_mode_dependent_addr (rtx addr) ...@@ -254,7 +256,7 @@ rx_is_mode_dependent_addr (rtx addr)
assembler syntax for an instruction operand that is a memory assembler syntax for an instruction operand that is a memory
reference whose address is ADDR. */ reference whose address is ADDR. */
void static void
rx_print_operand_address (FILE * file, rtx addr) rx_print_operand_address (FILE * file, rtx addr)
{ {
switch (GET_CODE (addr)) switch (GET_CODE (addr))
...@@ -362,10 +364,11 @@ int rx_float_compare_mode; ...@@ -362,10 +364,11 @@ int rx_float_compare_mode;
%F Print a condition code flag name. %F Print a condition code flag name.
%H Print high part of a DImode register, integer or address. %H Print high part of a DImode register, integer or address.
%L Print low 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 %Q If the operand is a MEM, then correctly generate
register indirect or register relative addressing. */ register indirect or register relative addressing. */
void static void
rx_print_operand (FILE * file, rtx op, int letter) rx_print_operand (FILE * file, rtx op, int letter)
{ {
switch (letter) switch (letter)
...@@ -422,7 +425,7 @@ rx_print_operand (FILE * file, rtx op, int letter) ...@@ -422,7 +425,7 @@ rx_print_operand (FILE * file, rtx op, int letter)
case 0xc: fprintf (file, "intb"); break; case 0xc: fprintf (file, "intb"); break;
default: default:
warning (0, "unreocgnized control register number: %d - using 'psw'", warning (0, "unreocgnized control register number: %d - using 'psw'",
INTVAL (op)); (int) INTVAL (op));
fprintf (file, "psw"); fprintf (file, "psw");
break; break;
} }
...@@ -444,43 +447,57 @@ rx_print_operand (FILE * file, rtx op, int letter) ...@@ -444,43 +447,57 @@ rx_print_operand (FILE * file, rtx op, int letter)
break; break;
case 'H': case 'H':
if (REG_P (op)) switch (GET_CODE (op))
fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 0 : 1)]);
else if (CONST_INT_P (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, "#"); fprintf (file, "#");
/* Trickery to avoid problems with shifting 32 bits at a time. */ rx_print_integer (file, CONST_DOUBLE_HIGH (op));
v = v >> 16; break;
v = v >> 16; case MEM:
rx_print_integer (file, v);
}
else
{
gcc_assert (MEM_P (op));
if (! WORDS_BIG_ENDIAN) if (! WORDS_BIG_ENDIAN)
op = adjust_address (op, SImode, 4); op = adjust_address (op, SImode, 4);
output_address (XEXP (op, 0)); output_address (XEXP (op, 0));
break;
default:
gcc_unreachable ();
} }
break; break;
case 'L': case 'L':
if (REG_P (op)) switch (GET_CODE (op))
fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 1 : 0)]);
else if (CONST_INT_P (op))
{ {
case REG:
fprintf (file, "%s", reg_names [REGNO (op) + (WORDS_BIG_ENDIAN ? 1 : 0)]);
break;
case CONST_INT:
fprintf (file, "#"); fprintf (file, "#");
rx_print_integer (file, INTVAL (op) & 0xffffffff); rx_print_integer (file, INTVAL (op) & 0xffffffff);
} break;
else case CONST_DOUBLE:
{ fprintf (file, "#");
gcc_assert (MEM_P (op)); rx_print_integer (file, CONST_DOUBLE_LOW (op));
break;
case MEM:
if (WORDS_BIG_ENDIAN) if (WORDS_BIG_ENDIAN)
op = adjust_address (op, SImode, 4); op = adjust_address (op, SImode, 4);
output_address (XEXP (op, 0)); output_address (XEXP (op, 0));
break;
default:
gcc_unreachable ();
} }
break; break;
...@@ -634,7 +651,7 @@ rx_print_operand (FILE * file, rtx op, int letter) ...@@ -634,7 +651,7 @@ rx_print_operand (FILE * file, rtx op, int letter)
char * char *
rx_gen_move_template (rtx * operands, bool is_movu) 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 * extension = TARGET_AS100_SYNTAX ? ".L" : "";
const char * src_template; const char * src_template;
const char * dst_template; const char * dst_template;
...@@ -678,9 +695,9 @@ rx_gen_move_template (rtx * operands, bool is_movu) ...@@ -678,9 +695,9 @@ rx_gen_move_template (rtx * operands, bool is_movu)
else else
dst_template = "%0"; 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); extension, src_template, dst_template);
return template; return out_template;
} }
/* Returns an assembler template for a conditional branch instruction. */ /* Returns an assembler template for a conditional branch instruction. */
...@@ -690,7 +707,6 @@ rx_gen_cond_branch_template (rtx condition, bool reversed) ...@@ -690,7 +707,6 @@ rx_gen_cond_branch_template (rtx condition, bool reversed)
{ {
enum rtx_code code = GET_CODE (condition); enum rtx_code code = GET_CODE (condition);
if ((cc_status.flags & CC_NO_OVERFLOW) && ! rx_float_compare_mode) if ((cc_status.flags & CC_NO_OVERFLOW) && ! rx_float_compare_mode)
gcc_assert (code != GT && code != GE && code != LE && code != LT); gcc_assert (code != GT && code != GE && code != LE && code != LT);
...@@ -777,6 +793,9 @@ rx_function_arg (Fargs * cum, Mmode mode, const_tree type, bool named) ...@@ -777,6 +793,9 @@ rx_function_arg (Fargs * cum, Mmode mode, const_tree type, bool named)
/* An exploded version of rx_function_arg_size. */ /* An exploded version of rx_function_arg_size. */
size = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); 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); rounded_size = rx_round_up (size, UNITS_PER_WORD);
...@@ -2585,6 +2604,12 @@ rx_trampoline_init (rtx tramp, tree fndecl, rtx chain) ...@@ -2585,6 +2604,12 @@ rx_trampoline_init (rtx tramp, tree fndecl, rtx chain)
#undef TARGET_TRAMPOLINE_INIT #undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT rx_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; struct gcc_target targetm = TARGET_INITIALIZER;
/* #include "gt-rx.h" */ /* #include "gt-rx.h" */
...@@ -142,6 +142,8 @@ extern enum rx_cpu_types rx_cpu_type; ...@@ -142,6 +142,8 @@ extern enum rx_cpu_types rx_cpu_type;
#define POINTER_SIZE 32 #define POINTER_SIZE 32
#undef SIZE_TYPE #undef SIZE_TYPE
#define SIZE_TYPE "long unsigned int" #define SIZE_TYPE "long unsigned int"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
#define POINTERS_EXTEND_UNSIGNED 1 #define POINTERS_EXTEND_UNSIGNED 1
#define FUNCTION_MODE QImode #define FUNCTION_MODE QImode
#define CASE_VECTOR_MODE Pmode #define CASE_VECTOR_MODE Pmode
...@@ -196,6 +198,7 @@ enum reg_class ...@@ -196,6 +198,7 @@ enum reg_class
GR_REGS, LIM_REG_CLASSES \ GR_REGS, LIM_REG_CLASSES \
} }
#define SMALL_REGISTER_CLASSES 0
#define N_REG_CLASSES (int) LIM_REG_CLASSES #define N_REG_CLASSES (int) LIM_REG_CLASSES
#define CLASS_MAX_NREGS(CLASS, MODE) ((GET_MODE_SIZE (MODE) \ #define CLASS_MAX_NREGS(CLASS, MODE) ((GET_MODE_SIZE (MODE) \
+ UNITS_PER_WORD - 1) \ + UNITS_PER_WORD - 1) \
...@@ -607,11 +610,6 @@ typedef unsigned int CUMULATIVE_ARGS; ...@@ -607,11 +610,6 @@ typedef unsigned int CUMULATIVE_ARGS;
they contain are always computed between two same-section symbols. */ they contain are always computed between two same-section symbols. */
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic) #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
#define PRINT_OPERAND(FILE, X, CODE) \
rx_print_operand (FILE, X, CODE)
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
rx_print_operand_address (FILE, ADDR)
#define CC_NO_CARRY 0400 #define CC_NO_CARRY 0400
#define NOTICE_UPDATE_CC(EXP, INSN) rx_notice_update_cc (EXP, INSN) #define NOTICE_UPDATE_CC(EXP, INSN) rx_notice_update_cc (EXP, INSN)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment