#include "tm.h"
#include "rtl.h"
#include "tree.h"
+#include "varasm.h"
#include "tm_p.h"
#include "regs.h"
#include "hard-reg-set.h"
{
offset += bitpos / BITS_PER_UNIT;
if (toffset)
- offset += tree_to_hwi (toffset);
+ offset += tree_to_shwi (toffset);
}
break;
}
a dangerous assumption as many times CONST_INTs are
created and used with garbage in the bits outside of the
precision of the implied mode of the const_int. */
- op_mode = mode_for_size (MAX_BITSIZE_MODE_ANY_INT, MODE_INT, 0);
+ op_mode = MAX_MODE_INT;
}
real_from_integer (&d, mode, std::make_pair (op, op_mode), SIGNED);
a dangerous assumption as many times CONST_INTs are
created and used with garbage in the bits outside of the
precision of the implied mode of the const_int. */
- op_mode = mode_for_size (MAX_BITSIZE_MODE_ANY_INT, MODE_INT, 0);
+ op_mode = MAX_MODE_INT;
}
real_from_integer (&d, mode, std::make_pair (op, op_mode), UNSIGNED);
case CLRSB:
result = wi::shwi (wi::clrsb (op0), mode);
break;
-
+
case CTZ:
result = wi::shwi (wi::ctz (op0), mode);
break;
else if (GET_CODE (rhs) == MULT
&& CONST_INT_P (XEXP (rhs, 1)))
{
- negcoeff1 = -wide_int (std::make_pair (XEXP (rhs, 1), mode));
+ negcoeff1 = wi::neg (std::make_pair (XEXP (rhs, 1), mode));
rhs = XEXP (rhs, 0);
}
else if (GET_CODE (rhs) == ASHIFT
if (CONST_SCALAR_INT_P (trueop1))
{
val = wi::exact_log2 (std::make_pair (trueop1, mode));
- if (val >= 0 && val < GET_MODE_BITSIZE (mode))
+ if (val >= 0)
return simplify_gen_binary (ASHIFT, mode, op0, GEN_INT (val));
}
{
wide_int result;
bool overflow;
- unsigned int bitsize = GET_MODE_BITSIZE (mode);
rtx_mode_t pop0 = std::make_pair (op0, mode);
rtx_mode_t pop1 = std::make_pair (op1, mode);
case LSHIFTRT:
case ASHIFTRT:
case ASHIFT:
- case ROTATE:
- case ROTATERT:
{
wide_int wop1 = pop1;
- if (wi::neg_p (wop1))
- return NULL_RTX;
-
if (SHIFT_COUNT_TRUNCATED)
wop1 = wi::umod_trunc (wop1, width);
+ else if (wi::geu_p (wop1, width))
+ return NULL_RTX;
switch (code)
{
case LSHIFTRT:
- result = wi::lrshift (pop0, wop1, bitsize);
+ result = wi::lrshift (pop0, wop1);
break;
case ASHIFTRT:
- result = wi::arshift (pop0, wop1, bitsize);
+ result = wi::arshift (pop0, wop1);
break;
case ASHIFT:
- result = wi::lshift (pop0, wop1, bitsize);
+ result = wi::lshift (pop0, wop1);
break;
+ default:
+ gcc_unreachable ();
+ }
+ break;
+ }
+ case ROTATE:
+ case ROTATERT:
+ {
+ if (wi::neg_p (pop1))
+ return NULL_RTX;
+
+ switch (code)
+ {
case ROTATE:
- result = wi::lrotate (pop0, wop1);
+ result = wi::lrotate (pop0, pop1);
break;
case ROTATERT:
- result = wi::rrotate (pop0, wop1);
+ result = wi::rrotate (pop0, pop1);
break;
default:
value_bit = 8,
value_mask = (1 << value_bit) - 1
};
- unsigned char value[MAX_BITSIZE_MODE_ANY_MODE/value_bit];
+ unsigned char value[MAX_BITSIZE_MODE_ANY_MODE / value_bit];
int value_start;
int i;
int elem;