diff options
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r-- | src/wasm/literal.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp index 151ea83e5..c3a2ddf7a 100644 --- a/src/wasm/literal.cpp +++ b/src/wasm/literal.cpp @@ -1868,6 +1868,16 @@ Literal Literal::bitmaskI32x4() const { Literal Literal::allTrueI64x2() const { return all_true<2, &Literal::getLanesI64x2>(*this); } +Literal Literal::bitmaskI64x2() const { + uint32_t result = 0; + LaneArray<2> lanes = getLanesI64x2(); + for (size_t i = 0; i < 2; ++i) { + if (lanes[i].geti64() & (1ll << 63)) { + result = result | (1 << i); + } + } + return Literal(result); +} template<int Lanes, LaneArray<Lanes> (Literal::*IntoLanes)() const, |