Lines Matching defs:class
73 The term "parent class" can refer to a class that is a parent of another
74 class, and also to a class from which a concrete record inherits. This
95 In order to make classes more useful, a concrete record (or another class)
96 can request a class as a parent class and pass *template arguments* to it.
97 These template arguments can be used in the fields of the parent class to
98 initialize them in a custom manner. That is, record or class ``A`` can
99 request parent class ``S`` with one set of template arguments, while record or class
204 assert bit bits class code
312 Specifying a class name in a type context indicates
314 be a subclass of the specified class. This is useful in conjunction with
316 common base class (e.g., a ``list<Register>`` can only contain definitions
317 derived from the ``Register`` class).
318 The :token:`ClassID` must name a class that has been previously
429 * A template argument of a ``class``, such as the use of ``Bar`` in::
431 class Foo <int Bar> {
435 * The implicit template argument ``NAME`` in a ``class`` or ``multiclass``
438 * A field local to a ``class``, such as the use of ``Bar`` in::
440 class Foo {
482 unnamed ``def`` inheriting from the given class with the given template
486 Invoking a class in this manner can provide a simple subroutine facility.
580 ``class`` --- define an abstract record class
583 A ``class`` statement defines an abstract record class from which other
587 Class: "class" `ClassID` [`TemplateArgList`] `RecordBody`
591 A class can be parameterized by a list of "template arguments," whose values
592 can be used in the class's record body. These template arguments are
593 specified each time the class is inherited by another class or record.
597 argument list when the class is inherited (required argument). If an
604 parent classes from which the current class inherits, along with field
605 definitions and other statements. When a class ``C`` inherits from another
606 class ``D``, the fields of ``D`` are effectively merged into the fields of
609 A given class can only be defined once. A ``class`` statement is
610 considered to define the class if *any* of the following are true (the
617 You can declare an empty class by specifying an empty :token:`TemplateArgList`
620 class will inherit no fields from it, because those records are built when
621 their declarations are parsed, and thus before the class is finally defined.
625 Every class has an implicit template argument named ``NAME`` (uppercase),
627 from the class. If the class is inherited by an anonymous record, the name
635 Record bodies appear in both class and record definitions. A record body can
636 include a parent class list, which specifies the classes from which the
637 current class or record inherits fields. Such classes are called the
638 parent classes of the class or record. The record body also
640 of the fields of the class or record.
652 in the class list of a ``defm`` statement. In that case, the ID must be the
678 A field definition in the body specifies a field to be included in the class
691 become a field of the class or record being defined. Variables are provided
695 When class ``C2`` inherits from class ``C1``, it acquires all the field
696 definitions of ``C1``. As those definitions are merged into class ``C2``, any
729 of the last parent class.
736 class A <dag d> {
742 The DAG ``(ops rec1)`` is passed as a template argument to class ``A``. Notice
754 Here is a simple TableGen file with one class and two record definitions.
758 class C {
768 First, the abstract class ``C`` is defined. It has one field named ``V``
771 Next, two records are defined, derived from class ``C``; that is, with ``C``
772 as their parent class. Thus they both inherit the ``V`` field. Record ``Y``
777 A class is useful for isolating the common features of multiple records in
778 one place. A class can initialize common fields to default values, but
779 records inheriting from that class can override the defaults.
784 class is specified as a parent class of another class or record.
788 class FPFormat <bits<3> val> {
801 The purpose of the ``FPFormat`` class is to act as a sort of enumerated
804 eight records is defined with ``FPFormat`` as its parent class. The
810 define a class similar to the ``FPFormat`` class above. It takes a template
817 class ModRefVal <bits<2> val> {
827 bits of the ``Value`` field independently. We can define a class that
835 class ModRefBits <ModRefVal mrv> {
847 This illustrates how one class can be defined to reorganize the
848 fields in another class, thus hiding the internal representation of that
849 other class.
984 regular classes included in the parent class list. This is useful for adding
1022 class inst <int opc, string asmstr, dag operandlist>;
1053 class inst <int opc, string asmstr, dag operandlist>;
1055 class rrinst <int opc, string asmstr>
1059 class riinst <int opc, string asmstr>
1080 class Instruction <bits<4> opc, string Name> {
1121 class XD {
1124 class XS {
1127 class I <bits<4> op> {
1137 defm SS : R, XD; // First multiclass R, then regular class XD.
1207 The specified type must be ``list<``\ *class*\ ``>``, where *class* is some
1208 record class. The ``defset`` statement establishes a scope for its
1210 ``defset`` that is not of type *class*.
1301 * Within a record/class/multiclass, `dump` gets evaluated at each
1366 * In a class definition, the assertions are saved and inherited by all
1367 the subclasses and records that inherit from the class. The assertions are
1375 backends. Here is an example of an ``assert`` in two class definitions.
1379 class PersonName<string name> {
1384 class Person<string name, int age> : PersonName<name> {
1436 be used inside the :token:`Body` of a class or record definition to define
1437 local variables. Template arguments of ``class`` or ``multiclass`` can be
1470 right, visiting each parent class's ancestor classes from top to bottom.
1472 a. Add the fields from the parent class to the record.
1474 c. Add the parent class to the record's list of inherited classes.
1494 class C <int x> {
1532 As described in `Simple values`_, a class can be invoked in an expression
1534 record inheriting from that class. As usual, the record receives all the
1535 fields defined in the class.
1537 This feature can be employed as a simple subroutine facility. The class can
1540 expression invoking the class as follows. Assume that the field ``ret``
1547 The ``CalcValue`` class is invoked with the template argument ``arg``. It
1553 Here is a practical example. The class ``isValidSize`` determines whether a
1561 class isValidSize<int size> {
1657 casting a record to a class. If a record is cast to ``string``, the
1666 class instantiated inside a multiclass definition, and the *name* does not
1703 same type or be records with a common parent class. Mixing ``dag`` and
1790 any record class at all is acceptable (typically placing it into
1792 cast to a particular class. The ``<``\ *type*\ ``>`` syntax is
2170 from ``BinOpRR_RF``. That class, in turn, inherits from ``BinOpRR``, which
2173 from the ``Instruction`` class.