From 79ae91e7d37c4b553005d4aa97fec3c68afabdf1 Mon Sep 17 00:00:00 2001 From: Weaselbot Date: Sun, 2 Aug 2026 22:25:16 -0400 Subject: [PATCH] Correct rationale in simd_x86_64.S comment The SIMD operations are written in assembly because loading and operating on indeterminate values is UB in C++ but well-defined in assembly. msan not tracking the loads is a side effect, not the reason. Closes #71 --- simd_x86_64.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/simd_x86_64.S b/simd_x86_64.S index 38ed58b..5c56c2a 100644 --- a/simd_x86_64.S +++ b/simd_x86_64.S @@ -1,7 +1,8 @@ // SIMD operations on potentially-indeterminate Node16::index[16] bytes. -// Written in assembly so msan doesn't track the loads. The caller is -// responsible for masking the returned bitfield to [0, numChildren) before -// using it. +// Written in assembly because loading and operating on indeterminate values +// is UB in C++ but well-defined in assembly. (A side effect is that msan +// doesn't track the loads.) The caller is responsible for masking the +// returned bitfield to [0, numChildren) before using it. // // All functions return a 16-bit bitmask in %eax (bit i set = condition true // at index i). The upper 16 bits of %eax are zero.