Skip to content

Commit c4d349c

Browse files
authored
Ensure the neon vector aggregates like float32x4x4_t are #[repr(C)] (rust-lang#1309)
1 parent 6299dd0 commit c4d349c

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

crates/core_arch/src/aarch64/neon/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ types! {
2828
}
2929

3030
/// ARM-specific type containing two `float64x1_t` vectors.
31+
#[repr(C)]
3132
#[derive(Copy, Clone, Debug)]
3233
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
3334
pub struct float64x1x2_t(pub float64x1_t, pub float64x1_t);
3435
/// ARM-specific type containing three `float64x1_t` vectors.
36+
#[repr(C)]
3537
#[derive(Copy, Clone, Debug)]
3638
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
3739
pub struct float64x1x3_t(pub float64x1_t, pub float64x1_t, pub float64x1_t);
3840
/// ARM-specific type containing four `float64x1_t` vectors.
41+
#[repr(C)]
3942
#[derive(Copy, Clone, Debug)]
4043
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
4144
pub struct float64x1x4_t(
@@ -46,14 +49,17 @@ pub struct float64x1x4_t(
4649
);
4750

4851
/// ARM-specific type containing two `float64x2_t` vectors.
52+
#[repr(C)]
4953
#[derive(Copy, Clone, Debug)]
5054
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
5155
pub struct float64x2x2_t(pub float64x2_t, pub float64x2_t);
5256
/// ARM-specific type containing three `float64x2_t` vectors.
57+
#[repr(C)]
5358
#[derive(Copy, Clone, Debug)]
5459
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
5560
pub struct float64x2x3_t(pub float64x2_t, pub float64x2_t, pub float64x2_t);
5661
/// ARM-specific type containing four `float64x2_t` vectors.
62+
#[repr(C)]
5763
#[derive(Copy, Clone, Debug)]
5864
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
5965
pub struct float64x2x4_t(

0 commit comments

Comments
 (0)