mark FEAT_FAMINMAX intrinsics as safe

This commit is contained in:
James Barford-Evans
2025-02-28 10:28:22 +00:00
committed by Amanieu d'Antras
parent 5ece6ac059
commit 61b9f9f9eb
2 changed files with 14 additions and 28 deletions

View File

@@ -823,13 +823,11 @@ pub fn vaddvq_u64(a: uint64x2_t) -> u64 {
} }
#[doc = "Multi-vector floating-point absolute maximum"] #[doc = "Multi-vector floating-point absolute maximum"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamax_f32)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamax_f32)"]
#[doc = "## Safety"]
#[doc = " * Neon instrinsic unsafe"]
#[inline] #[inline]
#[target_feature(enable = "neon,faminmax")] #[target_feature(enable = "neon,faminmax")]
#[cfg_attr(test, assert_instr(nop))] #[cfg_attr(test, assert_instr(nop))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")] #[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub unsafe fn vamax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t { pub fn vamax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
unsafe extern "unadjusted" { unsafe extern "unadjusted" {
#[cfg_attr( #[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"), any(target_arch = "aarch64", target_arch = "arm64ec"),
@@ -837,17 +835,15 @@ pub unsafe fn vamax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
)] )]
fn _vamax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t; fn _vamax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t;
} }
_vamax_f32(a, b) unsafe { _vamax_f32(a, b) }
} }
#[doc = "Multi-vector floating-point absolute maximum"] #[doc = "Multi-vector floating-point absolute maximum"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamaxq_f32)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamaxq_f32)"]
#[doc = "## Safety"]
#[doc = " * Neon instrinsic unsafe"]
#[inline] #[inline]
#[target_feature(enable = "neon,faminmax")] #[target_feature(enable = "neon,faminmax")]
#[cfg_attr(test, assert_instr(nop))] #[cfg_attr(test, assert_instr(nop))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")] #[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub unsafe fn vamaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { pub fn vamaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
unsafe extern "unadjusted" { unsafe extern "unadjusted" {
#[cfg_attr( #[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"), any(target_arch = "aarch64", target_arch = "arm64ec"),
@@ -855,17 +851,15 @@ pub unsafe fn vamaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
)] )]
fn _vamaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t; fn _vamaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t;
} }
_vamaxq_f32(a, b) unsafe { _vamaxq_f32(a, b) }
} }
#[doc = "Multi-vector floating-point absolute maximum"] #[doc = "Multi-vector floating-point absolute maximum"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamaxq_f64)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamaxq_f64)"]
#[doc = "## Safety"]
#[doc = " * Neon instrinsic unsafe"]
#[inline] #[inline]
#[target_feature(enable = "neon,faminmax")] #[target_feature(enable = "neon,faminmax")]
#[cfg_attr(test, assert_instr(nop))] #[cfg_attr(test, assert_instr(nop))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")] #[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub unsafe fn vamaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { pub fn vamaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
unsafe extern "unadjusted" { unsafe extern "unadjusted" {
#[cfg_attr( #[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"), any(target_arch = "aarch64", target_arch = "arm64ec"),
@@ -873,17 +867,15 @@ pub unsafe fn vamaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
)] )]
fn _vamaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t; fn _vamaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t;
} }
_vamaxq_f64(a, b) unsafe { _vamaxq_f64(a, b) }
} }
#[doc = "Multi-vector floating-point absolute minimum"] #[doc = "Multi-vector floating-point absolute minimum"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamin_f32)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamin_f32)"]
#[doc = "## Safety"]
#[doc = " * Neon instrinsic unsafe"]
#[inline] #[inline]
#[target_feature(enable = "neon,faminmax")] #[target_feature(enable = "neon,faminmax")]
#[cfg_attr(test, assert_instr(nop))] #[cfg_attr(test, assert_instr(nop))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")] #[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub unsafe fn vamin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t { pub fn vamin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
unsafe extern "unadjusted" { unsafe extern "unadjusted" {
#[cfg_attr( #[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"), any(target_arch = "aarch64", target_arch = "arm64ec"),
@@ -891,17 +883,15 @@ pub unsafe fn vamin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
)] )]
fn _vamin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t; fn _vamin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t;
} }
_vamin_f32(a, b) unsafe { _vamin_f32(a, b) }
} }
#[doc = "Multi-vector floating-point absolute minimum"] #[doc = "Multi-vector floating-point absolute minimum"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaminq_f32)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaminq_f32)"]
#[doc = "## Safety"]
#[doc = " * Neon instrinsic unsafe"]
#[inline] #[inline]
#[target_feature(enable = "neon,faminmax")] #[target_feature(enable = "neon,faminmax")]
#[cfg_attr(test, assert_instr(nop))] #[cfg_attr(test, assert_instr(nop))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")] #[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub unsafe fn vaminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { pub fn vaminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
unsafe extern "unadjusted" { unsafe extern "unadjusted" {
#[cfg_attr( #[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"), any(target_arch = "aarch64", target_arch = "arm64ec"),
@@ -909,17 +899,15 @@ pub unsafe fn vaminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
)] )]
fn _vaminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t; fn _vaminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t;
} }
_vaminq_f32(a, b) unsafe { _vaminq_f32(a, b) }
} }
#[doc = "Multi-vector floating-point absolute minimum"] #[doc = "Multi-vector floating-point absolute minimum"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaminq_f64)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaminq_f64)"]
#[doc = "## Safety"]
#[doc = " * Neon instrinsic unsafe"]
#[inline] #[inline]
#[target_feature(enable = "neon,faminmax")] #[target_feature(enable = "neon,faminmax")]
#[cfg_attr(test, assert_instr(nop))] #[cfg_attr(test, assert_instr(nop))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")] #[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub unsafe fn vaminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { pub fn vaminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
unsafe extern "unadjusted" { unsafe extern "unadjusted" {
#[cfg_attr( #[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"), any(target_arch = "aarch64", target_arch = "arm64ec"),
@@ -927,7 +915,7 @@ pub unsafe fn vaminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
)] )]
fn _vaminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t; fn _vaminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t;
} }
_vaminq_f64(a, b) unsafe { _vaminq_f64(a, b) }
} }
#[doc = "Bit clear and exclusive OR"] #[doc = "Bit clear and exclusive OR"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vbcaxq_s8)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vbcaxq_s8)"]

View File

@@ -13982,8 +13982,7 @@ intrinsics:
- FnCall: [target_feature, ['enable = "neon,faminmax"']] - FnCall: [target_feature, ['enable = "neon,faminmax"']]
- FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [nop]]}]] - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [nop]]}]]
- FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] - FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']]
safety: safety: safe
unsafe: [neon]
types: types:
- float32x2_t - float32x2_t
- float32x4_t - float32x4_t
@@ -14003,8 +14002,7 @@ intrinsics:
- FnCall: [target_feature, ['enable = "neon,faminmax"']] - FnCall: [target_feature, ['enable = "neon,faminmax"']]
- FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [nop]]}]] - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [nop]]}]]
- FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] - FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']]
safety: safety: safe
unsafe: [neon]
types: types:
- float32x2_t - float32x2_t
- float32x4_t - float32x4_t