diff --git a/ci.sh b/ci.sh index 7b35d7c3357..060ac85ea7e 100755 --- a/ci.sh +++ b/ci.sh @@ -718,7 +718,8 @@ cmd_msan_install() { ["17"]="17.0.6" ["18"]="18.1.8" ["19"]="19.1.7" - ["20"]="20.1.2" + ["20"]="20.1.8" + ["21"]="21.1.5" ) local llvm_tag="${CLANG_VERSION}.0.0" if [[ -n "${llvm_tag_by_version["${CLANG_VERSION}"]}" ]]; then diff --git a/lib/jxl/jxl_test.cc b/lib/jxl/jxl_test.cc index 7a8ec80a76b..e5923b24231 100644 --- a/lib/jxl/jxl_test.cc +++ b/lib/jxl/jxl_test.cc @@ -1427,7 +1427,7 @@ TEST(JxlTest, RoundtripAnimationPatches) { 21378u); EXPECT_EQ(ppf_out.frames.size(), t.ppf().frames.size()); // >10 with broken patches; not all patches are detected on borders. - EXPECT_SLIGHTLY_BELOW(ButteraugliDistance(t.ppf(), ppf_out), 1.85); + EXPECT_SLIGHTLY_BELOW(ButteraugliDistance(t.ppf(), ppf_out), 1.88); } size_t RoundtripJpeg(const std::vector& jpeg_in, ThreadPool* pool) { diff --git a/lib/jxl/render_pipeline/stage_write.cc b/lib/jxl/render_pipeline/stage_write.cc index 2946d48f912..5856613a7d0 100644 --- a/lib/jxl/render_pipeline/stage_write.cc +++ b/lib/jxl/render_pipeline/stage_write.cc @@ -50,6 +50,8 @@ using hwy::HWY_NAMESPACE::Mul; using hwy::HWY_NAMESPACE::NearestInt; using hwy::HWY_NAMESPACE::Or; using hwy::HWY_NAMESPACE::Rebind; +using hwy::HWY_NAMESPACE::RebindToSigned; +using hwy::HWY_NAMESPACE::RebindToUnsigned; using hwy::HWY_NAMESPACE::ShiftLeftSame; using hwy::HWY_NAMESPACE::ShiftRightSame; using hwy::HWY_NAMESPACE::VFromD; @@ -204,6 +206,8 @@ template VFromD> MakeUnsigned(VFromD v, size_t x0, size_t y0, VFromD mul) { static_assert(std::is_unsigned::value, "T must be an unsigned type"); + using DI32 = RebindToSigned; + using DU32 = RebindToUnsigned; using DU = Rebind; v = Mul(v, mul); // TODO(veluca): if constexpr with C++17 @@ -217,7 +221,9 @@ VFromD> MakeUnsigned(VFromD v, size_t x0, size_t y0, v = Add(v, dither); } v = Clamp(Zero(DF()), v, mul); - return DemoteTo(DU(), NearestInt(v)); + VFromD ni = NearestInt(v); + VFromD nu = BitCast(DU32(), ni); + return DemoteTo(DU(), nu); } class WriteToOutputStage : public RenderPipelineStage {