diff options
author | Thomas Lively <tlively@google.com> | 2018-10-20 01:35:23 +0000 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2018-10-20 01:35:23 +0000 |
commit | 5ea17d450e6851b5a950115be96d82b4137e4b59 (patch) | |
tree | fd2db08822155eebc807326c514a9a974ea11636 /llvm/lib | |
parent | 55735d522d1fa24908dc40475769a64bbb603108 (diff) | |
download | bcm5719-llvm-5ea17d450e6851b5a950115be96d82b4137e4b59.tar.gz bcm5719-llvm-5ea17d450e6851b5a950115be96d82b4137e4b59.zip |
[WebAssembly] Implement vector sext_inreg and tests with comparisons
Summary: Depends on D53251.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D53252
llvm-svn: 344826
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index e6fe1f85487..1da66af5560 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -48,6 +48,8 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering( // Booleans always contain 0 or 1. setBooleanContents(ZeroOrOneBooleanContent); + // Except in SIMD vectors + setBooleanVectorContents(ZeroOrNegativeOneBooleanContent); // WebAssembly does not produce floating-point exceptions on normal floating // point operations. setHasFloatingPointExceptions(false); @@ -149,6 +151,8 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering( for (auto T : {MVT::i8, MVT::i16, MVT::i32}) setOperationAction(ISD::SIGN_EXTEND_INREG, T, Expand); } + for (auto T : MVT::integer_vector_valuetypes()) + setOperationAction(ISD::SIGN_EXTEND_INREG, T, Expand); // Dynamic stack allocation: use the default expansion. setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td index 0b09da7dcef..711d42a219e 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -613,7 +613,8 @@ multiclass SIMDCondition<ValueType vec_t, ValueType out_t, string vec, defm _#vec_t : SIMD_I<(outs V128:$dst), (ins V128:$lhs, V128:$rhs), (outs), (ins), [(set (out_t V128:$dst), - (setcc (vec_t V128:$lhs), (vec_t V128:$rhs), cond))], + (setcc (vec_t V128:$lhs), (vec_t V128:$rhs), cond) + )], vec#"."#name#"\t$dst, $lhs, $rhs", vec#"."#name, simdop>; } @@ -621,15 +622,15 @@ multiclass SIMDConditionInt<string name, CondCode cond, bits<32> baseInst, int step = 1> { defm "" : SIMDCondition<v16i8, v16i8, "i8x16", name, cond, baseInst>; defm "" : SIMDCondition<v8i16, v8i16, "i16x8", name, cond, - !add(baseInst, step)>; + !add(baseInst, step)>; defm "" : SIMDCondition<v4i32, v4i32, "i32x4", name, cond, - !add(!add(baseInst, step), step)>; + !add(!add(baseInst, step), step)>; } multiclass SIMDConditionFP<string name, CondCode cond, bits<32> baseInst> { defm "" : SIMDCondition<v4f32, v4i32, "f32x4", name, cond, baseInst>; defm "" : SIMDCondition<v2f64, v2i64, "f64x2", name, cond, - !add(baseInst, 1)>; + !add(baseInst, 1)>; } // Equality: eq |