Frank Barchard a84bf45a21 [libyuv] Fix MSan uninitialized errors in AVX512 alpha and scale rows
Clang MemorySanitizer builds define LIBYUV_ENABLE_ROWWIN and compile
row_win.cc and scale_win.cc instead of inline assembly. Two AVX-512
intrinsic patterns in those files are not modeled by LLVM MSan:

1. _mm512_mask_cvtepi32_storeu_epi8 and _mm512_mask_cvtepi64_storeu_epi8
   lower to @llvm.x86.avx512.mask.pmov.db.mem.512 and
   @llvm.x86.avx512.mask.pmov.qb.mem.512, which LLVM MSan handles as
   unknown intrinsics without unpoisoning destination shadow memory.
   Replace them in ARGBExtractAlphaRow_AVX512BW, ScaleAddCols1_AVX512BW,
   and ScaleAddCols2_AVX512BW with _mm512_cvtepi32_epi8 /
   _mm512_cvtepi64_epi8 followed by _mm_mask_storeu_epi8, which lowers
   to @llvm.masked.store and still compiles to a single vpmovdb/vpmovqb
   instruction.

2. ARGBCopyYToAlphaRow_AVX512BW loaded dst and blended the alpha channel
   using _mm512_ternarylogic_epi32, which LLVM MSan does not model
   bitwise and flags when any destination byte (such as the old alpha
   channel) is uninitialized. Replace the load + vpternlogd + store in
   both row_win.cc and row_gcc.cc with byte-masked stores
   (_mm512_mask_storeu_epi8 / vmovdqu8 with mask 0x8888888888888888)
   that write only the alpha bytes without reading dst.

Expand ARGBCopyAlpha, ARGBExtractAlpha, and ARGBCopyYToAlpha unit tests
into _Any, _Unaligned, _Invert, and _Opt variants and poison destination
buffers under MSan to catch unmodeled masked stores. Document MSan
AVX-512 intrinsic guidelines in GEMINI.md.

Test: out/msan/libyuv_unittest --gtest_filter=*Alpha*:*ScalePlaneBox_Any*
Bug: 578615529
Change-Id: I54ac4a5844aca6cfe3aa3445fa04b8221c610b35
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8672001
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
2026-10-27 16:27:29 -07:00
..
compare_common.cc [libyuv] Optimize SsimWindowRow with SIMD and use compare_win on x86 2026-10-20 15:00:52 -07:00
compare_gcc.cc Handle SsimWindowRow remainder in SIMD for AVX512BW, SVE2, SME, RVV 2026-10-20 21:39:37 -07:00
compare_hvx.cc [libyuv] Add Qualcomm Hexagon HVX SIMD support 2026-10-19 14:16:18 -07:00
compare_neon64.cc [libyuv] Optimize CalcFrameSsim with 2-row 4x4 tile buffer and SIMD 2026-10-15 23:22:58 -07:00
compare_neon.cc [libyuv] Optimize CalcFrameSsim with 2-row 4x4 tile buffer and SIMD 2026-10-15 23:22:58 -07:00
compare_wasm.cc [libyuv] Optimize CalcFrameSsim with 2-row 4x4 tile buffer and SIMD 2026-10-15 23:22:58 -07:00
compare_win.cc Handle SsimWindowRow remainder in SIMD for AVX512BW, SVE2, SME, RVV 2026-10-20 21:39:37 -07:00
compare.cc Handle SsimWindowRow remainder in SIMD for AVX512BW, SVE2, SME, RVV 2026-10-20 21:39:37 -07:00
convert_argb.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
convert_from_argb.cc [libyuv] Add AVX-512 VNNI row functions for ARGB to YUV and Gray 2026-10-26 14:07:50 -07:00
convert_from.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
convert_jpeg.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
convert_to_argb.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
convert_to_i420.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
convert.cc [libyuv] Add AVX-512 VNNI row functions for ARGB to YUV and Gray 2026-10-26 14:07:50 -07:00
cpu_id.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
mjpeg_decoder.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
mjpeg_validate.cc [libyuv] Keep LIBYUV_API in basic_types.h and remove legacy types and bool macros 2026-08-28 08:32:19 -07:00
planar_functions.cc [libyuv] Add AVX-512 VNNI row functions for ARGB to YUV and Gray 2026-10-26 14:07:50 -07:00
rotate_any.cc [libyuv] Rewrite LoongArch LSX/LASX kernels in compact inline asm 2026-10-16 17:25:23 -07:00
rotate_argb.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
rotate_common.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_gcc.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_hvx.cc [libyuv] Add Qualcomm Hexagon HVX SIMD support 2026-10-19 14:16:18 -07:00
rotate_lasx.cc [libyuv] Rewrite LoongArch LSX/LASX kernels in compact inline asm 2026-10-16 17:25:23 -07:00
rotate_lsx.cc [libyuv] Rewrite LoongArch LSX/LASX kernels in compact inline asm 2026-10-16 17:25:23 -07:00
rotate_neon64.cc AArch64: Avoid lane-indexed LD4 dependency in 32 bit transpose 2026-10-27 12:36:26 -07:00
rotate_neon.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_rvv.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_sme.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_sve.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
rotate_wasm.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate_win.cc [libyuv] Optimize RotatePlane_16 SIMD and compact 32-bit transposes 2026-10-12 10:57:34 -07:00
rotate.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
row_any.cc [libyuv] Add AVX-512 VNNI row functions for ARGB to YUV and Gray 2026-10-26 14:07:50 -07:00
row_common.cc [libyuv] Remove unused prototypes and HAS_ macros 2026-10-27 05:06:39 -07:00
row_gcc.cc [libyuv] Fix MSan uninitialized errors in AVX512 alpha and scale rows 2026-10-27 16:27:29 -07:00
row_hvx.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_lasx.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_lsx.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_neon64.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_neon.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_rvv.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_sme.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_sve.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_wasm.cc [libyuv] Add ARGBOr and ARGBAlphaBlend with multi-platform SIMD 2026-10-26 11:24:16 -07:00
row_win.cc [libyuv] Fix MSan uninitialized errors in AVX512 alpha and scale rows 2026-10-27 16:27:29 -07:00
scale_any.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_argb.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_common.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_gcc.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_hvx.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_lsx.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_neon64.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_neon.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_rgb.cc Fix Coverity Control flow issues (DEADCODE) 2026-07-01 10:39:22 -07:00
scale_rvv.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_sme.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_uv.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
scale_wasm.cc [libyuv] Multi-platform ScaleUVAddCols3 for ScaleUVBox at 3x 2026-10-19 15:56:38 -07:00
scale_win.cc [libyuv] Fix MSan uninitialized errors in AVX512 alpha and scale rows 2026-10-27 16:27:29 -07:00
scale.cc [libyuv] Fix top 20 bugs and performance issues 2026-10-19 16:46:40 -07:00
test.sh Optimze ABGRToI420 for AVX2 2020-06-04 18:24:45 +00:00
video_common.cc Lint cleanup after C99 change CL 2018-01-24 19:16:03 +00:00