本文整理汇总了C++中TYPE_MODE函数的典型用法代码示例。如果您正苦于以下问题:C++ TYPE_MODE函数的具体用法?C++ TYPE_MODE怎么用?C++ TYPE_MODE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TYPE_MODE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pack_ts_type_common_value_fields
static void
pack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
{
bp_pack_enum (bp, machine_mode, MAX_MACHINE_MODE, TYPE_MODE (expr));
bp_pack_value (bp, TYPE_STRING_FLAG (expr), 1);
bp_pack_value (bp, TYPE_NO_FORCE_BLK (expr), 1);
bp_pack_value (bp, TYPE_NEEDS_CONSTRUCTING (expr), 1);
if (RECORD_OR_UNION_TYPE_P (expr))
bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1);
else if (TREE_CODE (expr) == ARRAY_TYPE)
bp_pack_value (bp, TYPE_NONALIASED_COMPONENT (expr), 1);
bp_pack_value (bp, TYPE_PACKED (expr), 1);
bp_pack_value (bp, TYPE_RESTRICT (expr), 1);
bp_pack_value (bp, TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr), 2);
bp_pack_value (bp, TYPE_USER_ALIGN (expr), 1);
bp_pack_value (bp, TYPE_READONLY (expr), 1);
bp_pack_var_len_unsigned (bp, TYPE_PRECISION (expr));
bp_pack_var_len_unsigned (bp, TYPE_ALIGN (expr));
bp_pack_var_len_int (bp, TYPE_ALIAS_SET (expr) == 0 ? 0 : -1);
}
示例2: compareAndSwapInt_builtin
static tree
compareAndSwapInt_builtin (tree method_return_type ATTRIBUTE_UNUSED,
tree orig_call)
{
enum machine_mode mode = TYPE_MODE (int_type_node);
if (can_compare_and_swap_p (mode, flag_use_atomic_builtins))
{
tree addr, stmt;
enum built_in_function fncode = BUILT_IN_SYNC_BOOL_COMPARE_AND_SWAP_4;
UNMARSHAL5 (orig_call);
(void) value_type; /* Avoid set but not used warning. */
addr = build_addr_sum (int_type_node, obj_arg, offset_arg);
stmt = build_call_expr (builtin_decl_explicit (fncode),
3, addr, expected_arg, value_arg);
return build_check_this (stmt, this_arg);
}
return NULL_TREE;
}
示例3: expand_vec_cond_expr_p
bool
expand_vec_cond_expr_p (tree value_type, tree cmp_op_type)
{
machine_mode value_mode = TYPE_MODE (value_type);
machine_mode cmp_op_mode = TYPE_MODE (cmp_op_type);
if (VECTOR_BOOLEAN_TYPE_P (cmp_op_type))
return get_vcond_mask_icode (TYPE_MODE (value_type),
TYPE_MODE (cmp_op_type)) != CODE_FOR_nothing;
if (GET_MODE_SIZE (value_mode) != GET_MODE_SIZE (cmp_op_mode)
|| GET_MODE_NUNITS (value_mode) != GET_MODE_NUNITS (cmp_op_mode)
|| get_vcond_icode (TYPE_MODE (value_type), TYPE_MODE (cmp_op_type),
TYPE_UNSIGNED (cmp_op_type)) == CODE_FOR_nothing)
return false;
return true;
}
示例4: gen_conditions_for_pow_cst_base
static void
gen_conditions_for_pow_cst_base (tree base, tree expn,
vec<gimple> conds,
unsigned *nconds)
{
inp_domain exp_domain;
/* Validate the range of the base constant to make
sure it is consistent with check_pow. */
REAL_VALUE_TYPE mv;
REAL_VALUE_TYPE bcv = TREE_REAL_CST (base);
gcc_assert (!REAL_VALUES_EQUAL (bcv, dconst1)
&& !REAL_VALUES_LESS (bcv, dconst1));
real_from_integer (&mv, TYPE_MODE (TREE_TYPE (base)), 256, UNSIGNED);
gcc_assert (!REAL_VALUES_LESS (mv, bcv));
exp_domain = get_domain (0, false, false,
127, true, false);
gen_conditions_for_domain (expn, exp_domain,
conds, nconds);
}
示例5: build_real
/*
* Return a new REAL_CST node whose type
* is TYPE and value is D.
*/
tree
build_real (tree type, REAL_VALUE_TYPE d)
{
tree v;
/*
* Check for valid float value for this type
* on this target machine; if not, can print
* error message and store a valid value in D.
*/
#ifdef CHECK_FLOAT_VALUE
CHECK_FLOAT_VALUE (TYPE_MODE (type), d);
#endif
v = make_node (REAL_CST);
TREE_TYPE (v) = type;
TREE_REAL_CST (v) = d;
return v;
} /* end build_real */
示例6: get_nonzero_bits
double_int
get_nonzero_bits (const_tree name)
{
if (POINTER_TYPE_P (TREE_TYPE (name)))
{
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (name);
if (pi && pi->align)
{
double_int al = double_int::from_uhwi (pi->align - 1);
return ((double_int::mask (TYPE_PRECISION (TREE_TYPE (name))) & ~al)
| double_int::from_uhwi (pi->misalign));
}
return double_int_minus_one;
}
range_info_def *ri = SSA_NAME_RANGE_INFO (name);
if (!ri || (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (name)))
> 2 * HOST_BITS_PER_WIDE_INT))
return double_int_minus_one;
return ri->nonzero_bits;
}
示例7: compareAndSwapObject_builtin
static tree
compareAndSwapObject_builtin (tree method_return_type ATTRIBUTE_UNUSED,
tree orig_call)
{
enum machine_mode mode = TYPE_MODE (ptr_type_node);
if (can_compare_and_swap_p (mode, flag_use_atomic_builtins))
{
tree addr, stmt;
enum built_in_function builtin;
UNMARSHAL5 (orig_call);
builtin = (POINTER_SIZE == 32
? BUILT_IN_SYNC_BOOL_COMPARE_AND_SWAP_4
: BUILT_IN_SYNC_BOOL_COMPARE_AND_SWAP_8);
addr = build_addr_sum (value_type, obj_arg, offset_arg);
stmt = build_call_expr (builtin_decl_explicit (builtin),
3, addr, expected_arg, value_arg);
return build_check_this (stmt, this_arg);
}
return NULL_TREE;
}
示例8: nds32_expand_builtin_null_ftype_reg
/* Function to expand builtin function for
'[(unspec_volatile [(reg)])]'. */
static rtx
nds32_expand_builtin_null_ftype_reg (enum insn_code icode,
tree exp, rtx target)
{
/* Mapping:
ops[0] <--> value0 <--> arg0 */
struct expand_operand ops[1];
tree arg0;
rtx value0;
/* Grab the incoming arguments and extract its rtx. */
arg0 = CALL_EXPR_ARG (exp, 0);
value0 = expand_normal (arg0);
/* Create operands. */
create_input_operand (&ops[0], value0, TYPE_MODE (TREE_TYPE (arg0)));
/* Emit new instruction. */
if (!maybe_expand_insn (icode, 1, ops))
error ("invalid argument to built-in function");
return target;
}
示例9: java_type_for_mode
tree
java_type_for_mode (machine_mode mode, int unsignedp)
{
if (mode == TYPE_MODE (int_type_node))
return unsignedp ? unsigned_int_type_node : int_type_node;
if (mode == TYPE_MODE (long_type_node))
return unsignedp ? unsigned_long_type_node : long_type_node;
if (mode == TYPE_MODE (short_type_node))
return unsignedp ? unsigned_short_type_node : short_type_node;
if (mode == TYPE_MODE (byte_type_node))
return unsignedp ? unsigned_byte_type_node : byte_type_node;
if (mode == TYPE_MODE (float_type_node))
return float_type_node;
if (mode == TYPE_MODE (double_type_node))
return double_type_node;
return 0;
}
示例10: cxx_expand_expr
rtx
cxx_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier,
rtx *alt_rtl)
{
tree type = TREE_TYPE (exp);
enum machine_mode mode = TYPE_MODE (type);
enum tree_code code = TREE_CODE (exp);
/* No sense saving up arithmetic to be done
if it's all in the wrong mode to form part of an address.
And force_operand won't know whether to sign-extend or zero-extend. */
if (mode != Pmode && modifier == EXPAND_SUM)
modifier = EXPAND_NORMAL;
switch (code)
{
case PTRMEM_CST:
return expand_expr (cplus_expand_constant (exp),
target, tmode, modifier);
case OFFSET_REF:
/* Offset refs should not make it through to here. */
abort ();
case EMPTY_CLASS_EXPR:
/* We don't need to generate any code for an empty class. */
return const0_rtx;
case BASELINK:
return expand_expr (BASELINK_FUNCTIONS (exp), target, tmode,
modifier);
default:
return c_expand_expr (exp, target, tmode, modifier, alt_rtl);
}
}
示例11: build_real_from_int_cst
/*
* This function can't be implemented if we can't
* do arithmetic on the float representation.
*/
tree
build_real_from_int_cst (tree type, tree i)
{
tree v;
REAL_VALUE_TYPE d;
v = make_node (REAL_CST);
TREE_TYPE (v) = type;
d = real_value_from_int_cst (i);
/*
* Check for valid float value for this type
* on this target machine; if not, can print
* error message and store a valid value in D.
*/
#ifdef CHECK_FLOAT_VALUE
CHECK_FLOAT_VALUE (TYPE_MODE (type), d);
#endif
TREE_REAL_CST (v) = d;
return (v);
} /* end build_real_from_int_cst */
示例12: do_jump_by_parts_equality
static void
do_jump_by_parts_equality (tree exp, rtx if_false_label, rtx if_true_label)
{
rtx op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
rtx op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
int nwords = (GET_MODE_SIZE (mode) / UNITS_PER_WORD);
int i;
rtx drop_through_label = 0;
if (! if_false_label)
drop_through_label = if_false_label = gen_label_rtx ();
for (i = 0; i < nwords; i++)
do_compare_rtx_and_jump (operand_subword_force (op0, i, mode),
operand_subword_force (op1, i, mode),
EQ, TREE_UNSIGNED (TREE_TYPE (exp)),
word_mode, NULL_RTX, if_false_label, NULL_RTX);
if (if_true_label)
emit_jump (if_true_label);
if (drop_through_label)
emit_label (drop_through_label);
}
示例13: gfc_conv_mpfr_to_tree
tree
gfc_conv_mpfr_to_tree (mpfr_t f, int kind)
{
tree res;
tree type;
mp_exp_t exp;
char *p;
char *q;
int n;
int edigits;
for (n = 0; gfc_real_kinds[n].kind != 0; n++)
{
if (gfc_real_kinds[n].kind == kind)
break;
}
gcc_assert (gfc_real_kinds[n].kind);
n = MAX (abs (gfc_real_kinds[n].min_exponent),
abs (gfc_real_kinds[n].max_exponent));
edigits = 1;
while (n > 0)
{
n = n / 10;
edigits += 3;
}
if (kind == gfc_default_double_kind)
p = mpfr_get_str (NULL, &exp, 10, 17, f, GFC_RND_MODE);
else
p = mpfr_get_str (NULL, &exp, 10, 8, f, GFC_RND_MODE);
/* We also have one minus sign, "e", "." and a null terminator. */
q = (char *) gfc_getmem (strlen (p) + edigits + 4);
if (p[0])
{
if (p[0] == '-')
{
strcpy (&q[2], &p[1]);
q[0] = '-';
q[1] = '.';
}
else
{
strcpy (&q[1], p);
q[0] = '.';
}
strcat (q, "e");
sprintf (&q[strlen (q)], "%d", (int) exp);
}
else
{
strcpy (q, "0");
}
type = gfc_get_real_type (kind);
res = build_real (type, REAL_VALUE_ATOF (q, TYPE_MODE (type)));
gfc_free (q);
gfc_free (p);
return res;
}
示例14: print_node
//.........这里部分代码省略.........
/* The transparent-union flag is used for different things in
different nodes. */
if ((code == UNION_TYPE || code == RECORD_TYPE)
&& TYPE_TRANSPARENT_AGGR (node))
fputs (" transparent-aggr", file);
else if (code == ARRAY_TYPE
&& TYPE_NONALIASED_COMPONENT (node))
fputs (" nonaliased-component", file);
if (TYPE_PACKED (node))
fputs (" packed", file);
if (TYPE_RESTRICT (node))
fputs (" restrict", file);
if (TYPE_LANG_FLAG_0 (node))
fputs (" type_0", file);
if (TYPE_LANG_FLAG_1 (node))
fputs (" type_1", file);
if (TYPE_LANG_FLAG_2 (node))
fputs (" type_2", file);
if (TYPE_LANG_FLAG_3 (node))
fputs (" type_3", file);
if (TYPE_LANG_FLAG_4 (node))
fputs (" type_4", file);
if (TYPE_LANG_FLAG_5 (node))
fputs (" type_5", file);
if (TYPE_LANG_FLAG_6 (node))
fputs (" type_6", file);
if (TYPE_LANG_FLAG_7 (node))
fputs (" type_7", file);
mode = TYPE_MODE (node);
fprintf (file, " %s", GET_MODE_NAME (mode));
print_node (file, "size", TYPE_SIZE (node), indent + 4);
print_node (file, "unit size", TYPE_SIZE_UNIT (node), indent + 4);
indent_to (file, indent + 3);
if (TYPE_USER_ALIGN (node))
fprintf (file, " user");
fprintf (file, " align %d symtab %d alias set " HOST_WIDE_INT_PRINT_DEC,
TYPE_ALIGN (node), TYPE_SYMTAB_ADDRESS (node),
(HOST_WIDE_INT) TYPE_ALIAS_SET (node));
if (TYPE_STRUCTURAL_EQUALITY_P (node))
fprintf (file, " structural equality");
else
dump_addr (file, " canonical type ", TYPE_CANONICAL (node));
print_node (file, "attributes", TYPE_ATTRIBUTES (node), indent + 4);
if (INTEGRAL_TYPE_P (node) || code == REAL_TYPE
|| code == FIXED_POINT_TYPE)
{
fprintf (file, " precision %d", TYPE_PRECISION (node));
print_node_brief (file, "min", TYPE_MIN_VALUE (node), indent + 4);
print_node_brief (file, "max", TYPE_MAX_VALUE (node), indent + 4);
}
if (code == ENUMERAL_TYPE)
print_node (file, "values", TYPE_VALUES (node), indent + 4);
else if (code == ARRAY_TYPE)
print_node (file, "domain", TYPE_DOMAIN (node), indent + 4);
示例15: ubsan_expand_si_overflow_mul_check
void
ubsan_expand_si_overflow_mul_check (gimple stmt)
{
rtx res, op0, op1;
tree lhs, fn, arg0, arg1;
rtx_code_label *done_label, *do_error;
rtx target = NULL_RTX;
lhs = gimple_call_lhs (stmt);
arg0 = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
done_label = gen_label_rtx ();
do_error = gen_label_rtx ();
do_pending_stack_adjust ();
op0 = expand_normal (arg0);
op1 = expand_normal (arg1);
machine_mode mode = TYPE_MODE (TREE_TYPE (arg0));
if (lhs)
target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
enum insn_code icode = optab_handler (mulv4_optab, mode);
if (icode != CODE_FOR_nothing)
{
struct expand_operand ops[4];
rtx_insn *last = get_last_insn ();
res = gen_reg_rtx (mode);
create_output_operand (&ops[0], res, mode);
create_input_operand (&ops[1], op0, mode);
create_input_operand (&ops[2], op1, mode);
create_fixed_operand (&ops[3], do_error);
if (maybe_expand_insn (icode, 4, ops))
{
last = get_last_insn ();
if (profile_status_for_fn (cfun) != PROFILE_ABSENT
&& JUMP_P (last)
&& any_condjump_p (last)
&& !find_reg_note (last, REG_BR_PROB, 0))
add_int_reg_note (last, REG_BR_PROB, PROB_VERY_UNLIKELY);
emit_jump (done_label);
}
else
{
delete_insns_since (last);
icode = CODE_FOR_nothing;
}
}
if (icode == CODE_FOR_nothing)
{
struct separate_ops ops;
machine_mode hmode
= mode_for_size (GET_MODE_PRECISION (mode) / 2, MODE_INT, 1);
ops.op0 = arg0;
ops.op1 = arg1;
ops.op2 = NULL_TREE;
ops.location = gimple_location (stmt);
if (GET_MODE_2XWIDER_MODE (mode) != VOIDmode
&& targetm.scalar_mode_supported_p (GET_MODE_2XWIDER_MODE (mode)))
{
machine_mode wmode = GET_MODE_2XWIDER_MODE (mode);
ops.code = WIDEN_MULT_EXPR;
ops.type
= build_nonstandard_integer_type (GET_MODE_PRECISION (wmode), 0);
res = expand_expr_real_2 (&ops, NULL_RTX, wmode, EXPAND_NORMAL);
rtx hipart = expand_shift (RSHIFT_EXPR, wmode, res,
GET_MODE_PRECISION (mode), NULL_RTX, 0);
hipart = gen_lowpart (mode, hipart);
res = gen_lowpart (mode, res);
rtx signbit = expand_shift (RSHIFT_EXPR, mode, res,
GET_MODE_PRECISION (mode) - 1,
NULL_RTX, 0);
/* RES is low half of the double width result, HIPART
the high half. There was overflow if
HIPART is different from RES < 0 ? -1 : 0. */
emit_cmp_and_jump_insns (signbit, hipart, EQ, NULL_RTX, mode,
false, done_label, PROB_VERY_LIKELY);
}
else if (hmode != BLKmode
&& 2 * GET_MODE_PRECISION (hmode) == GET_MODE_PRECISION (mode))
{
rtx_code_label *large_op0 = gen_label_rtx ();
rtx_code_label *small_op0_large_op1 = gen_label_rtx ();
rtx_code_label *one_small_one_large = gen_label_rtx ();
rtx_code_label *both_ops_large = gen_label_rtx ();
rtx_code_label *after_hipart_neg = gen_label_rtx ();
rtx_code_label *after_lopart_neg = gen_label_rtx ();
rtx_code_label *do_overflow = gen_label_rtx ();
rtx_code_label *hipart_different = gen_label_rtx ();
unsigned int hprec = GET_MODE_PRECISION (hmode);
rtx hipart0 = expand_shift (RSHIFT_EXPR, mode, op0, hprec,
NULL_RTX, 0);
hipart0 = gen_lowpart (hmode, hipart0);
rtx lopart0 = gen_lowpart (hmode, op0);
rtx signbit0 = expand_shift (RSHIFT_EXPR, hmode, lopart0, hprec - 1,
NULL_RTX, 0);
//.........这里部分代码省略.........