aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Edelsohn <edelsohn@gnu.org>2002-08-19 16:32:54 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2002-08-19 12:32:54 -0400
commitaf8cb5c5e8b60bb02d1726688bc050a0f5c285c9 (patch)
treea0a941e0b5ffc044f6d6f5170956e4c85497cfc1 /gcc
parent9bc146b3686d30f21b09ab1996689bfd520800cb (diff)
downloadgcc-af8cb5c5e8b60bb02d1726688bc050a0f5c285c9.zip
gcc-af8cb5c5e8b60bb02d1726688bc050a0f5c285c9.tar.gz
gcc-af8cb5c5e8b60bb02d1726688bc050a0f5c285c9.tar.bz2
rs6000.c (rs6000_emit_set_const): Inline multi-instruction SImode constant.
* config/rs6000/rs6000.c (rs6000_emit_set_const): Inline multi-instruction SImode constant. Add REG_EQUAL note. * config/rs6000/rs6000.md (movsi splitter): Use rs6000_emit_set_const. From-SVN: r56439
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/rs6000/rs6000.c46
-rw-r--r--gcc/config/rs6000/rs6000.md9
3 files changed, 48 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8675cf0..8d3077e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2002-08-19 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_emit_set_const): Inline
+ multi-instruction SImode constant. Add REG_EQUAL note.
+ * config/rs6000/rs6000.md (movsi splitter): Use
+ rs6000_emit_set_const.
+
2002-08-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* tree-inline.c (initialize_inlined_parameters): Wrap variable in
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 5b69dd5..399608a 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -2368,35 +2368,59 @@ rs6000_emit_set_const (dest, mode, source, n)
enum machine_mode mode;
int n ATTRIBUTE_UNUSED;
{
+ rtx result, insn, set;
HOST_WIDE_INT c0, c1;
- if (mode == QImode || mode == HImode || mode == SImode)
+ if (mode == QImode || mode == HImode)
{
if (dest == NULL)
dest = gen_reg_rtx (mode);
emit_insn (gen_rtx_SET (VOIDmode, dest, source));
return dest;
}
-
- if (GET_CODE (source) == CONST_INT)
+ else if (mode == SImode)
{
- c0 = INTVAL (source);
- c1 = -(c0 < 0);
+ result = no_new_pseudos ? dest : gen_reg_rtx (SImode);
+
+ emit_insn (gen_rtx_SET (VOIDmode, result,
+ GEN_INT (INTVAL (source)
+ & (~ (HOST_WIDE_INT) 0xffff))));
+ emit_insn (gen_rtx_SET (VOIDmode, dest,
+ gen_rtx_IOR (SImode, result,
+ GEN_INT (INTVAL (source) & 0xffff))));
+ result = dest;
}
- else if (GET_CODE (source) == CONST_DOUBLE)
+ else if (mode == DImode)
{
+ if (GET_CODE (source) == CONST_INT)
+ {
+ c0 = INTVAL (source);
+ c1 = -(c0 < 0);
+ }
+ else if (GET_CODE (source) == CONST_DOUBLE)
+ {
#if HOST_BITS_PER_WIDE_INT >= 64
- c0 = CONST_DOUBLE_LOW (source);
- c1 = -(c0 < 0);
+ c0 = CONST_DOUBLE_LOW (source);
+ c1 = -(c0 < 0);
#else
- c0 = CONST_DOUBLE_LOW (source);
- c1 = CONST_DOUBLE_HIGH (source);
+ c0 = CONST_DOUBLE_LOW (source);
+ c1 = CONST_DOUBLE_HIGH (source);
#endif
+ }
+ else
+ abort ();
+
+ result = rs6000_emit_set_long_const (dest, c0, c1);
}
else
abort ();
- return rs6000_emit_set_long_const (dest, c0, c1);
+ insn = get_last_insn ();
+ set = single_set (insn);
+ if (! CONSTANT_P (SET_SRC (set)))
+ set_unique_reg_note (insn, REG_EQUAL, source);
+
+ return result;
}
/* Having failed to find a 3 insn sequence in rs6000_emit_set_const,
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 4a441e2..c3ff213 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8215,9 +8215,12 @@
(ior:SI (match_dup 0)
(match_dup 3)))]
"
-{
- operands[2] = GEN_INT (INTVAL (operands[1]) & (~ (HOST_WIDE_INT) 0xffff));
- operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
+{ rtx tem = rs6000_emit_set_const (operands[0], SImode, operands[1], 2);
+
+ if (tem == operands[0])
+ DONE;
+ else
+ FAIL;
}")
(define_insn "*movsi_internal2"