mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[stdlib] Fix SIMD uint cast

Open martinvuyk opened this issue 7 months ago • 3 comments

Fix issue #3065 by adding some manual bit padding when converting to uint and forcing the bits to be interpreted as the target type, and slicing when target.bitwidth() < type.bitwidth()

Added a bitwidth constraint blocked by issue #933 since the conversion when target.bitwidth() > type.bitwidth() uses llvm interleave intrinsic and merging this would cause conflicts for code using SIMD.cast() at compile time.

The same constraint also blocks slicing that for some reason doesn't work at compile time when bitcasting the result down to the new type width failed to fold operation pop.bitcast

martinvuyk avatar Jul 03 '24 21:07 martinvuyk