Prefer not implementing intrinsics in a way that breaks in edge cases #99
Labels
c: rustc_codegen_spirv
Issues specific to the rustc_codegen_spirv crate.
t: enhancement
A new feature or improvement to an existing one.
For example
saturating_add
isn't implemented in a saturating way:rust-gpu/rustc_codegen_spirv/src/builder/intrinsics.rs
Lines 88 to 97 in f4f1031
This is more of a lesson I learnt the hard way than an issue with rust-gpu itself. While it may seem like a good idea at first to get it quickly working, it will backfire in the long term. I have spent quite a lot of time debugging miscompilations in cg_clif caused by exactly this kind of shortcuts. At minimum I think you should add a
FIXME
every time you add such a shortcut.The text was updated successfully, but these errors were encountered: