diff options
author | Heejin Ahn <aheejin@gmail.com> | 2024-05-02 09:45:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-02 09:45:58 -0700 |
commit | 1c80d322c4a659d96ca34a17dfbdab24beb25388 (patch) | |
tree | 935ccbc6e3eaacbef5ea374e289eb8e646bb90f7 /llvm/lib | |
parent | 941eab102f4ae524bb66bcd9bffafc605b20ef7c (diff) | |
download | llvm-1c80d322c4a659d96ca34a17dfbdab24beb25388.zip llvm-1c80d322c4a659d96ca34a17dfbdab24beb25388.tar.gz llvm-1c80d322c4a659d96ca34a17dfbdab24beb25388.tar.bz2 |
[WebAssembly] Sort target features (NFC) (#90777)
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssembly.td | 64 | ||||
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td | 72 | ||||
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h | 32 |
3 files changed, 85 insertions, 83 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssembly.td b/llvm/lib/Target/WebAssembly/WebAssembly.td index f009745..0dd6744 100644 --- a/llvm/lib/Target/WebAssembly/WebAssembly.td +++ b/llvm/lib/Target/WebAssembly/WebAssembly.td @@ -22,40 +22,28 @@ include "llvm/Target/Target.td" // WebAssembly Subtarget features. //===----------------------------------------------------------------------===// -def FeatureSIMD128 : SubtargetFeature<"simd128", "SIMDLevel", "SIMD128", - "Enable 128-bit SIMD">; - -def FeatureRelaxedSIMD : SubtargetFeature<"relaxed-simd", "SIMDLevel", "RelaxedSIMD", - "Enable relaxed-simd instructions">; - -def FeatureHalfPrecision : SubtargetFeature<"half-precision", "HasHalfPrecision", "true", - "Enable half precision instructions">; - def FeatureAtomics : SubtargetFeature<"atomics", "HasAtomics", "true", "Enable Atomics">; -def FeatureNontrappingFPToInt : - SubtargetFeature<"nontrapping-fptoint", - "HasNontrappingFPToInt", "true", - "Enable non-trapping float-to-int conversion operators">; - -def FeatureSignExt : - SubtargetFeature<"sign-ext", - "HasSignExt", "true", - "Enable sign extension operators">; - -def FeatureTailCall : - SubtargetFeature<"tail-call", - "HasTailCall", "true", - "Enable tail call instructions">; +def FeatureBulkMemory : + SubtargetFeature<"bulk-memory", "HasBulkMemory", "true", + "Enable bulk memory operations">; def FeatureExceptionHandling : SubtargetFeature<"exception-handling", "HasExceptionHandling", "true", "Enable Wasm exception handling">; -def FeatureBulkMemory : - SubtargetFeature<"bulk-memory", "HasBulkMemory", "true", - "Enable bulk memory operations">; +def FeatureExtendedConst : + SubtargetFeature<"extended-const", "HasExtendedConst", "true", + "Enable extended const expressions">; + +def FeatureHalfPrecision : + SubtargetFeature<"half-precision", "HasHalfPrecision", "true", + "Enable half precision instructions">; + +def FeatureMultiMemory : + SubtargetFeature<"multimemory", "HasMultiMemory", "true", + "Enable multiple memories">; def FeatureMultivalue : SubtargetFeature<"multivalue", @@ -66,17 +54,29 @@ def FeatureMutableGlobals : SubtargetFeature<"mutable-globals", "HasMutableGlobals", "true", "Enable mutable globals">; +def FeatureNontrappingFPToInt : + SubtargetFeature<"nontrapping-fptoint", + "HasNontrappingFPToInt", "true", + "Enable non-trapping float-to-int conversion operators">; + def FeatureReferenceTypes : SubtargetFeature<"reference-types", "HasReferenceTypes", "true", "Enable reference types">; -def FeatureExtendedConst : - SubtargetFeature<"extended-const", "HasExtendedConst", "true", - "Enable extended const expressions">; +def FeatureRelaxedSIMD : + SubtargetFeature<"relaxed-simd", "SIMDLevel", "RelaxedSIMD", + "Enable relaxed-simd instructions">; -def FeatureMultiMemory : - SubtargetFeature<"multimemory", "HasMultiMemory", "true", - "Enable multiple memories">; +def FeatureSignExt : + SubtargetFeature<"sign-ext", "HasSignExt", "true", + "Enable sign extension operators">; + +def FeatureSIMD128 : SubtargetFeature<"simd128", "SIMDLevel", "SIMD128", + "Enable 128-bit SIMD">; + +def FeatureTailCall : + SubtargetFeature<"tail-call", "HasTailCall", "true", + "Enable tail call instructions">; //===----------------------------------------------------------------------===// // Architectures. diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td index fb2ca53..c1a5a45 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td @@ -22,66 +22,68 @@ def HasAddr32 : Predicate<"!Subtarget->hasAddr64()">; def HasAddr64 : Predicate<"Subtarget->hasAddr64()">; -def HasSIMD128 : - Predicate<"Subtarget->hasSIMD128()">, - AssemblerPredicate<(all_of FeatureSIMD128), "simd128">; +def HasAtomics : + Predicate<"Subtarget->hasAtomics()">, + AssemblerPredicate<(all_of FeatureAtomics), "atomics">; -def HasRelaxedSIMD : - Predicate<"Subtarget->hasRelaxedSIMD()">, - AssemblerPredicate<(all_of FeatureRelaxedSIMD), "relaxed-simd">; +def HasBulkMemory : + Predicate<"Subtarget->hasBulkMemory()">, + AssemblerPredicate<(all_of FeatureBulkMemory), "bulk-memory">; + +def HasExceptionHandling : + Predicate<"Subtarget->hasExceptionHandling()">, + AssemblerPredicate<(all_of FeatureExceptionHandling), "exception-handling">; + +def HasExtendedConst : + Predicate<"Subtarget->hasExtendedConst()">, + AssemblerPredicate<(all_of FeatureExtendedConst), "extended-const">; def HasHalfPrecision : Predicate<"Subtarget->hasHalfPrecision()">, AssemblerPredicate<(all_of FeatureHalfPrecision), "half-precision">; -def HasAtomics : - Predicate<"Subtarget->hasAtomics()">, - AssemblerPredicate<(all_of FeatureAtomics), "atomics">; +def HasMultiMemory : + Predicate<"Subtarget->hasMultiMemory()">, + AssemblerPredicate<(all_of FeatureMultiMemory), "multimemory">; def HasMultivalue : Predicate<"Subtarget->hasMultivalue()">, AssemblerPredicate<(all_of FeatureMultivalue), "multivalue">; +def HasMutableGlobals: + Predicate<"Subtarget->hasMutableGlobals()">, + AssemblerPredicate<(all_of FeatureMutableGlobals), "mutable-globals">; + def HasNontrappingFPToInt : Predicate<"Subtarget->hasNontrappingFPToInt()">, - AssemblerPredicate<(all_of FeatureNontrappingFPToInt), "nontrapping-fptoint">; + AssemblerPredicate<(all_of FeatureNontrappingFPToInt), + "nontrapping-fptoint">; def NotHasNontrappingFPToInt : Predicate<"!Subtarget->hasNontrappingFPToInt()">, - AssemblerPredicate<(all_of (not FeatureNontrappingFPToInt)), "nontrapping-fptoint">; + AssemblerPredicate<(all_of (not FeatureNontrappingFPToInt)), + "nontrapping-fptoint">; + +def HasReferenceTypes : + Predicate<"Subtarget->hasReferenceTypes()">, + AssemblerPredicate<(all_of FeatureReferenceTypes), "reference-types">; + +def HasRelaxedSIMD : + Predicate<"Subtarget->hasRelaxedSIMD()">, + AssemblerPredicate<(all_of FeatureRelaxedSIMD), "relaxed-simd">; def HasSignExt : Predicate<"Subtarget->hasSignExt()">, AssemblerPredicate<(all_of FeatureSignExt), "sign-ext">; +def HasSIMD128 : + Predicate<"Subtarget->hasSIMD128()">, + AssemblerPredicate<(all_of FeatureSIMD128), "simd128">; + def HasTailCall : Predicate<"Subtarget->hasTailCall()">, AssemblerPredicate<(all_of FeatureTailCall), "tail-call">; -def HasExceptionHandling : - Predicate<"Subtarget->hasExceptionHandling()">, - AssemblerPredicate<(all_of FeatureExceptionHandling), "exception-handling">; - -def HasBulkMemory : - Predicate<"Subtarget->hasBulkMemory()">, - AssemblerPredicate<(all_of FeatureBulkMemory), "bulk-memory">; - -def HasReferenceTypes : - Predicate<"Subtarget->hasReferenceTypes()">, - AssemblerPredicate<(all_of FeatureReferenceTypes), "reference-types">; - -def HasExtendedConst : - Predicate<"Subtarget->hasExtendedConst()">, - AssemblerPredicate<(all_of FeatureExtendedConst), "extended-const">; - -def HasMultiMemory : - Predicate<"Subtarget->hasMultiMemory()">, - AssemblerPredicate<(all_of FeatureMultiMemory), "multimemory">; - -def HasMutableGlobals: - Predicate<"Subtarget->hasMutableGlobals()">, - AssemblerPredicate<(all_of FeatureMutableGlobals), "mutable-globals">; - //===----------------------------------------------------------------------===// // WebAssembly-specific DAG Node Types. //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h b/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h index cb45899..540da4b 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h @@ -40,17 +40,17 @@ class WebAssemblySubtarget final : public WebAssemblyGenSubtargetInfo { } SIMDLevel = NoSIMD; bool HasAtomics = false; - bool HasNontrappingFPToInt = false; - bool HasSignExt = false; - bool HasExceptionHandling = false; bool HasBulkMemory = false; + bool HasExceptionHandling = false; + bool HasExtendedConst = false; + bool HasHalfPrecision = false; + bool HasMultiMemory = false; bool HasMultivalue = false; bool HasMutableGlobals = false; - bool HasTailCall = false; + bool HasNontrappingFPToInt = false; bool HasReferenceTypes = false; - bool HasExtendedConst = false; - bool HasMultiMemory = false; - bool HasHalfPrecision = false; + bool HasSignExt = false; + bool HasTailCall = false; /// What processor and OS we're targeting. Triple TargetTriple; @@ -92,20 +92,20 @@ public: // Predicates used by WebAssemblyInstrInfo.td. bool hasAddr64() const { return TargetTriple.isArch64Bit(); } - bool hasSIMD128() const { return SIMDLevel >= SIMD128; } - bool hasRelaxedSIMD() const { return SIMDLevel >= RelaxedSIMD; } - bool hasHalfPrecision() const { return HasHalfPrecision; } bool hasAtomics() const { return HasAtomics; } - bool hasNontrappingFPToInt() const { return HasNontrappingFPToInt; } - bool hasSignExt() const { return HasSignExt; } - bool hasExceptionHandling() const { return HasExceptionHandling; } bool hasBulkMemory() const { return HasBulkMemory; } + bool hasExceptionHandling() const { return HasExceptionHandling; } + bool hasExtendedConst() const { return HasExtendedConst; } + bool hasHalfPrecision() const { return HasHalfPrecision; } + bool hasMultiMemory() const { return HasMultiMemory; } bool hasMultivalue() const { return HasMultivalue; } bool hasMutableGlobals() const { return HasMutableGlobals; } - bool hasTailCall() const { return HasTailCall; } + bool hasNontrappingFPToInt() const { return HasNontrappingFPToInt; } bool hasReferenceTypes() const { return HasReferenceTypes; } - bool hasMultiMemory() const { return HasMultiMemory; } - bool hasExtendedConst() const { return HasExtendedConst; } + bool hasRelaxedSIMD() const { return SIMDLevel >= RelaxedSIMD; } + bool hasSignExt() const { return HasSignExt; } + bool hasSIMD128() const { return SIMDLevel >= SIMD128; } + bool hasTailCall() const { return HasTailCall; } /// Parses features string setting specified subtarget options. Definition of /// function is auto generated by tblgen. |