diff options
| author | Thomas Lively <tlively@google.com> | 2019-05-23 17:26:47 +0000 | 
|---|---|---|
| committer | Thomas Lively <tlively@google.com> | 2019-05-23 17:26:47 +0000 | 
| commit | eafe8ef6f2b44baf5a84658caca90c2f9c1849ca (patch) | |
| tree | 38bdbf81421ed26bcfc1f748dba71f28cc2c9880 /llvm/lib/Target/WebAssembly | |
| parent | 7b7683d7a6c4b3839629403a85dc0bd5b9a502b6 (diff) | |
| download | bcm5719-llvm-eafe8ef6f2b44baf5a84658caca90c2f9c1849ca.tar.gz bcm5719-llvm-eafe8ef6f2b44baf5a84658caca90c2f9c1849ca.zip  | |
[WebAssembly] Add multivalue and tail-call target features
Summary:
These features will both be implemented soon, so I thought I would
save time by adding the boilerplate for both of them at the same time.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62047
llvm-svn: 361516
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssembly.td | 11 | ||||
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td | 14 | ||||
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h | 4 | 
3 files changed, 22 insertions, 7 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssembly.td b/llvm/lib/Target/WebAssembly/WebAssembly.td index 813c7e652e4..b0b8a9b996a 100644 --- a/llvm/lib/Target/WebAssembly/WebAssembly.td +++ b/llvm/lib/Target/WebAssembly/WebAssembly.td @@ -33,6 +33,7 @@ def FeatureUnimplementedSIMD128 :  def FeatureAtomics : SubtargetFeature<"atomics", "HasAtomics", "true",                                        "Enable Atomics">; +  def FeatureNontrappingFPToInt :        SubtargetFeature<"nontrapping-fptoint",                         "HasNontrappingFPToInt", "true", @@ -43,6 +44,11 @@ def FeatureSignExt :                         "HasSignExt", "true",                         "Enable sign extension operators">; +def FeatureTailCall : +      SubtargetFeature<"tail-call", +                       "HasTailCall", "true", +                       "Enable tail call instructions">; +  def FeatureExceptionHandling :        SubtargetFeature<"exception-handling", "HasExceptionHandling", "true",                         "Enable Wasm exception handling">; @@ -51,6 +57,11 @@ def FeatureBulkMemory :        SubtargetFeature<"bulk-memory", "HasBulkMemory", "true",                         "Enable bulk memory operations">; +def FeatureMultivalue : +      SubtargetFeature<"multivalue", +                       "HasMultivalue", "true", +                       "Enable multivalue blocks, instructions, and functions">; +  def FeatureMutableGlobals :        SubtargetFeature<"mutable-globals", "HasMutableGlobals", "true",                         "Enable mutable globals">; diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td index 40a8f6089c2..a15bb2cce0b 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td @@ -34,6 +34,10 @@ def HasAtomics :      Predicate<"Subtarget->hasAtomics()">,      AssemblerPredicate<"FeatureAtomics", "atomics">; +def HasMultivalue : +    Predicate<"Subtarget->hasMultivalue()">, +    AssemblerPredicate<"FeatureMultivalue", "multivalue">; +  def HasNontrappingFPToInt :      Predicate<"Subtarget->hasNontrappingFPToInt()">,      AssemblerPredicate<"FeatureNontrappingFPToInt", "nontrapping-fptoint">; @@ -46,18 +50,14 @@ def HasSignExt :      Predicate<"Subtarget->hasSignExt()">,      AssemblerPredicate<"FeatureSignExt", "sign-ext">; -def NotHasSignExt : -    Predicate<"!Subtarget->hasSignExt()">, -    AssemblerPredicate<"!FeatureSignExt", "sign-ext">; +def HasTailCall : +    Predicate<"Subtarget->hasTailCall()">, +    AssemblerPredicate<"FeatureTailCall", "tail-call">;  def HasExceptionHandling :      Predicate<"Subtarget->hasExceptionHandling()">,      AssemblerPredicate<"FeatureExceptionHandling", "exception-handling">; -def NotHasExceptionHandling : -    Predicate<"!Subtarget->hasExceptionHandling()">, -    AssemblerPredicate<"!FeatureExceptionHandling", "exception-handling">; -  def HasBulkMemory :      Predicate<"Subtarget->hasBulkMemory()">,      AssemblerPredicate<"FeatureBulkMemory", "bulk-memory">; diff --git a/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h b/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h index 22e11726f33..c5d9cf1eb95 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h @@ -44,7 +44,9 @@ class WebAssemblySubtarget final : public WebAssemblyGenSubtargetInfo {    bool HasSignExt = false;    bool HasExceptionHandling = false;    bool HasBulkMemory = false; +  bool HasMultivalue = false;    bool HasMutableGlobals = false; +  bool HasTailCall = false;    /// String name of used CPU.    std::string CPUString; @@ -98,7 +100,9 @@ public:    bool hasSignExt() const { return HasSignExt; }    bool hasExceptionHandling() const { return HasExceptionHandling; }    bool hasBulkMemory() const { return HasBulkMemory; } +  bool hasMultivalue() const { return HasMultivalue; }    bool hasMutableGlobals() const { return HasMutableGlobals; } +  bool hasTailCall() const { return HasTailCall; }    /// Parses features string setting specified subtarget options. Definition of    /// function is auto generated by tblgen.  | 

