I'm writing some code without intrinsics but I am trying to plan the memory layout so it will be easier to switch to intrinsics later (using AOS style instead of SOA).
One issue is that my data structure is expected to be used in context where there are multiple references to mutable data, so I need to use Cell. This means instead of arrays of
f32 they are of
Cell<f32>. I know technically all of the built-in intrinsics are considered unsafe, but I'm wondering whether or not it is UB to apply them to arrays of
Cell<T>, provided I have taken care of making sure there is sufficient alignment to use the intrinsic? Is
Cell<T> guaranteed to have the same memory layout as
T? Are there other considerations for whether it is UB?