aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/rs6000.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2001-09-20 02:35:00 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2001-09-19 22:35:00 -0400
commit40501e5f72f1d3dc0eac9d392cd8d7a5d4196035 (patch)
tree7111ceeada09720a99749ab721caffa5486a8fd4 /gcc/config/rs6000/rs6000.c
parente3aafbad8771a52e23ca48f58c7d2ad35381be31 (diff)
downloadgcc-40501e5f72f1d3dc0eac9d392cd8d7a5d4196035.zip
gcc-40501e5f72f1d3dc0eac9d392cd8d7a5d4196035.tar.gz
gcc-40501e5f72f1d3dc0eac9d392cd8d7a5d4196035.tar.bz2
revert: rs6000.c (logical_operand): CONST_INTs are already sign-extended.
2001-09-19 Alan Modra <amodra@bigpond.net.au> David Edelsohn <edelsohn@gnu.org> Revert: * config/rs6000/rs6000.c (logical_operand): CONST_INTs are already sign-extended. * config/rs6000/aix.h (INIT_TARGET_OPTABS): Define TFmode handlers. * config/rs6000/rs6000.c (logical_operand): Streamline comparison with HOST_WIDE_INT. (rs6000_emit_set_long_const): Avoid unnecessary shift. (output_profile_hook): Declare label_name const. * config/rs6000/rs6000.md (boolcsi3, boolcdi3): Change predicates to match constraints. Co-Authored-By: David Edelsohn <edelsohn@gnu.org> From-SVN: r45699
Diffstat (limited to 'gcc/config/rs6000/rs6000.c')
-rw-r--r--gcc/config/rs6000/rs6000.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 3cbb3aa..c1b1f71 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1104,36 +1104,35 @@ logical_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- /* an unsigned representation of 'op'. */
- unsigned HOST_WIDE_INT opl, oph;
+ HOST_WIDE_INT opl, oph;
if (gpc_reg_operand (op, mode))
return 1;
if (GET_CODE (op) == CONST_INT)
- opl = INTVAL (op);
+ {
+ opl = INTVAL (op) & GET_MODE_MASK (mode);
+
+#if HOST_BITS_PER_WIDE_INT <= 32
+ if (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT && opl < 0)
+ return 0;
+#endif
+ }
else if (GET_CODE (op) == CONST_DOUBLE)
{
if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
- abort();
+ abort ();
opl = CONST_DOUBLE_LOW (op);
oph = CONST_DOUBLE_HIGH (op);
-
- if (oph != ((unsigned HOST_WIDE_INT)0
- - ((opl & ((unsigned HOST_WIDE_INT)1
- << (HOST_BITS_PER_WIDE_INT - 1))) != 0)))
+ if (oph != 0)
return 0;
}
else
return 0;
- /* This must really be SImode, not MODE. */
- if (opl != (unsigned HOST_WIDE_INT) trunc_int_for_mode (opl, SImode))
- return 0;
-
- return ((opl & 0xffff) == 0
- || (opl & ~ (unsigned HOST_WIDE_INT) 0xffff) == 0);
+ return ((opl & ~ (unsigned HOST_WIDE_INT) 0xffff) == 0
+ || (opl & ~ (unsigned HOST_WIDE_INT) 0xffff0000) == 0);
}
/* Return 1 if C is a constant that is not a logical operand (as
@@ -1740,10 +1739,10 @@ rs6000_emit_set_long_const (dest, c1, c2)
#endif
/* Construct the high word */
- if (d4)
+ if (d4 != 0)
{
emit_move_insn (dest, GEN_INT (d4));
- if (d3)
+ if (d3 != 0)
emit_move_insn (dest,
gen_rtx_PLUS (DImode, dest, GEN_INT (d3)));
}
@@ -1751,12 +1750,13 @@ rs6000_emit_set_long_const (dest, c1, c2)
emit_move_insn (dest, GEN_INT (d3));
/* Shift it into place */
- emit_move_insn (dest, gen_rtx_ASHIFT (DImode, dest, GEN_INT (32)));
+ if (d3 != 0 || d4 != 0)
+ emit_move_insn (dest, gen_rtx_ASHIFT (DImode, dest, GEN_INT (32)));
/* Add in the low bits. */
- if (d2)
+ if (d2 != 0)
emit_move_insn (dest, gen_rtx_PLUS (DImode, dest, GEN_INT (d2)));
- if (d1)
+ if (d1 != 0)
emit_move_insn (dest, gen_rtx_PLUS (DImode, dest, GEN_INT (d1)));
}
@@ -7834,7 +7834,7 @@ output_profile_hook (labelno)
if (DEFAULT_ABI == ABI_AIX)
{
char buf[30];
- char *label_name;
+ const char *label_name;
rtx fun;
labelno += 1;