aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2015-12-15 13:32:48 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2015-12-15 13:32:48 +0000
commit5c036f3f0a3ca5980709c385477e0b0af1dbcd30 (patch)
treed1a7930f210ebcc6a10b143ae571621ea014be8d /gcc
parent1fceb21584e9176c22775f00641ee1fcb8c62798 (diff)
downloadgcc-5c036f3f0a3ca5980709c385477e0b0af1dbcd30.zip
gcc-5c036f3f0a3ca5980709c385477e0b0af1dbcd30.tar.gz
gcc-5c036f3f0a3ca5980709c385477e0b0af1dbcd30.tar.bz2
nvptx.h (HARD_REGNO_NREGS): Reformat.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/config/nvptx/nvptx.c26
-rw-r--r--gcc/config/nvptx/nvptx.h9
-rw-r--r--gcc/config/nvptx/nvptx.md10
4 files changed, 30 insertions, 30 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9b81b481..ca50fba 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+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
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index bb4c384..0fe389f 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -516,7 +516,10 @@ nvptx_function_value (const_tree type, const_tree ARG_UNUSED (func),
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);
}
@@ -586,8 +589,6 @@ write_one_arg (std::stringstream &s, int for_reg, int argno, machine_mode mode)
/* Writing PTX prototype. */
s << (argno ? ", " : " (");
s << ".param" << ptx_type << " %in_ar" << argno;
- if (mode == QImode || mode == HImode)
- s << "[1]";
}
else
{
@@ -674,6 +675,7 @@ write_return (std::stringstream &s, bool for_proto, tree type)
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;
@@ -834,7 +836,7 @@ write_fn_proto_from_insn (std::stringstream &s, const char *name,
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;
@@ -1049,11 +1051,8 @@ nvptx_output_return (void)
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;";
}
@@ -1804,12 +1803,6 @@ nvptx_output_mov_insn (rtx dst, rtx src)
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;";
@@ -1841,8 +1834,7 @@ nvptx_output_call_insn (rtx_insn *insn, rtx result, rtx callee)
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)
diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index ed0f28e..2015c11 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -90,9 +90,12 @@
#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. */
diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md
index b0da63e..4368225 100644
--- a/gcc/config/nvptx/nvptx.md
+++ b/gcc/config/nvptx/nvptx.md
@@ -280,16 +280,6 @@
""
{
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. */