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.
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.
11 // Targets the Cortex-M4 and Cortex-M7 processors (ARMv7E-M)
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).
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.).
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`.
22 use target
::{Target, TargetOptions, TargetResult}
;
24 pub fn target() -> TargetResult
{
26 llvm_target
: "thumbv7em-none-eabi".to_string(),
27 target_endian
: "little".to_string(),
28 target_pointer_width
: "32".to_string(),
29 data_layout
: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
30 arch
: "arm".to_string(),
31 target_os
: "none".to_string(),
32 target_env
: "".to_string(),
33 target_vendor
: "".to_string(),
35 options
: TargetOptions
{
36 max_atomic_width
: Some(32),
37 .. super::thumb_base
::opts()