Wrong alignment on vectors
Since vectors are defined with type aliases they have an incorrect alignment.
For example this has an alignment of 8
typedef float float2 __attribute__((vector_size(2 * sizeof(float))));
The generated bindgen code is
pub type float2 = [f32; 2usize];
which has an alignment of 4 instead of the expected 8.
__vector_size__/ext_vector_type should work, is vector_size standard/documented syntax?
https://github.com/rust-lang/rust-bindgen/blob/97ab9152b5edb1fda1ced9bc1604f5e4dc9cfaa9/bindgen-tests/tests/headers/vector.hpp#L1-L3 https://github.com/rust-lang/rust-bindgen/blob/97ab9152b5edb1fda1ced9bc1604f5e4dc9cfaa9/bindgen-tests/tests/headers/opencl_vector.h#L1-L2
Could just be an uncaught variant, some of the work done here is only 2 weeks old.
The issue isn't specific to that syntax; using ext_vector_type would result in the same problem.
The current implementation for vectors represents them with an array which have a different alignment than the SIMD types.
https://github.com/rust-lang/rust-bindgen/blob/97ab9152b5edb1fda1ced9bc1604f5e4dc9cfaa9/bindgen/codegen/mod.rs#L4369-L4371
A solution would be to wrap them in a struct to preserve alignment similar to what's being done for opaque arrays
https://github.com/rust-lang/rust-bindgen/blob/97ab9152b5edb1fda1ced9bc1604f5e4dc9cfaa9/bindgen/codegen/helpers.rs#L105-L109