summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2019-01-31 23:22:39 +0000
committerThomas Lively <tlively@google.com>2019-01-31 23:22:39 +0000
commit9a48438832a0216eff7ae92a8e2f8ad71e2bc2cc (patch)
treef96f51c4c314d957970cd2ca03adf2f1e66e435c /llvm/lib/Target/WebAssembly
parentd5dbe83127f4d471c37ee84d3458462d925f3bc6 (diff)
downloadbcm5719-llvm-9a48438832a0216eff7ae92a8e2f8ad71e2bc2cc.tar.gz
bcm5719-llvm-9a48438832a0216eff7ae92a8e2f8ad71e2bc2cc.zip
[WebAssembly] Fix a regression selecting negative build_vector lanes
Summary: The custom lowering introduced in rL352592 creates build_vector nodes with negative i32 operands, but these operands did not meet the value range constraints necessary to match build_vector nodes. This CL fixes the issue by removing the unnecessary constraints. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish Differential Revision: https://reviews.llvm.org/D57481 llvm-svn: 352813
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
index b7ecd49c793..ab0f48c9a1e 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
@@ -30,7 +30,7 @@ defm "" : ARGUMENT<V128, v2f64>;
// Constrained immediate argument types
foreach SIZE = [8, 16] in
def ImmI#SIZE : ImmLeaf<i32,
- "return ((uint64_t)Imm & ((1UL << "#SIZE#") - 1)) == (uint64_t)Imm;"
+ "return -(1 << ("#SIZE#" - 1)) <= Imm && Imm < (1 << ("#SIZE#" - 1));"
>;
foreach SIZE = [2, 4, 8, 16, 32] in
def LaneIdx#SIZE : ImmLeaf<i32, "return 0 <= Imm && Imm < "#SIZE#";">;
OpenPOWER on IntegriCloud