case VOID_TYPE:
case NULLPTR_TYPE:
case LANG_TYPE:
+ case OPAQUE_TYPE:
/* For a void type, just define it as itself; i.e., "5=5".
This makes us consider it defined
without saying what it is. The debugger will make it
@tindex ARRAY_TYPE
@tindex RECORD_TYPE
@tindex UNION_TYPE
+@tindex OPAQUE_TYPE
@tindex UNKNOWN_TYPE
@tindex OFFSET_TYPE
@findex TYPE_UNQUALIFIED
which they were declared. The @code{TREE_TYPE} of each of these
constants will be the type of enumeration type itself.
+@item OPAQUE_TYPE
+Used for things that have a @code{MODE_OPAQUE} mode class in the
+backend. Opaque types have a size and precision, and can be held in
+memory or registers. They are used when we do not want the compiler to
+make assumptions about the availability of other operations as would
+happen with integer types.
+
@item BOOLEAN_TYPE
Used to represent the @code{bool} type.
Operations in these modes may be executed as NOPs depending on hardware
features and environment setup.
+@findex MODE_OPAQUE
+@item MODE_OPAQUE
+This is a mode class for modes that don't want to provide operations
+other than register moves, memory moves, loads, stores, and
+@code{unspec}s. They have a size and precision and that's all.
+
@findex MODE_RANDOM
@item MODE_RANDOM
This is a catchall mode class for modes which don't fit into the above
m->component = 0;
break;
+ case MODE_OPAQUE:
+ /* Opaque modes have size and precision. */
+ validate_mode (m, OPTIONAL, SET, UNSET, UNSET, UNSET);
+
+ m->ncomponents = 1;
+ m->component = 0;
+ break;
+
case MODE_PARTIAL_INT:
/* A partial integer mode uses ->component to say what the
corresponding full-size integer mode is, and may also
m->precision = precision;
}
+#define OPAQUE_MODE(N, B) \
+ make_opaque_mode (#N, -1U, B, __FILE__, __LINE__)
+
+static void ATTRIBUTE_UNUSED
+make_opaque_mode (const char *name,
+ unsigned int precision,
+ unsigned int bytesize,
+ const char *file, unsigned int line)
+{
+ struct mode_data *m = new_mode (MODE_OPAQUE, name, file, line);
+ m->bytesize = bytesize;
+ m->precision = precision;
+}
+
#define FRACT_MODE(N, Y, F) \
make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, __LINE__)
|| !DF_REF_INSN_INFO (def)
|| HARD_REGISTER_NUM_P (regno)
|| DF_REG_EQ_USE_COUNT (regno) > 0
- || (!INTEGRAL_MODE_P (mode) && !FLOAT_MODE_P (mode)))
+ || (!INTEGRAL_MODE_P (mode)
+ && !FLOAT_MODE_P (mode)
+ && !OPAQUE_MODE_P (mode)))
continue;
def_insn = DF_REF_INSN (def);
the element at index 0 occupying the lsb of the first byte in
memory. Only the lowest bit of each element is significant.
+ OPAQUE_MODE (NAME, BYTESIZE)
+ Create an opaque mode called NAME that is BYTESIZE bytes wide.
+
COMPLEX_MODES (CLASS);
For all modes presently declared in class CLASS, construct
corresponding complex modes. Modes smaller than one byte
(SIGNED_FIXED_POINT_MODE_P (MODE) \
|| UNSIGNED_FIXED_POINT_MODE_P (MODE))
+/* Nonzero if MODE is opaque. */
+#define OPAQUE_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_OPAQUE)
+
/* Nonzero if CLASS modes can be widened. */
#define CLASS_HAS_WIDER_MODES_P(CLASS) \
(CLASS == MODE_INT \
DEF_MODE_CLASS (MODE_VECTOR_UFRACT), /* SIMD vectors */ \
DEF_MODE_CLASS (MODE_VECTOR_ACCUM), /* SIMD vectors */ \
DEF_MODE_CLASS (MODE_VECTOR_UACCUM), /* SIMD vectors */ \
- DEF_MODE_CLASS (MODE_VECTOR_FLOAT)
+ DEF_MODE_CLASS (MODE_VECTOR_FLOAT), \
+ DEF_MODE_CLASS (MODE_OPAQUE) /* opaque modes */
case MODE_VECTOR_UACCUM:
return int_mode_for_size (GET_MODE_BITSIZE (mode), 0);
+ case MODE_OPAQUE:
+ return opt_scalar_int_mode ();
+
case MODE_RANDOM:
if (mode == BLKmode)
return opt_scalar_int_mode ();
case VECTOR_TYPE:
case ENUMERAL_TYPE:
case BOOLEAN_TYPE:
+ case OPAQUE_TYPE:
{
unsigned int quals = TYPE_QUALS (node);
enum tree_code_class tclass;
case BOOLEAN_TYPE:
case INTEGER_TYPE:
case REAL_TYPE:
+ case OPAQUE_TYPE:
case POINTER_TYPE:
case REFERENCE_TYPE:
case NULLPTR_TYPE:
layout_type does not know how to lay this out,
so the front-end must do so manually. */
DEFTREECODE (LANG_TYPE, "lang_type", tcc_type, 0)
+
+/* This is for types that will use MODE_OPAQUE in the back end. They are meant
+ to be able to go in a register of some sort but are explicitly not to be
+ converted or operated on like INTEGER_TYPE. They will have size and
+ alignment information only. */
+DEFTREECODE (OPAQUE_TYPE, "opaque_type", tcc_type, 0)
\f
/* Expressions */
#define FUNC_OR_METHOD_TYPE_P(NODE) \
(TREE_CODE (NODE) == FUNCTION_TYPE || TREE_CODE (NODE) == METHOD_TYPE)
+#define OPAQUE_TYPE_P(NODE) \
+ (TREE_CODE (NODE) == OPAQUE_TYPE)
+
/* Define many boolean fields that all tree nodes have. */
/* In VAR_DECL, PARM_DECL and RESULT_DECL nodes, nonzero means address