* config/nvptx/nvptx.h (HARD_REGNO_NREGS): Reformat.
(CANNOT_CHANGE_MODE_CLASS): Always return true.
(HARD_REGNO_MODE_OK): Reformat.
* config/nvptx/nvptx.md (define_expand mov<mode>): No
RETURN_REGNUM handling here.
* config/nvptx/nvptx.c (nvptx_function_value): Set ret_reg_mode
here.
(write_one_arg): No QI or HI mode args.
(write_fn_proto_from_insn): No argument promotion here.
(nvptx_output_return_insn): No return promotion here.
(nvptx_output_mov_insn): No RETURN_REGNUM handling needed.
(nvptx_output_call_insn): No return promotion here.
From-SVN: r231651
+2015-12-15 Nathan Sidwell <nathan@acm.org>
+
+ * config/nvptx/nvptx.h (HARD_REGNO_NREGS): Reformat.
+ (CANNOT_CHANGE_MODE_CLASS): Always return true.
+ (HARD_REGNO_MODE_OK): Reformat.
+ * config/nvptx/nvptx.md (define_expand mov<mode>): No
+ RETURN_REGNUM handling here.
+ * config/nvptx/nvptx.c (nvptx_function_value): Set ret_reg_mode
+ here.
+ (write_one_arg): No QI or HI mode args.
+ (write_fn_proto_from_insn): No argument promotion here.
+ (nvptx_output_return_insn): No return promotion here.
+ (nvptx_output_mov_insn): No RETURN_REGNUM handling needed.
+ (nvptx_output_call_insn): No return promotion here.
+
2015-12-15 Martin Jambor <mjambor@suse.cz>
PR ipa/68851
machine_mode mode = promote_return (TYPE_MODE (type));
if (outgoing)
- return gen_rtx_REG (mode, NVPTX_RETURN_REGNUM);
+ {
+ cfun->machine->ret_reg_mode = mode;
+ return gen_rtx_REG (mode, NVPTX_RETURN_REGNUM);
+ }
return nvptx_libcall_value (mode, NULL_RTX);
}
/* Writing PTX prototype. */
s << (argno ? ", " : " (");
s << ".param" << ptx_type << " %in_ar" << argno;
- if (mode == QImode || mode == HImode)
- s << "[1]";
}
else
{
this data, but more importantly for us, we must ensure it
doesn't change the PTX prototype. */
mode = (machine_mode) cfun->machine->ret_reg_mode;
+
if (mode == VOIDmode)
return return_in_mem;
if (result != NULL_RTX)
s << "(.param"
- << nvptx_ptx_type_from_mode (arg_promotion (GET_MODE (result)), false)
+ << nvptx_ptx_type_from_mode (GET_MODE (result), false)
<< " %rval) ";
s << name;
machine_mode mode = (machine_mode)cfun->machine->ret_reg_mode;
if (mode != VOIDmode)
- {
- mode = arg_promotion (mode);
- fprintf (asm_out_file, "\tst.param%s\t[%%out_retval], %%retval;\n",
- nvptx_ptx_type_from_mode (mode, false));
- }
+ fprintf (asm_out_file, "\tst.param%s\t[%%out_retval], %%retval;\n",
+ nvptx_ptx_type_from_mode (mode, false));
return "ret;";
}
machine_mode src_inner = (GET_CODE (src) == SUBREG
? GET_MODE (XEXP (src, 0)) : dst_mode);
- if (REG_P (dst) && REGNO (dst) == NVPTX_RETURN_REGNUM && dst_mode == HImode)
- /* Special handling for the return register. It's never really an
- HI object, and only occurs as the destination of a move
- insn. */
- dst_inner = SImode;
-
if (src_inner == dst_inner)
return "%.\tmov%t0\t%0, %1;";
fprintf (asm_out_file, "\t{\n");
if (result != NULL)
fprintf (asm_out_file, "\t\t.param%s %%retval_in;\n",
- nvptx_ptx_type_from_mode (arg_promotion (GET_MODE (result)),
- false));
+ nvptx_ptx_type_from_mode (GET_MODE (result), false));
/* Ensure we have a ptx declaration in the output if necessary. */
if (GET_CODE (callee) == SYMBOL_REF)
#define CALL_USED_REGISTERS \
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
-#define HARD_REGNO_NREGS(regno, mode) ((void)(regno), (void)(mode), 1)
-#define CANNOT_CHANGE_MODE_CLASS(M1, M2, CLS) ((CLS) == RETURN_REG)
-#define HARD_REGNO_MODE_OK(REG, MODE) nvptx_hard_regno_mode_ok (REG, MODE)
+#define HARD_REGNO_NREGS(REG, MODE) \
+ ((void)(REG), (void)(MODE), 1)
+#define CANNOT_CHANGE_MODE_CLASS(M1, M2, CLS) \
+ ((void)(M1), (void)(M2), (void)(CLS), true)
+#define HARD_REGNO_MODE_OK(REG, MODE) \
+ ((void)(REG), (void)(MODE), true)
/* Register Classes. */
""
{
operands[1] = nvptx_maybe_convert_symbolic_operand (operands[1]);
- /* Record the mode of the return register so that we can prevent
- later optimization passes from changing it. */
- if (REG_P (operands[0]) && REGNO (operands[0]) == NVPTX_RETURN_REGNUM
- && cfun)
- {
- if (cfun->machine->ret_reg_mode == VOIDmode)
- cfun->machine->ret_reg_mode = GET_MODE (operands[0]);
- else
- gcc_assert (cfun->machine->ret_reg_mode == GET_MODE (operands[0]));
- }
/* Hard registers are often actually symbolic operands on this target.
Don't allow them when storing to memory. */