Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler/rustc_target: Add support for m68k-linux-gnu
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::abi::call::{ArgAbi, FnAbi}; | ||
|
||
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) { | ||
if ret.layout.is_aggregate() { | ||
ret.make_indirect(); | ||
} else { | ||
ret.extend_integer_width_to(32); | ||
} | ||
} | ||
|
||
fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) { | ||
if arg.layout.is_aggregate() { | ||
arg.make_indirect_byval(); | ||
} else { | ||
arg.extend_integer_width_to(32); | ||
} | ||
} | ||
|
||
pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { | ||
if !fn_abi.ret.is_ignore() { | ||
classify_ret(&mut fn_abi.ret); | ||
} | ||
|
||
for arg in &mut fn_abi.args { | ||
if arg.is_ignore() { | ||
continue; | ||
} | ||
classify_arg(arg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use crate::abi::Endian; | ||
use crate::spec::{Target, TargetOptions}; | ||
|
||
pub fn target() -> Target { | ||
let mut base = super::linux_base::opts(); | ||
base.max_atomic_width = Some(32); | ||
|
||
Target { | ||
llvm_target: "m68k-unknown-linux-gnu".to_string(), | ||
pointer_width: 32, | ||
data_layout: "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16".to_string(), | ||
arch: "m68k".to_string(), | ||
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base }, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters