summaryrefslogtreecommitdiffstats
path: root/gcc/config/rs6000/rs6000.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/rs6000/rs6000.md')
-rw-r--r--gcc/config/rs6000/rs6000.md32
1 files changed, 22 insertions, 10 deletions
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 6bea69bd8ab..b0831c0105e 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1426,7 +1426,10 @@
HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
if (low & 0x8000)
- high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+ {
+ high = trunc_int_for_mode (high + 0x10000, SImode);
+ low = trunc_int_for_mode (low, HImode);
+ }
/* The ordering here is important for the prolog expander.
When space is allocated from the stack, adding 'low' first may
@@ -1537,7 +1540,10 @@
HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
if (low & 0x8000)
- high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+ {
+ high = trunc_int_for_mode (high + 0x10000, SImode);
+ low = trunc_int_for_mode (low, HImode);
+ }
operands[3] = GEN_INT (high);
operands[4] = GEN_INT (low);
@@ -5767,7 +5773,10 @@
HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
if (low & 0x8000)
- high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+ {
+ high = trunc_int_for_mode (high + 0x10000, SImode);
+ low = trunc_int_for_mode (low, HImode);
+ }
emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (high)));
emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low)));
@@ -5866,7 +5875,10 @@
HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
if (low & 0x8000)
- high+=0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+ {
+ high = trunc_int_for_mode (high + 0x10000, SImode);
+ low = trunc_int_for_mode (low, HImode);
+ }
operands[3] = GEN_INT (high);
operands[4] = GEN_INT (low);
@@ -7606,7 +7618,7 @@
else
operands[2] = gen_lowpart (SImode, operands[0]);
- operands[3] = GEN_INT(l);
+ operands[3] = GEN_INT (trunc_int_for_mode (l, SImode));
}")
(define_insn "*movsf_hardfloat"
@@ -7696,8 +7708,8 @@
operands[2] = operand_subword (operands[0], endian, 0, DFmode);
operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
- operands[4] = GEN_INT (l[endian]);
- operands[5] = GEN_INT (l[1 - endian]);
+ operands[4] = GEN_INT (trunc_int_for_mode (l[endian], SImode));
+ operands[5] = GEN_INT (trunc_int_for_mode (l[1 - endian], SImode));
}")
(define_split
@@ -8042,7 +8054,7 @@
(match_dup 3)))]
"
{
- operands[2] = GEN_INT (INTVAL (operands[1]) & 0xffff0000);
+ operands[2] = GEN_INT (INTVAL (operands[1]) & (~ (HOST_WIDE_INT) 0xffff));
operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
}")
@@ -8062,7 +8074,7 @@
(match_dup 3)))]
"
{
- operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[1]) & 0xffff0000);
+ operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[1]) & (~ (HOST_WIDE_INT) 0xffff));
operands[3] = GEN_INT (CONST_DOUBLE_LOW (operands[1]) & 0xffff);
}")
@@ -8083,7 +8095,7 @@
(match_dup 3)))]
"
{
- operands[2] = GEN_INT (INTVAL (operands[1]) & 0xffff0000);
+ operands[2] = GEN_INT (INTVAL (operands[1]) & (~ (HOST_WIDE_INT) 0xffff));
operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
}")
OpenPOWER on IntegriCloud