]> git.proxmox.com Git - rustc.git/blob - src/librustc_back/target/thumbv7em_none_eabi.rs
New upstream version 1.18.0+dfsg1
[rustc.git] / src / librustc_back / target / thumbv7em_none_eabi.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Targets the Cortex-M4 and Cortex-M7 processors (ARMv7E-M)
12 //
13 // This target assumes that the device doesn't have a FPU (Floating Point Unit) and lowers all the
14 // floating point operations to software routines (intrinsics).
15 //
16 // As such, this target uses the "soft" calling convention (ABI) where floating point values are
17 // passed to/from subroutines via general purpose registers (R0, R1, etc.).
18 //
19 // To opt-in to hardware accelerated floating point operations, you can use, for example,
20 // `-C target-feature=+vfp4` or `-C target-cpu=cortex-m4`.
21
22 use LinkerFlavor;
23 use target::{Target, TargetOptions, TargetResult};
24
25 pub fn target() -> TargetResult {
26 Ok(Target {
27 llvm_target: "thumbv7em-none-eabi".to_string(),
28 target_endian: "little".to_string(),
29 target_pointer_width: "32".to_string(),
30 data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
31 arch: "arm".to_string(),
32 target_os: "none".to_string(),
33 target_env: "".to_string(),
34 target_vendor: "".to_string(),
35 linker_flavor: LinkerFlavor::Gcc,
36
37 options: TargetOptions {
38 max_atomic_width: Some(32),
39 .. super::thumb_base::opts()
40 },
41 })
42 }