summaryrefslogtreecommitdiff
path: root/gcc/double-int.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/double-int.c')
-rw-r--r--gcc/double-int.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/double-int.c b/gcc/double-int.c
index ab1975f09a9..5a7b51dbe31 100644
--- a/gcc/double-int.c
+++ b/gcc/double-int.c
@@ -72,8 +72,8 @@ double_int_zext (double_int cst, unsigned prec)
double_int mask = double_int_mask (prec);
double_int r;
- r.low = cst.low & ~mask.low;
- r.high = cst.high & ~mask.high;
+ r.low = cst.low & mask.low;
+ r.high = cst.high & mask.high;
return r;
}
@@ -96,13 +96,13 @@ double_int_sext (double_int cst, unsigned prec)
}
if (((snum >> (prec - 1)) & 1) == 1)
{
- r.low = cst.low | mask.low;
- r.high = cst.high | mask.high;
+ r.low = cst.low | ~mask.low;
+ r.high = cst.high | ~mask.high;
}
else
{
- r.low = cst.low & ~mask.low;
- r.high = cst.high & ~mask.high;
+ r.low = cst.low & mask.low;
+ r.high = cst.high & mask.high;
}
return r;