diff options
author | Derek Schuff <dschuff@google.com> | 2017-09-13 00:29:06 +0000 |
---|---|---|
committer | Derek Schuff <dschuff@google.com> | 2017-09-13 00:29:06 +0000 |
commit | a519fe5a37e6433715e64db6c65c9743bd0c2960 (patch) | |
tree | f2cd3336326cfecfe0d53a55029e96a48686798f /llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | |
parent | 97ec1451a8f0ef9d845f3ca90bc7ba63d52bc0c5 (diff) | |
download | bcm5719-llvm-a519fe5a37e6433715e64db6c65c9743bd0c2960.tar.gz bcm5719-llvm-a519fe5a37e6433715e64db6c65c9743bd0c2960.zip |
[WebAssembly] Add sign extend instructions from atomics proposal
Select them from ISD::SIGN_EXTEND_INREG
Differential Revision: https://reviews.llvm.org/D37603
remove spurious change
llvm-svn: 313101
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 5615ec184d7..91db3da0926 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -115,8 +115,12 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering( // As a special case, these operators use the type to mean the type to // sign-extend from. - for (auto T : {MVT::i1, MVT::i8, MVT::i16, MVT::i32}) - setOperationAction(ISD::SIGN_EXTEND_INREG, T, Expand); + setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); + if (!Subtarget->hasAtomics()) { + // The Atomics feature includes signext intructions. + for (auto T : {MVT::i8, MVT::i16, MVT::i32}) + setOperationAction(ISD::SIGN_EXTEND_INREG, T, Expand); + } // Dynamic stack allocation: use the default expansion. setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); |