Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(crate) fn target() -> Target {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
asm_args: cvs!["-mthumb-interwork", "-march=armv6", "-mlittle-endian",],
features: "+strict-align,+v6k,+vfp2,-d32".into(),
features: "+strict-align,+v6k,+vfp2".into(),
atomic_cas: true,
has_thumb_interworking: true,
// LDREXD/STREXD available as of ARMv6K
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
let mut base = base::android::opts();
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-march=armv7-a"]);
Target {
llvm_target: "armv7-none-linux-android".into(),
llvm_target: "arm-none-linux-android".into(),
metadata: TargetMetadata {
description: Some("Armv7-A Android".into()),
tier: Some(2),
Expand All @@ -28,7 +28,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::Eabi,
llvm_floatabi: Some(FloatAbi::Soft),
features: "+v7,+thumb-mode,+thumb2,+vfp3d16,-neon".into(),

@RalfJung RalfJung Sep 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me wonder if we should generally just disallow negative target features in built-in targets... though I guess sometimes they are actually needed?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it can be avoided and interferes with a valid target-cpu yes I agree

features: "+v7,+db,+dsp,+aclass,+perfmon,+thumb-mode,+thumb2,+vfp3d16".into(),
supported_sanitizers: SanitizerSet::ADDRESS,
max_atomic_width: Some(64),
..base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,

pub(crate) fn target() -> Target {
Target {
llvm_target: "armv7-unknown-freebsd-gnueabihf".into(),
llvm_target: "arm-unknown-freebsd-gnueabihf".into(),
metadata: TargetMetadata {
description: Some("Armv7-A FreeBSD".into()),
tier: Some(3),
Expand All @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
..base::freebsd::opts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::spec::{

pub(crate) fn target() -> Target {
Target {
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
llvm_target: "arm-unknown-linux-gnueabihf".into(),
metadata: TargetMetadata {
description: Some("Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17)".into()),
tier: Some(2),
Expand All @@ -21,7 +21,7 @@ pub(crate) fn target() -> Target {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,

pub(crate) fn target() -> Target {
Target {
llvm_target: "armv7-unknown-linux-musleabihf".into(),
llvm_target: "arm-unknown-linux-musleabihf".into(),
metadata: TargetMetadata {
description: Some("Armv7-A Linux with musl 1.2.5, hardfloat".into()),
tier: Some(2),
Expand All @@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
mcount: "\u{1}mcount".into(),
// FIXME(compiler-team#422): musl targets should be dynamically linked by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {

options: TargetOptions {
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(),
cpu: "generic".into(),
max_atomic_width: Some(64),
mcount: "_mcount".into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,

pub(crate) fn target() -> Target {
Target {
llvm_target: "armv7-unknown-netbsdelf-eabihf".into(),
llvm_target: "arm-unknown-netbsdelf-eabihf".into(),
metadata: TargetMetadata {
description: Some("Armv7-A NetBSD w/hard-float".into()),
tier: Some(3),
Expand All @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
mcount: "__mcount".into(),
..base::netbsd::opts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,

pub(crate) fn target() -> Target {
Target {
llvm_target: "armv7-unknown-linux-gnueabihf".into(),
llvm_target: "arm-unknown-linux-gnueabihf".into(),
metadata: TargetMetadata {
description: Some("Armv7-A for VxWorks".into()),
tier: Some(3),
Expand All @@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(),
max_atomic_width: Some(64),
..base::vxworks::opts()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::spec::{
pub(crate) fn target() -> Target {
let base = base::solid::opts();
Target {
llvm_target: "armv7a-none-eabihf".into(),
llvm_target: "arm-none-eabihf".into(),
metadata: TargetMetadata {
description: Some("Arm SOLID with TOPPERS/ASP3, hardfloat".into()),
tier: Some(3),
Expand All @@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
linker: Some("arm-kmc-eabi-gcc".into()),
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(),
relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(64),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,

pub(crate) fn target() -> Target {
Target {
llvm_target: "armv7a-none-eabihf".into(),
llvm_target: "arm-none-eabihf".into(),
metadata: TargetMetadata {
description: Some("Bare Armv7-A, hardfloat".into()),
tier: Some(2),
Expand All @@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+vfp3d16,-neon,+strict-align".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+strict-align".into(),
max_atomic_width: Some(64),
has_thumb_interworking: true,
..base::arm_none::opts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,

pub(crate) fn target() -> Target {
Target {
llvm_target: "thumbv7a-none-eabihf".into(),
llvm_target: "thumb-none-eabihf".into(),
metadata: TargetMetadata {
description: Some("Thumb-mode Bare Armv7-A, hardfloat".into()),
tier: Some(2),
Expand All @@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
options: TargetOptions {
cfg_abi: CfgAbi::EabiHf,
llvm_floatabi: Some(FloatAbi::Hard),
features: "+vfp3d16,-neon,+strict-align".into(),
features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+strict-align".into(),
max_atomic_width: Some(64),
has_thumb_interworking: true,
..base::arm_none::opts()
Expand Down
8 changes: 4 additions & 4 deletions src/doc/rustc/src/platform-support/armv7a-none-eabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ disabled as needed with `-C target-feature=(+/-)`.

In general, the following four combinations are possible:

- VFPv3-D16, target feature `+vfp3` and `-d32`
- VFPv3-D32, target feature `+vfp3` and `+d32`
- VFPv4-D16, target feature `+vfp4` and `-d32`
- VFPv4-D32, target feature `+vfp4` and `+d32`
- VFPv3-D16, target default
- VFPv3-D32, target feature `+d32`
- VFPv4-D16, llvm target feature `+vfp4d16`
- VFPv4-D32, target feature `+vfp4`

An Armv7-A processor may optionally include a NEON hardware unit which
provides Single Instruction Multiple Data (SIMD) operations. The
Expand Down
8 changes: 8 additions & 0 deletions tests/ui/asm/arm-high-dregs.baseline.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: register class `dreg` requires at least one of the following target features: d32, neon
--> $DIR/arm-high-dregs.rs:23:42
|
LL | asm!("vmov.f64 d16, d0", in("d0") x, out("d16") y);
| ^^^^^^^^^^^^

error: aborting due to 1 previous error

25 changes: 25 additions & 0 deletions tests/ui/asm/arm-high-dregs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//@ add-minicore
//@ only-arm
//@ only-eabihf
//@ ignore-backends: gcc
//@ revisions: baseline target-cpu
//@ [baseline] check-fail
//@ [target-cpu] check-pass
//@ [target-cpu] compile-flags: -Ctarget-cpu=cortex-a5

// As well as the error message, this also tests that d32 is not enabled by default on arm hardfloat
// targets and that it can be re-enabled by target-cpu.

#![feature(f16, no_core)]
#![crate_type = "rlib"]
#![no_core]

extern crate minicore;
use minicore::*;

#[no_mangle]
pub unsafe fn high(x: f64) {
let y: f64;
asm!("vmov.f64 d16, d0", in("d0") x, out("d16") y);
//[baseline]~^ ERROR register class `dreg` requires at least one of the following target features: d32, neon
}
Loading