Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Target/Target.td
Show First 20 Lines • Show All 658 Lines • ▼ Show 20 Lines | |||||
class Predicate<string cond> { | class Predicate<string cond> { | ||||
string CondString = cond; | string CondString = cond; | ||||
/// AssemblerMatcherPredicate - If this feature can be used by the assembler | /// AssemblerMatcherPredicate - If this feature can be used by the assembler | ||||
/// matcher, this is true. Targets should set this by inheriting their | /// matcher, this is true. Targets should set this by inheriting their | ||||
/// feature from the AssemblerPredicate class in addition to Predicate. | /// feature from the AssemblerPredicate class in addition to Predicate. | ||||
bit AssemblerMatcherPredicate = 0; | bit AssemblerMatcherPredicate = 0; | ||||
/// AssemblerCondString - Name of the subtarget feature being tested used | /// AssemblerCondDag - Set of subtarget features being tested used | ||||
lenary: This should document that you cannot do `(any_of Pred1, (all_of Pred2, Pred3))`, but you can do… | |||||
/// as alternative condition string used for assembler matcher. | /// as alternative condition string used for assembler matcher. Must be used | ||||
/// e.g. "ModeThumb" is translated to "(Bits & ModeThumb) != 0". | /// with (all_of) to indicate that all features must be present, or (any_of) | ||||
/// "!ModeThumb" is translated to "(Bits & ModeThumb) == 0". | /// to indicate that at least one must be. The required lack of presence of | ||||
/// It can also list multiple features separated by ",". | /// a feature can be tested using a (not) node including the feature. | ||||
/// e.g. "ModeThumb,FeatureThumb2" is translated to | /// e.g. "(all_of ModeThumb)" is translated to "(Bits & ModeThumb) != 0". | ||||
/// "(all_of (not ModeThumb))" is translated to | |||||
/// "(Bits & ModeThumb) == 0". | |||||
/// "(all_of ModeThumb, FeatureThumb2)" is translated to | |||||
/// "(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0". | /// "(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0". | ||||
string AssemblerCondString = ""; | /// "(any_of ModeTumb, FeatureThumb2)" is translated to | ||||
/// "(Bits & ModeThumb) != 0 || (Bits & FeatureThumb2) != 0". | |||||
Not Done ReplyInline ActionsNitpick: this could benefit from a deeper edit to better reflect the new semantics, in a clear way. Be sure to clarify that , and | are currently mutually exclusive. luismarques: Nitpick: this could benefit from a deeper edit to better reflect the new semantics, in a clear… | |||||
dag AssemblerCondDag; | |||||
/// PredicateName - User-level name to use for the predicate. Mainly for use | /// PredicateName - User-level name to use for the predicate. Mainly for use | ||||
/// in diagnostics such as missing feature errors in the asm matcher. | /// in diagnostics such as missing feature errors in the asm matcher. | ||||
string PredicateName = ""; | string PredicateName = ""; | ||||
/// Setting this to '1' indicates that the predicate must be recomputed on | /// Setting this to '1' indicates that the predicate must be recomputed on | ||||
/// every function change. Most predicates can leave this at '0'. | /// every function change. Most predicates can leave this at '0'. | ||||
/// | /// | ||||
▲ Show 20 Lines • Show All 664 Lines • ▼ Show 20 Lines | class AsmParserVariant { | ||||
// SeparatorCharacters - Characters that are not tokens | // SeparatorCharacters - Characters that are not tokens | ||||
string SeparatorCharacters = " \t,"; | string SeparatorCharacters = " \t,"; | ||||
// BreakCharacters - Characters that start new identifiers | // BreakCharacters - Characters that start new identifiers | ||||
string BreakCharacters = ""; | string BreakCharacters = ""; | ||||
} | } | ||||
def DefaultAsmParserVariant : AsmParserVariant; | def DefaultAsmParserVariant : AsmParserVariant; | ||||
// Operators for combining SubtargetFeatures in AssemblerPredicates | |||||
def any_of; | |||||
def all_of; | |||||
/// AssemblerPredicate - This is a Predicate that can be used when the assembler | /// AssemblerPredicate - This is a Predicate that can be used when the assembler | ||||
/// matches instructions and aliases. | /// matches instructions and aliases. | ||||
class AssemblerPredicate<string cond, string name = ""> { | class AssemblerPredicate<dag cond, string name = ""> { | ||||
bit AssemblerMatcherPredicate = 1; | bit AssemblerMatcherPredicate = 1; | ||||
string AssemblerCondString = cond; | dag AssemblerCondDag = cond; | ||||
string PredicateName = name; | string PredicateName = name; | ||||
} | } | ||||
/// TokenAlias - This class allows targets to define assembler token | /// TokenAlias - This class allows targets to define assembler token | ||||
/// operand aliases. That is, a token literal operand which is equivalent | /// operand aliases. That is, a token literal operand which is equivalent | ||||
/// to another, canonical, token literal. For example, ARM allows: | /// to another, canonical, token literal. For example, ARM allows: | ||||
/// vmov.u32 s4, #0 -> vmov.i32, #0 | /// vmov.u32 s4, #0 -> vmov.i32, #0 | ||||
/// 'u32' is a more specific designator for the 32-bit integer type specifier | /// 'u32' is a more specific designator for the 32-bit integer type specifier | ||||
▲ Show 20 Lines • Show All 277 Lines • Show Last 20 Lines |
This should document that you cannot do (any_of Pred1, (all_of Pred2, Pred3)), but you can do: