Skip to content

Commit

Permalink
[WebAssembly] Lower select for vectors
Browse files Browse the repository at this point in the history
Summary:

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D53675

llvm-svn: 346462
  • Loading branch information
tlively committed Nov 9, 2018
1 parent ec54d61 commit 38c902b
Show file tree
Hide file tree
Showing 3 changed files with 472 additions and 98 deletions.
17 changes: 9 additions & 8 deletions llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
Expand Up @@ -156,14 +156,15 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(
setOperationAction(Op, MVT::v2i64, Custom);
}

// There is no select instruction for vectors
if (Subtarget->hasSIMD128()) {
for (auto T : {MVT::v16i8, MVT::v8i16, MVT::v4i32, MVT::v4f32})
setOperationAction(ISD::VSELECT, T, Expand);
if (EnableUnimplementedWasmSIMDInstrs)
for (auto T : {MVT::v2i64, MVT::v2f64})
setOperationAction(ISD::VSELECT, T, Expand);
}
// There are no select instructions for vectors
if (Subtarget->hasSIMD128())
for (auto Op : {ISD::VSELECT, ISD::SELECT_CC, ISD::SELECT}) {
for (auto T : {MVT::v16i8, MVT::v8i16, MVT::v4i32, MVT::v4f32})
setOperationAction(Op, T, Expand);
if (EnableUnimplementedWasmSIMDInstrs)
for (auto T : {MVT::v2i64, MVT::v2f64})
setOperationAction(Op, T, Expand);
}

// As a special case, these operators use the type to mean the type to
// sign-extend from.
Expand Down

0 comments on commit 38c902b

Please sign in to comment.