forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#41524 - michaelwu:basic-hexagon, r=alexcric…
…hton Add Hexagon support This requires an updated LLVM with https://reviews.llvm.org/D31999 and https://reviews.llvm.org/D32000 to build libcore. A basic hello world builds and runs successfully on the hexagon simulator. libcore is fine with LLVM fixes, but libstd requires a lot more work since there's a custom rtos running on most hexagon cores. Running Linux sounds possible though, so maybe getting linux + musl going would be easier. Here's the target file I've been using for testing ``` { "arch": "hexagon", "llvm-target": "hexagon-unknown-elf", "os": "none", "target-endian": "little", "target-pointer-width": "32", "data-layout": "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048", "linker": "hexagon-clang", "linker-flavor": "gcc", "executables": true, "cpu": "hexagonv60" } ```
- Loading branch information
Showing
10 changed files
with
102 additions
and
33 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
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
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
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,43 @@ | ||
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![allow(non_upper_case_globals)] | ||
|
||
use abi::{FnType, ArgType, LayoutExt}; | ||
use context::CrateContext; | ||
|
||
fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tcx>) { | ||
if ret.layout.is_aggregate() && ret.layout.size(ccx).bits() > 64 { | ||
ret.make_indirect(ccx); | ||
} else { | ||
ret.extend_integer_width_to(32); | ||
} | ||
} | ||
|
||
fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) { | ||
if arg.layout.is_aggregate() && arg.layout.size(ccx).bits() > 64 { | ||
arg.make_indirect(ccx); | ||
} else { | ||
arg.extend_integer_width_to(32); | ||
} | ||
} | ||
|
||
pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fty: &mut FnType<'tcx>) { | ||
if !fty.ret.is_ignore() { | ||
classify_ret_ty(ccx, &mut fty.ret); | ||
} | ||
|
||
for arg in &mut fty.args { | ||
if arg.is_ignore() { | ||
continue; | ||
} | ||
classify_arg_ty(ccx, 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
Submodule llvm
updated
2 files
+14 −13 | lib/Target/Hexagon/HexagonISelLowering.cpp | |
+5 −0 | lib/Target/Hexagon/HexagonISelLowering.h |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# If this file is modified, then llvm will be (optionally) cleaned and then rebuilt. | ||
# The actual contents of this file do not matter, but to trigger a change on the | ||
# build bots then the contents should be changed so git updates the mtime. | ||
2017-03-23 | ||
2017-04-25 |