scalar_int_mode limb_mode
= as_a <scalar_int_mode> (info.limb_mode);
unsigned int limb_prec = GET_MODE_PRECISION (limb_mode);
- if (prec > limb_prec)
+ if (prec > limb_prec && prec > MAX_FIXED_MODE_SIZE)
{
- scalar_int_mode arith_mode
- = (targetm.scalar_mode_supported_p (TImode)
- ? TImode : DImode);
- if (prec > GET_MODE_PRECISION (arith_mode))
- {
- /* Emit large/huge _BitInt INTEGER_CSTs into memory. */
- exp = tree_output_constant_def (exp);
- return expand_expr (exp, target, VOIDmode, modifier);
- }
+ /* Emit large/huge _BitInt INTEGER_CSTs into memory. */
+ exp = tree_output_constant_def (exp);
+ return expand_expr (exp, target, VOIDmode, modifier);
}
}
small_max_prec = prec;
return bitint_prec_small;
}
- scalar_int_mode arith_mode = (targetm.scalar_mode_supported_p (TImode)
- ? TImode : DImode);
if (!large_min_prec
- && GET_MODE_PRECISION (arith_mode) > GET_MODE_PRECISION (limb_mode))
- large_min_prec = GET_MODE_PRECISION (arith_mode) + 1;
+ && GET_MODE_PRECISION (limb_mode) < MAX_FIXED_MODE_SIZE)
+ large_min_prec = MAX_FIXED_MODE_SIZE + 1;
if (!limb_prec)
limb_prec = GET_MODE_PRECISION (limb_mode);
if (!huge_min_prec)
{
- if (4 * limb_prec >= GET_MODE_PRECISION (arith_mode))
+ if (4 * limb_prec >= MAX_FIXED_MODE_SIZE)
huge_min_prec = 4 * limb_prec;
else
- huge_min_prec = GET_MODE_PRECISION (arith_mode) + 1;
+ huge_min_prec = MAX_FIXED_MODE_SIZE + 1;
}
- if (prec <= GET_MODE_PRECISION (arith_mode))
+ if (prec <= MAX_FIXED_MODE_SIZE)
{
if (!mid_min_prec || prec < mid_min_prec)
mid_min_prec = prec;
(with {
int width = element_precision (type) - tree_to_uhwi (@1);
tree stype = NULL_TREE;
- scalar_int_mode mode = (targetm.scalar_mode_supported_p (TImode)
- ? TImode : DImode);
- if (width <= GET_MODE_PRECISION (mode))
+ if (width <= MAX_FIXED_MODE_SIZE)
stype = build_nonstandard_integer_type (width, 0);
}
(if (stype && (width == 1 || type_has_mode_precision_p (stype)))
&& !type_has_mode_precision_p (TREE_TYPE (lhs)))
{
if (TREE_CODE (TREE_TYPE (lhs)) == BITINT_TYPE
- && (TYPE_PRECISION (TREE_TYPE (lhs))
- > (targetm.scalar_mode_supported_p (TImode)
- ? GET_MODE_PRECISION (TImode)
- : GET_MODE_PRECISION (DImode))))
+ && TYPE_PRECISION (TREE_TYPE (lhs)) > MAX_FIXED_MODE_SIZE)
lookup_lhs = NULL_TREE;
else if (TREE_CODE (lhs) == COMPONENT_REF
|| TREE_CODE (lhs) == MEM_REF)
}
else
{
- scalar_int_mode arith_mode
- = (targetm.scalar_mode_supported_p (TImode) ? TImode : DImode);
- if (TYPE_PRECISION (type) > GET_MODE_PRECISION (arith_mode))
+ if (TYPE_PRECISION (type) > MAX_FIXED_MODE_SIZE)
return build_zero_cst (pointer_sized_int_node);
- type
- = build_nonstandard_integer_type (GET_MODE_PRECISION (arith_mode),
- TYPE_UNSIGNED (type));
+ type = build_nonstandard_integer_type (MAX_FIXED_MODE_SIZE,
+ TYPE_UNSIGNED (type));
t = fold_build1 (NOP_EXPR, type, t);
}
}
{
/* Temporary hack for -fsanitize=shift with _BitInt(129) and more.
libubsan crashes if it is not TK_Integer type. */
- if (TREE_CODE (type) == BITINT_TYPE)
- {
- scalar_int_mode arith_mode
- = (targetm.scalar_mode_supported_p (TImode)
- ? TImode : DImode);
- if (TYPE_PRECISION (type) > GET_MODE_PRECISION (arith_mode))
- type3 = build_qualified_type (type, TYPE_QUAL_CONST);
- }
+ if (TREE_CODE (type) == BITINT_TYPE
+ && TYPE_PRECISION (type) > MAX_FIXED_MODE_SIZE)
+ type3 = build_qualified_type (type, TYPE_QUAL_CONST);
if (type3 == type)
pstyle = UBSAN_PRINT_NORMAL;
}
tkind = 0x0000;
break;
case BITINT_TYPE:
- {
- /* FIXME: libubsan right now only supports _BitInts which
- fit into DImode or TImode. */
- scalar_int_mode arith_mode = (targetm.scalar_mode_supported_p (TImode)
- ? TImode : DImode);
- if (TYPE_PRECISION (eltype) <= GET_MODE_PRECISION (arith_mode))
- tkind = 0x0000;
- else
- tkind = 0xffff;
- }
+ if (TYPE_PRECISION (eltype) <= MAX_FIXED_MODE_SIZE)
+ tkind = 0x0000;
+ else
+ tkind = 0xffff;
break;
case REAL_TYPE:
/* FIXME: libubsan right now only supports float, double and
if (pstyle == UBSAN_PRINT_FORCE_INT)
{
tkind = 0x0000;
- scalar_int_mode arith_mode = (targetm.scalar_mode_supported_p (TImode)
- ? TImode : DImode);
- tree t = lang_hooks.types.type_for_mode (arith_mode,
+ tree t = build_nonstandard_integer_type (MAX_FIXED_MODE_SIZE,
TYPE_UNSIGNED (eltype));
tinfo = get_ubsan_type_info_for_type (t);
}