diff options
author | Dan Gohman <dan433584@gmail.com> | 2015-08-20 22:57:13 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2015-08-20 22:57:13 +0000 |
commit | 32907a6b2177eea6be3e4d1d42da420b6c2d4181 (patch) | |
tree | 5c91b7724f94c2fc7a211c1f60a88cc0e0407606 /llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | |
parent | e472d8a57ab085370f3bfe12f9604b7566d69c92 (diff) | |
download | bcm5719-llvm-32907a6b2177eea6be3e4d1d42da420b6c2d4181.tar.gz bcm5719-llvm-32907a6b2177eea6be3e4d1d42da420b6c2d4181.zip |
[WebAssembly] Mark more operators as Expand.
llvm-svn: 245636
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 21a322241a8..b4143240c99 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -119,7 +119,33 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering( for (auto CC : {ISD::SETO, ISD::SETUO, ISD::SETUEQ, ISD::SETONE, ISD::SETULT, ISD::SETULE, ISD::SETUGT, ISD::SETUGE}) setCondCodeAction(CC, T, Expand); + // Expand floating-point library function operators. + for (auto Op : {ISD::FSIN, ISD::FCOS, ISD::FSINCOS, ISD::FPOWI, ISD::FPOW, + ISD::FLOG, ISD::FLOG2, ISD::FLOG10, ISD::FEXP, ISD::FEXP2, + ISD::FMINNAN, ISD::FMAXNAN}) + setOperationAction(Op, T, Expand); } + + for (auto T : {MVT::i32, MVT::i64}) { + // Expand unavailable integer operations. + for (auto Op : {ISD::BSWAP, ISD::ROTL, ISD::ROTR, + ISD::SMUL_LOHI, ISD::UMUL_LOHI, + ISD::MULHS, ISD::MULHU, ISD::SDIVREM, ISD::UDIVREM, + ISD::SHL_PARTS, ISD::SRA_PARTS, ISD::SRL_PARTS, + ISD::ADDC, ISD::ADDE, ISD::SUBC, ISD::SUBE}) { + setOperationAction(Op, T, Expand); + } + } + + // 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}) + setOperationAction(ISD::SIGN_EXTEND_INREG, T, Expand); + + // Dynamic stack allocation: use the default expansion. + setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); + setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand); + setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Expand); } MVT WebAssemblyTargetLowering::getScalarShiftAmountTy(const DataLayout &DL, |