Skip to content

Commit 3944043

Browse files
committed
Make Fused Multiply-Add intrinsics require vfp4 instead of armv8.
1 parent 30b3eb3 commit 3944043

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

crates/core_arch/src/arm_shared/neon/generated.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -8721,7 +8721,7 @@ pub unsafe fn vmull_laneq_u32<const LANE: i32>(a: uint32x2_t, b: uint32x4_t) ->
87218721
/// Floating-point fused Multiply-Add to accumulator(vector)
87228722
#[inline]
87238723
#[target_feature(enable = "neon")]
8724-
#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
8724+
#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
87258725
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfma))]
87268726
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmla))]
87278727
pub unsafe fn vfma_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
@@ -8737,7 +8737,7 @@ vfma_f32_(b, c, a)
87378737
/// Floating-point fused Multiply-Add to accumulator(vector)
87388738
#[inline]
87398739
#[target_feature(enable = "neon")]
8740-
#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
8740+
#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
87418741
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfma))]
87428742
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmla))]
87438743
pub unsafe fn vfmaq_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
@@ -8753,7 +8753,7 @@ vfmaq_f32_(b, c, a)
87538753
/// Floating-point fused Multiply-Add to accumulator(vector)
87548754
#[inline]
87558755
#[target_feature(enable = "neon")]
8756-
#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
8756+
#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
87578757
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfma))]
87588758
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmla))]
87598759
pub unsafe fn vfma_n_f32(a: float32x2_t, b: float32x2_t, c: f32) -> float32x2_t {
@@ -8763,7 +8763,7 @@ pub unsafe fn vfma_n_f32(a: float32x2_t, b: float32x2_t, c: f32) -> float32x2_t
87638763
/// Floating-point fused Multiply-Add to accumulator(vector)
87648764
#[inline]
87658765
#[target_feature(enable = "neon")]
8766-
#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
8766+
#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
87678767
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfma))]
87688768
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmla))]
87698769
pub unsafe fn vfmaq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t {
@@ -8773,7 +8773,7 @@ pub unsafe fn vfmaq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t
87738773
/// Floating-point fused multiply-subtract from accumulator
87748774
#[inline]
87758775
#[target_feature(enable = "neon")]
8776-
#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
8776+
#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
87778777
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfms))]
87788778
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmls))]
87798779
pub unsafe fn vfms_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float32x2_t {
@@ -8784,7 +8784,7 @@ pub unsafe fn vfms_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t) -> float3
87848784
/// Floating-point fused multiply-subtract from accumulator
87858785
#[inline]
87868786
#[target_feature(enable = "neon")]
8787-
#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
8787+
#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
87888788
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfms))]
87898789
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmls))]
87908790
pub unsafe fn vfmsq_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float32x4_t {
@@ -8795,7 +8795,7 @@ pub unsafe fn vfmsq_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t) -> float
87958795
/// Floating-point fused Multiply-subtract to accumulator(vector)
87968796
#[inline]
87978797
#[target_feature(enable = "neon")]
8798-
#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
8798+
#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
87998799
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfms))]
88008800
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmls))]
88018801
pub unsafe fn vfms_n_f32(a: float32x2_t, b: float32x2_t, c: f32) -> float32x2_t {
@@ -8805,7 +8805,7 @@ pub unsafe fn vfms_n_f32(a: float32x2_t, b: float32x2_t, c: f32) -> float32x2_t
88058805
/// Floating-point fused Multiply-subtract to accumulator(vector)
88068806
#[inline]
88078807
#[target_feature(enable = "neon")]
8808-
#[cfg_attr(target_arch = "arm", target_feature(enable = "fp-armv8,v8"))]
8808+
#[cfg_attr(target_arch = "arm", target_feature(enable = "vfp4"))]
88098809
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vfms))]
88108810
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(fmls))]
88118811
pub unsafe fn vfmsq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t {

crates/stdarch-gen/neon.spec

+4-4
Original file line numberDiff line numberDiff line change
@@ -2733,7 +2733,7 @@ generate float64x1_t
27332733
aarch64 = fmla
27342734
generate float64x2_t
27352735

2736-
target = fp-armv8
2736+
target = vfp4
27372737
arm = vfma
27382738
link-arm = llvm.fma._EXT_
27392739
generate float*_t
@@ -2752,7 +2752,7 @@ generate float64x1_t:float64x1_t:f64:float64x1_t
27522752
aarch64 = fmla
27532753
generate float64x2_t:float64x2_t:f64:float64x2_t
27542754

2755-
target = fp-armv8
2755+
target = vfp4
27562756
arm = vfma
27572757
generate float32x2_t:float32x2_t:f32:float32x2_t, float32x4_t:float32x4_t:f32:float32x4_t
27582758

@@ -2811,7 +2811,7 @@ generate float64x1_t
28112811
aarch64 = fmls
28122812
generate float64x2_t
28132813

2814-
target = fp-armv8
2814+
target = vfp4
28152815
arm = vfms
28162816
generate float*_t
28172817

@@ -2829,7 +2829,7 @@ generate float64x1_t:float64x1_t:f64:float64x1_t
28292829
aarch64 = fmls
28302830
generate float64x2_t:float64x2_t:f64:float64x2_t
28312831

2832-
target = fp-armv8
2832+
target = vfp4
28332833
arm = vfms
28342834
generate float32x2_t:float32x2_t:f32:float32x2_t, float32x4_t:float32x4_t:f32:float32x4_t
28352835

crates/stdarch-gen/src/main.rs

+5
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ enum Suffix {
438438
enum TargetFeature {
439439
Default,
440440
ArmV7,
441+
Vfp4,
441442
FPArmV8,
442443
AES,
443444
}
@@ -980,6 +981,7 @@ fn gen_aarch64(
980981
let current_target = match target {
981982
Default => "neon",
982983
ArmV7 => "v7",
984+
Vfp4 => "vfp4",
983985
FPArmV8 => "fp-armv8,v8",
984986
AES => "neon,aes",
985987
};
@@ -1630,12 +1632,14 @@ fn gen_arm(
16301632
let current_target_aarch64 = match target {
16311633
Default => "neon",
16321634
ArmV7 => "neon",
1635+
Vfp4 => "neon",
16331636
FPArmV8 => "neon",
16341637
AES => "neon,aes",
16351638
};
16361639
let current_target_arm = match target {
16371640
Default => "v7",
16381641
ArmV7 => "v7",
1642+
Vfp4 => "vfp4",
16391643
FPArmV8 => "fp-armv8,v8",
16401644
AES => "aes,v8",
16411645
};
@@ -2854,6 +2858,7 @@ mod test {
28542858
target = match Some(String::from(&line[9..])) {
28552859
Some(input) => match input.as_str() {
28562860
"v7" => ArmV7,
2861+
"vfp4" => Vfp4,
28572862
"fp-armv8" => FPArmV8,
28582863
"aes" => AES,
28592864
_ => Default,

0 commit comments

Comments
 (0)