simde icon indicating copy to clipboard operation
simde copied to clipboard

Many intrinsics exhibit signed integer overflow UB

Open nikic opened this issue 7 months ago • 0 comments

For example simde_vmul_laneq_s32: https://github.com/simd-everywhere/simde/blob/51743e7920b6e867678cb50e9c62effe28f70b33/simde/arm/neon/mul_lane.h#L389

The multiplication here is UB if signed overflow occurs. The ARM documentation does not specify such UB: https://developer.arm.com/architectures/instruction-sets/intrinsics/vmul_laneq_s32

The correct way to perform the multiplication would be to cast to (uint32_t) first.

This causes test failures with clang 20.

nikic avatar Jun 02 '25 14:06 nikic