diff --git a/gcc/config/or1k/or1k.c b/gcc/config/or1k/or1k.c index 6ec3d57be50c..4805535d00d0 100644 --- a/gcc/config/or1k/or1k.c +++ b/gcc/config/or1k/or1k.c @@ -26,13 +26,20 @@ #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 "df.h" +#include "tm.h" +#include "tm_p.h" +#include "stringpool.h" +#include "optabs.h" #include "hash-set.h" +#include "emit-rtl.h" +#include "recog.h" #include "inchash.h" #include "symtab.h" -#include "tree.h" -#include "stringpool.h" #include "stor-layout.h" #include "calls.h" #include "varasm.h" @@ -48,24 +55,19 @@ #include "reload.h" #include "function.h" #include "explow.h" -#include "emit-rtl.h" #include "expr.h" #include "toplev.h" -#include "recog.h" #include "ggc.h" #include "except.h" -#include "tm_p.h" -#include "target.h" #include "target-def.h" #include "debug.h" #include "langhooks.h" #include "predict.h" #include "basic-block.h" -#include "df.h" -#include "optabs.h" #include "dwarf2.h" #include "ansidecl.h" #include "builtins.h" +#include "sbitmap.h" /* ========================================================================== */ /* Local macros */ @@ -379,7 +381,7 @@ or1k_expand_int_compare (enum rtx_code code, /* This is very simple, but making the interface the same as in the FP case makes the rest of the code easier. */ tmp = gen_rtx_COMPARE (cmpmode, op0, op1); - emit_insn (gen_rtx_SET (VOIDmode, flags, tmp)); + emit_insn (gen_rtx_SET (flags, tmp)); /* Return the test that should be put into the flags user, i.e. the bcc, scc, or cmov instruction. */ @@ -434,14 +436,14 @@ or1k_expand_cmpxchg_qihi (rtx bval, rtx retval, rtx mem, rtx oldval, rtx newval, mask_const = gen_rtx_CONST_INT (VOIDmode, mode == QImode ? 0xff : 0xffff); - emit_insn (gen_rtx_SET (VOIDmode, mask, mask_const)); + emit_insn (gen_rtx_SET (mask, mask_const)); /* align address and retrieve the offset. */ - emit_insn (gen_rtx_SET (VOIDmode, addr, + emit_insn (gen_rtx_SET (addr, gen_rtx_AND (Pmode, addr1, GEN_INT (-4)))); - emit_insn (gen_rtx_SET (VOIDmode, off, + emit_insn (gen_rtx_SET (off, gen_rtx_AND (SImode, addr1, GEN_INT (3)))); - emit_insn (gen_rtx_SET (VOIDmode, off, + emit_insn (gen_rtx_SET (off, gen_rtx_XOR (SImode, off, GEN_INT (GET_MODE (mem) == QImode ? 3 : 2)))); @@ -450,7 +452,7 @@ or1k_expand_cmpxchg_qihi (rtx bval, rtx retval, rtx mem, rtx oldval, rtx newval, /* shift all arguments to be aligned to where the data we want * to operate on is located. */ - emit_insn (gen_rtx_SET (VOIDmode, shifter, + emit_insn (gen_rtx_SET (shifter, gen_rtx_ASHIFT (SImode, off, GEN_INT (3)))); emit_insn (gen_ashlsi3 (shifted_oldval, oldval, shifter)); @@ -490,14 +492,14 @@ or1k_expand_fetch_op_qihi (rtx oldval, rtx mem, rtx operand, rtx newval, mask_const = gen_rtx_CONST_INT (VOIDmode, mode == QImode ? 0xff : 0xffff); - emit_insn (gen_rtx_SET (VOIDmode, mask, mask_const)); + emit_insn (gen_rtx_SET (mask, mask_const)); /* align address and retrieve the offset. */ - emit_insn (gen_rtx_SET (VOIDmode, addr, + emit_insn (gen_rtx_SET (addr, gen_rtx_AND (Pmode, addr1, GEN_INT (-4)))); - emit_insn (gen_rtx_SET (VOIDmode, off, + emit_insn (gen_rtx_SET (off, gen_rtx_AND (SImode, addr1, GEN_INT (3)))); - emit_insn (gen_rtx_SET (VOIDmode, off, + emit_insn (gen_rtx_SET (off, gen_rtx_XOR (SImode, off, GEN_INT (GET_MODE (mem) == QImode ? 3 : 2)))); @@ -506,7 +508,7 @@ or1k_expand_fetch_op_qihi (rtx oldval, rtx mem, rtx operand, rtx newval, /* shift all arguments to be aligned to where the data we want * to operate on is located. */ - emit_insn (gen_rtx_SET (VOIDmode, shifter, + emit_insn (gen_rtx_SET (shifter, gen_rtx_ASHIFT (SImode, off, GEN_INT (3)))); emit_insn (gen_ashlsi3 (shifted_operand, operand, shifter)); @@ -565,7 +567,7 @@ or1k_emit_int_cmove (rtx dest, static void -or1k_print_operand_address (FILE *stream, rtx addr) +or1k_print_operand_address (FILE *stream, machine_mode /* mode */, rtx addr) { rtx offset; @@ -595,7 +597,7 @@ or1k_print_operand_address (FILE *stream, rtx addr) offset = XEXP (addr, 0); addr = XEXP (addr, 1); } - output_address (offset); + output_address (GET_MODE(addr), offset); fprintf (stream, "(%s)", reg_names[REGNO (addr)]); break; @@ -999,7 +1001,7 @@ or1k_emit_binary (enum rtx_code code, rtx op0, rtx op1) { - emit_insn (gen_rtx_SET (VOIDmode, target, + emit_insn (gen_rtx_SET (target, gen_rtx_fmt_ee (code, GET_MODE (target), op0, op1))); } /* or1k_emit_binary () */ @@ -1102,8 +1104,7 @@ or1k_expand_prologue (void) GEN_INT (-frame_info.gpr_frame))); if (frame_info.save_fp_p) { - emit_frame_insn (gen_rtx_SET (Pmode, - stack_disp_mem (frame_info.fp_save_offset), + emit_frame_insn (gen_rtx_SET (stack_disp_mem (frame_info.fp_save_offset), hard_frame_pointer_rtx)); emit_frame_insn @@ -1112,7 +1113,7 @@ or1k_expand_prologue (void) if (frame_info.save_lr_p) { emit_frame_insn - (gen_rtx_SET (Pmode, stack_disp_mem (frame_info.lr_save_offset), + (gen_rtx_SET (stack_disp_mem (frame_info.lr_save_offset), gen_rtx_REG (Pmode, LINK_REGNUM))); } if (frame_info.gpr_size) @@ -1134,8 +1135,7 @@ or1k_expand_prologue (void) != frame_info.fp_save_offset)); emit_frame_insn - (gen_rtx_SET (Pmode, - stack_disp_mem (frame_info.gpr_offset + offset), + (gen_rtx_SET (stack_disp_mem (frame_info.gpr_offset + offset), gen_rtx_REG (Pmode, regno))); offset = offset + UNITS_PER_WORD; } @@ -1194,7 +1194,7 @@ or1k_expand_epilogue (void) { emit_insn (gen_frame_dealloc_fp ()); emit_insn - (gen_rtx_SET (Pmode, hard_frame_pointer_rtx, + (gen_rtx_SET (hard_frame_pointer_rtx, stack_disp_mem (frame_info.fp_save_offset))); } else @@ -1217,7 +1217,7 @@ or1k_expand_epilogue (void) if (frame_info.save_lr_p && !crtl->calls_eh_return) { emit_insn - (gen_rtx_SET (Pmode, gen_rtx_REG (Pmode, LINK_REGNUM), + (gen_rtx_SET (gen_rtx_REG (Pmode, LINK_REGNUM), stack_disp_mem (frame_info.lr_save_offset))); } @@ -1233,7 +1233,7 @@ or1k_expand_epilogue (void) if (regno != FIRST_PSEUDO_REGISTER) emit_insn - (gen_rtx_SET (Pmode, gen_rtx_REG (Pmode, regno), + (gen_rtx_SET (gen_rtx_REG (Pmode, regno), stack_disp_mem (frame_info.gpr_offset + offset))); offset = offset + UNITS_PER_WORD; } @@ -1414,7 +1414,7 @@ or1k_expand_conditional_branch (rtx *operands, tmp, gen_rtx_LABEL_REF (VOIDmode, operands[3]), pc_rtx); - emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp)); + emit_jump_insn (gen_rtx_SET (pc_rtx, tmp)); return; case SFmode: @@ -1423,7 +1423,7 @@ or1k_expand_conditional_branch (rtx *operands, tmp, gen_rtx_LABEL_REF (VOIDmode, operands[3]), pc_rtx); - emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp)); + emit_jump_insn (gen_rtx_SET (pc_rtx, tmp)); return; default: @@ -1554,12 +1554,11 @@ or1k_emit_set_const32 (rtx op0, /* Emit them as real moves instead of a HIGH/LO_SUM, this way CSE can see everything and reuse intermediate values if it wants. */ - emit_insn (gen_rtx_SET (VOIDmode, temp, + emit_insn (gen_rtx_SET (temp, GEN_INT (INTVAL (op1) & ~(HOST_WIDE_INT) 0xffff))); - emit_insn (gen_rtx_SET (VOIDmode, - op0, + emit_insn (gen_rtx_SET (op0, gen_rtx_IOR (mode, temp, GEN_INT (INTVAL (op1) & 0xffff)))); } diff --git a/gcc/config/or1k/or1k.h b/gcc/config/or1k/or1k.h index 3444c57fd300..8447497b8413 100644 --- a/gcc/config/or1k/or1k.h +++ b/gcc/config/or1k/or1k.h @@ -166,7 +166,7 @@ Boston, MA 02111-1307, USA. */ /* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. */ -#define WORD_REGISTER_OPERATIONS /* CHECK */ +#define WORD_REGISTER_OPERATIONS 1 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD @@ -344,9 +344,6 @@ Boston, MA 02111-1307, USA. */ is passed to a function. */ /*#define STRUCT_VALUE_REGNUM 0*/ -/* Pass address of result struct to callee as "invisible" first argument */ -#define STRUCT_VALUE 0 - /* -----------------------[ PHX start ]-------------------------------- */ /* Define the classes of registers for register constraints in the @@ -1153,7 +1150,7 @@ enum reg_class else if (GET_CODE (x) == REG) \ fprintf (stream, "%s", reg_names[REGNO (x)]); \ else if (GET_CODE (x) == MEM) \ - output_address (XEXP (x, 0)); \ + output_address (GET_MODE(x), XEXP (x, 0)); \ else \ output_addr_const (stream, x); \ } diff --git a/gcc/config/or1k/or1k.md b/gcc/config/or1k/or1k.md index 4855a32e34fb..a25585a31a33 100644 --- a/gcc/config/or1k/or1k.md +++ b/gcc/config/or1k/or1k.md @@ -192,7 +192,7 @@ { rtx reg = gen_reg_rtx (SImode); - emit_insn (gen_rtx_SET (SImode, reg, + emit_insn (gen_rtx_SET (reg, gen_rtx_ZERO_EXTEND (SImode, operands[1]))); @@ -238,7 +238,7 @@ { rtx reg = gen_reg_rtx (SImode); - emit_insn (gen_rtx_SET (SImode, reg, + emit_insn (gen_rtx_SET (reg, gen_rtx_ZERO_EXTEND (SImode, operands[1]))); operands[1] = gen_lowpart (HImode, reg); diff --git a/gcc/config/or1k/or1k.opt b/gcc/config/or1k/or1k.opt index 019d923f0adc..9bd0ce56a6e2 100644 --- a/gcc/config/or1k/or1k.opt +++ b/gcc/config/or1k/or1k.opt @@ -25,63 +25,63 @@ enum or1k_delay or1k_delay_selected = OR1K_DELAY_DEFAULT mdelay Target RejectNegative Negative(mno-delay) Var(or1k_delay_selected, OR1K_DELAY_ON) -Assume branches and jumps have a delay slot +Assume branches and jumps have a delay slot. mno-delay Target RejectNegative Negative(mcompat-delay) Var(or1k_delay_selected, OR1K_DELAY_OFF) -Assume branches and jumps do not have a delay slot +Assume branches and jumps do not have a delay slot. mcompat-delay Target RejectNegative Negative(mdelay) Var(or1k_delay_selected, OR1K_DELAY_COMPAT) -Assume branches and jumps have a delay slot, but fill them with nops +Assume branches and jumps have a delay slot, but fill them with nops. mhard-float Target RejectNegative Mask(HARD_FLOAT) -Use hardware floating point +Use hardware floating point. msoft-float Target RejectNegative InverseMask(HARD_FLOAT) -Do not use hardware floating point +Do not use hardware floating point. mdouble-float Target Report RejectNegative Mask(DOUBLE_FLOAT) -Allow hardware floating-point instructions to cover both 32-bit and 64-bit operations +Allow hardware floating-point instructions to cover both 32-bit and 64-bit operations. mhard-div Target RejectNegative Mask(HARD_DIV) -Use hardware division +Use hardware division. msoft-div Target RejectNegative InverseMask(HARD_DIV) -Do not use hardware division +Do not use hardware division. mhard-mul Target RejectNegative Mask(HARD_MUL) -Use hardware multiplication +Use hardware multiplication. msoft-mul Target RejectNegative InverseMask(HARD_MUL) -Do not use hardware multiplication +Do not use hardware multiplication. msext Target Mask(MASK_SEXT) -Use sign-extending instructions +Use sign-extending instructions. mcmov Target Mask(MASK_CMOV) -Use conditional move instructions +Use conditional move instructions. mror Target Mask(MASK_ROR) -Emit ROR instructions +Emit ROR instructions. mboard= Target RejectNegative Joined -Link with libgloss configuration suitable for this board +Link with libgloss configuration suitable for this board. mnewlib Target Report RejectNegative -Compile for the Linux/Gnu/newlib based toolchain +Compile for the Linux/Gnu/newlib based toolchain. ;; provide struct padding as in previous releases. ;; Note that this will only affect STRUCTURE_SIZE_BOUNDARY, in particular @@ -89,7 +89,7 @@ Compile for the Linux/Gnu/newlib based toolchain ;; We still use ROUND_TYPE_ALIGN to increase alignment of larger structs. mpadstruct Target Report RejectNegative Mask(PADSTRUCT) -Make structs a multiple of 4 bytes (warning: ABI altered) +Make structs a multiple of 4 bytes (warning: ABI altered). mredzone= Target RejectNegative Joined UInteger Var(or1k_redzone) Init(128)