Skip to content

Commit 1088aae

Browse files
JamesbarfordAmanieu
authored andcommitted
feat - FEAT_FAMINMAX neon intrinsics
1 parent 694214b commit 1088aae

File tree

3 files changed

+312
-0
lines changed

3 files changed

+312
-0
lines changed

library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,114 @@ pub fn vaddvq_u64(a: uint64x2_t) -> u64 {
821821
}
822822
unsafe { _vaddvq_u64(a) }
823823
}
824+
#[doc = "Multi-vector floating-point absolute maximum"]
825+
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamax_f32)"]
826+
#[doc = "## Safety"]
827+
#[doc = " * Neon instrinsic unsafe"]
828+
#[inline]
829+
#[target_feature(enable = "neon,faminmax")]
830+
#[cfg_attr(test, assert_instr(famax))]
831+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
832+
pub unsafe fn vamax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
833+
unsafe extern "unadjusted" {
834+
#[cfg_attr(
835+
any(target_arch = "aarch64", target_arch = "arm64ec"),
836+
link_name = "llvm.aarch64.neon.famax.v2f32"
837+
)]
838+
fn _vamax_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t;
839+
}
840+
_vamax_f32(a, b)
841+
}
842+
#[doc = "Multi-vector floating-point absolute maximum"]
843+
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamaxq_f32)"]
844+
#[doc = "## Safety"]
845+
#[doc = " * Neon instrinsic unsafe"]
846+
#[inline]
847+
#[target_feature(enable = "neon,faminmax")]
848+
#[cfg_attr(test, assert_instr(famax))]
849+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
850+
pub unsafe fn vamaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
851+
unsafe extern "unadjusted" {
852+
#[cfg_attr(
853+
any(target_arch = "aarch64", target_arch = "arm64ec"),
854+
link_name = "llvm.aarch64.neon.famax.v4f32"
855+
)]
856+
fn _vamaxq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t;
857+
}
858+
_vamaxq_f32(a, b)
859+
}
860+
#[doc = "Multi-vector floating-point absolute maximum"]
861+
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamaxq_f64)"]
862+
#[doc = "## Safety"]
863+
#[doc = " * Neon instrinsic unsafe"]
864+
#[inline]
865+
#[target_feature(enable = "neon,faminmax")]
866+
#[cfg_attr(test, assert_instr(famax))]
867+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
868+
pub unsafe fn vamaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
869+
unsafe extern "unadjusted" {
870+
#[cfg_attr(
871+
any(target_arch = "aarch64", target_arch = "arm64ec"),
872+
link_name = "llvm.aarch64.neon.famax.v2f64"
873+
)]
874+
fn _vamaxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t;
875+
}
876+
_vamaxq_f64(a, b)
877+
}
878+
#[doc = "Multi-vector floating-point absolute minimum"]
879+
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamin_f32)"]
880+
#[doc = "## Safety"]
881+
#[doc = " * Neon instrinsic unsafe"]
882+
#[inline]
883+
#[target_feature(enable = "neon,faminmax")]
884+
#[cfg_attr(test, assert_instr(famin))]
885+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
886+
pub unsafe fn vamin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t {
887+
unsafe extern "unadjusted" {
888+
#[cfg_attr(
889+
any(target_arch = "aarch64", target_arch = "arm64ec"),
890+
link_name = "llvm.aarch64.neon.famin.v2f32"
891+
)]
892+
fn _vamin_f32(a: float32x2_t, b: float32x2_t) -> float32x2_t;
893+
}
894+
_vamin_f32(a, b)
895+
}
896+
#[doc = "Multi-vector floating-point absolute minimum"]
897+
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaminq_f32)"]
898+
#[doc = "## Safety"]
899+
#[doc = " * Neon instrinsic unsafe"]
900+
#[inline]
901+
#[target_feature(enable = "neon,faminmax")]
902+
#[cfg_attr(test, assert_instr(famin))]
903+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
904+
pub unsafe fn vaminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t {
905+
unsafe extern "unadjusted" {
906+
#[cfg_attr(
907+
any(target_arch = "aarch64", target_arch = "arm64ec"),
908+
link_name = "llvm.aarch64.neon.famin.v4f32"
909+
)]
910+
fn _vaminq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t;
911+
}
912+
_vaminq_f32(a, b)
913+
}
914+
#[doc = "Multi-vector floating-point absolute minimum"]
915+
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaminq_f64)"]
916+
#[doc = "## Safety"]
917+
#[doc = " * Neon instrinsic unsafe"]
918+
#[inline]
919+
#[target_feature(enable = "neon,faminmax")]
920+
#[cfg_attr(test, assert_instr(famin))]
921+
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
922+
pub unsafe fn vaminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
923+
unsafe extern "unadjusted" {
924+
#[cfg_attr(
925+
any(target_arch = "aarch64", target_arch = "arm64ec"),
926+
link_name = "llvm.aarch64.neon.famin.v2f64"
927+
)]
928+
fn _vaminq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t;
929+
}
930+
_vaminq_f64(a, b)
931+
}
824932
#[doc = "Bit clear and exclusive OR"]
825933
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vbcaxq_s8)"]
826934
#[inline]

library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13973,3 +13973,45 @@ intrinsics:
1397313973
- - r
1397413974
- a
1397513975
- FnCall: ["vdup{neon_type[1].N}", [{FnCall: [simd_extract!, [b, 'LANE as u32']]}]]
13976+
13977+
- name: "vamax{neon_type.no}"
13978+
doc: "Multi-vector floating-point absolute maximum"
13979+
arguments: ["a: {neon_type}", "b: {neon_type}"]
13980+
return_type: "{neon_type}"
13981+
attr:
13982+
- FnCall: [target_feature, ['enable = "neon,faminmax"']]
13983+
- FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [famax]]}]]
13984+
- FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']]
13985+
safety:
13986+
unsafe: [neon]
13987+
types:
13988+
- float32x2_t
13989+
- float32x4_t
13990+
- float64x2_t
13991+
compose:
13992+
- LLVMLink:
13993+
name: "_vamax{neon_type.no}"
13994+
links:
13995+
- link: "llvm.aarch64.neon.famax.{neon_type}"
13996+
arch: aarch64,arm64ec
13997+
13998+
- name: "vamin{neon_type.no}"
13999+
doc: "Multi-vector floating-point absolute minimum"
14000+
arguments: ["a: {neon_type}", "b: {neon_type}"]
14001+
return_type: "{neon_type}"
14002+
attr:
14003+
- FnCall: [target_feature, ['enable = "neon,faminmax"']]
14004+
- FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [famin]]}]]
14005+
- FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']]
14006+
safety:
14007+
unsafe: [neon]
14008+
types:
14009+
- float32x2_t
14010+
- float32x4_t
14011+
- float64x2_t
14012+
compose:
14013+
- LLVMLink:
14014+
name: "_vamin{neon_type.no}"
14015+
links:
14016+
- link: "llvm.aarch64.neon.famin.{neon_type}"
14017+
arch: aarch64,arm64ec

library/stdarch/intrinsics_data/arm_intrinsics.json

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118681,5 +118681,167 @@
118681118681
"ZIP2"
118682118682
]
118683118683
]
118684+
},
118685+
{
118686+
"SIMD_ISA": "Neon",
118687+
"name": "vamin_f32",
118688+
"arguments": [
118689+
"float32x2_t a",
118690+
"float32x2_t b"
118691+
],
118692+
"return_type": {
118693+
"value": "float32x2_t"
118694+
},
118695+
"Arguments_Preparation": {
118696+
"a": {
118697+
"register": "Vn.2S"
118698+
},
118699+
"b": {
118700+
"register": "Vm.2S"
118701+
}
118702+
},
118703+
"Architectures": [
118704+
"A64"
118705+
],
118706+
"instructions": [
118707+
[
118708+
"FAMIN"
118709+
]
118710+
]
118711+
},
118712+
{
118713+
"SIMD_ISA": "Neon",
118714+
"name": "vaminq_f32",
118715+
"arguments": [
118716+
"float32x4_t a",
118717+
"float32x4_t b"
118718+
],
118719+
"return_type": {
118720+
"value": "float32x4_t"
118721+
},
118722+
"Arguments_Preparation": {
118723+
"a": {
118724+
"register": "Vn.4S"
118725+
},
118726+
"b": {
118727+
"register": "Vm.4S"
118728+
}
118729+
},
118730+
"Architectures": [
118731+
"A64"
118732+
],
118733+
"instructions": [
118734+
[
118735+
"FAMIN"
118736+
]
118737+
]
118738+
},
118739+
{
118740+
"SIMD_ISA": "Neon",
118741+
"name": "vaminq_f64",
118742+
"arguments": [
118743+
"float64x2_t a",
118744+
"float64x2_t b"
118745+
],
118746+
"return_type": {
118747+
"value": "float64x2_t"
118748+
},
118749+
"Arguments_Preparation": {
118750+
"a": {
118751+
"register": "Vn.2D"
118752+
},
118753+
"b": {
118754+
"register": "Vm.2D"
118755+
}
118756+
},
118757+
"Architectures": [
118758+
"A64"
118759+
],
118760+
"instructions": [
118761+
[
118762+
"FAMIN"
118763+
]
118764+
]
118765+
},
118766+
{
118767+
"SIMD_ISA": "Neon",
118768+
"name": "vamax_f32",
118769+
"arguments": [
118770+
"float32x2_t a",
118771+
"float32x2_t b"
118772+
],
118773+
"return_type": {
118774+
"value": "float32x2_t"
118775+
},
118776+
"Arguments_Preparation": {
118777+
"a": {
118778+
"register": "Vn.2S"
118779+
},
118780+
"b": {
118781+
"register": "Vm.2S"
118782+
}
118783+
},
118784+
"Architectures": [
118785+
"A64"
118786+
],
118787+
"instructions": [
118788+
[
118789+
"FAMAX"
118790+
]
118791+
]
118792+
},
118793+
{
118794+
"SIMD_ISA": "Neon",
118795+
"name": "vamaxq_f32",
118796+
"arguments": [
118797+
"float32x4_t a",
118798+
"float32x4_t b"
118799+
],
118800+
"return_type": {
118801+
"value": "float32x4_t"
118802+
},
118803+
"Arguments_Preparation": {
118804+
"a": {
118805+
"register": "Vn.4S"
118806+
},
118807+
"b": {
118808+
"register": "Vm.4S"
118809+
}
118810+
},
118811+
"Architectures": [
118812+
"A64"
118813+
],
118814+
"instructions": [
118815+
[
118816+
"FAMAX"
118817+
]
118818+
]
118819+
},
118820+
{
118821+
"SIMD_ISA": "Neon",
118822+
"name": "vamaxq_f64",
118823+
"arguments": [
118824+
"float64x2_t a",
118825+
"float64x2_t b"
118826+
],
118827+
"return_type": {
118828+
"value": "float64x2_t"
118829+
},
118830+
"Arguments_Preparation": {
118831+
"a": {
118832+
"register": "Vn.2D"
118833+
},
118834+
"b": {
118835+
"register": "Vm.2D"
118836+
}
118837+
},
118838+
"Architectures": [
118839+
"A64"
118840+
],
118841+
"instructions": [
118842+
[
118843+
"FAMAX"
118844+
]
118845+
]
118684118846
}
118685118847
]

0 commit comments

Comments
 (0)