modular
modular copied to clipboard
[BUG] When printing the same SIMD vector with multiple print args, SIMD vector values are different
Bug description
Values are different when printing SIMD vector as a single argument in print vs second argument.
Steps to reproduce
alias simd_width = 16
fn main():
print(SIMD[DType.uint8, simd_width](0, 0x0f))
print("arg 1", SIMD[DType.uint8, simd_width](0, 0x0f))
print("arg 1", "arg 2", SIMD[DType.uint8, simd_width](0, 0x0f))
Output:
[0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15]
arg 1 [0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
arg 1 arg 2 [0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15]
The correct output should be a second print (arg1 only).
System information
- What OS did you do install Mojo on ? macOS 12.6
- Provide version information for Mojo by pasting the output of `mojo -v` 24.2.1 (2f0dcf11)
- Provide Modular CLI version by pasting the output of `modular -v` 0.6.0 (04c05243)
Host Information
================
Target Triple: aarch64-unknown-macosx
CPU: apple-m1
CPU Features: aes, complxnum, crc, dotprod, fp-armv8, fp16fml, fullfp16, jsconv, lse, neon, pauth, ras, rcpc, rdm, sha2, sha3
I can't reproduce with mojo 2024.4.1618 (37a3e965), nightly
You didn't provide enough values for vector initialisation so I think it's suppose to be UB.