Skip to content
Permalink
Browse files

tl45

  • Loading branch information
Codetector1374 committed Feb 5, 2020
1 parent a8fac2f commit 8004aab4baa7ca259f47092a00bd36fa562ad485
@@ -0,0 +1,138 @@
src/bootstrap/native.rs
src/llvm-project/clang/utils/TableGen/ClangAttrEmitter.cpp
src/llvm-project/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
src/llvm-project/clang/lib/Driver/ToolChains/MSP430.cpp
src/llvm-project/clang/lib/Driver/ToolChains/MSP430.h
src/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp
src/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp
src/llvm-project/clang/lib/Driver/Driver.cpp
src/llvm-project/clang/lib/Driver/CMakeLists.txt
src/llvm-project/clang/lib/Basic/Targets.cpp
src/llvm-project/clang/lib/Basic/Targets/MSP430.cpp
src/llvm-project/clang/lib/Basic/Targets/MSP430.h
src/llvm-project/clang/lib/Basic/CMakeLists.txt
src/llvm-project/clang/lib/CodeGen/TargetInfo.cpp
src/llvm-project/clang/lib/Sema/SemaDeclAttr.cpp
src/llvm-project/clang/bindings/python/tests/cindex/test_type.py
src/llvm-project/clang/include/clang/Basic/Attr.td
src/llvm-project/clang/include/clang/Basic/DiagnosticDriverKinds.td
src/llvm-project/clang/include/clang/Basic/MSP430Target.def
src/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td
src/llvm-project/clang/include/clang/module.modulemap
src/llvm-project/clang/docs/UsersManual.rst
src/llvm-project/clang/docs/DiagnosticsReference.rst
src/llvm-project/clang/docs/InternalsManual.rst
src/llvm-project/lld/ELF/Arch/MSP430.cpp
src/llvm-project/lld/ELF/InputFiles.cpp
src/llvm-project/lld/ELF/Target.h
src/llvm-project/lld/ELF/Target.cpp
src/llvm-project/lld/ELF/CMakeLists.txt
src/llvm-project/llvm/cmake/config-ix.cmake
src/llvm-project/llvm/utils/gn/secondary/clang/lib/Driver/BUILD.gn
src/llvm-project/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
src/llvm-project/llvm/utils/gn/secondary/lld/ELF/BUILD.gn
src/llvm-project/llvm/utils/gn/TODO.txt
src/llvm-project/llvm/utils/vim/syntax/llvm.vim
src/llvm-project/llvm/lib/ObjectYAML/ELFYAML.cpp
src/llvm-project/llvm/lib/Object/ELF.cpp
src/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
src/llvm-project/llvm/lib/Support/Triple.cpp
src/llvm-project/llvm/lib/IR/AsmWriter.cpp
src/llvm-project/llvm/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.h
src/llvm-project/llvm/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp
src/llvm-project/llvm/lib/Target/MSP430/TargetInfo/LLVMBuild.txt
src/llvm-project/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt
src/llvm-project/llvm/lib/Target/MSP430/MSP430FrameLowering.h
src/llvm-project/llvm/lib/Target/MSP430/MSP430MCInstLower.h
src/llvm-project/llvm/lib/Target/MSP430/MSP430.td
src/llvm-project/llvm/lib/Target/MSP430/MSP430RegisterInfo.h
src/llvm-project/llvm/lib/Target/MSP430/MSP430TargetMachine.h
src/llvm-project/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430MCInstLower.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430InstrInfo.td
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430FixupKinds.h
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCCodeEmitter.cpp
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430AsmBackend.cpp
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.h
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430ELFStreamer.cpp
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430InstPrinter.h
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/MSP430InstPrinter.cpp
src/llvm-project/llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt
src/llvm-project/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430ISelLowering.h
src/llvm-project/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430RegisterInfo.td
src/llvm-project/llvm/lib/Target/MSP430/MSP430.h
src/llvm-project/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430Subtarget.h
src/llvm-project/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
src/llvm-project/llvm/lib/Target/MSP430/Disassembler/LLVMBuild.txt
src/llvm-project/llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt
src/llvm-project/llvm/lib/Target/MSP430/LLVMBuild.txt
src/llvm-project/llvm/lib/Target/MSP430/README.txt
src/llvm-project/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h
src/llvm-project/llvm/lib/Target/MSP430/MSP430Subtarget.cpp
src/llvm-project/llvm/lib/Target/MSP430/AsmParser/LLVMBuild.txt
src/llvm-project/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
src/llvm-project/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt
src/llvm-project/llvm/lib/Target/MSP430/MSP430InstrInfo.h
src/llvm-project/llvm/lib/Target/MSP430/MSP430InstrFormats.td
src/llvm-project/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp
src/llvm-project/llvm/lib/Target/MSP430/CMakeLists.txt
src/llvm-project/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp
src/llvm-project/llvm/lib/Target/MSP430/MSP430CallingConv.td
src/llvm-project/llvm/lib/Target/LLVMBuild.txt
src/llvm-project/llvm/lib/AsmParser/LLLexer.cpp
src/llvm-project/llvm/lib/AsmParser/LLParser.cpp
src/llvm-project/llvm/lib/AsmParser/LLToken.h
src/llvm-project/llvm/bindings/python/llvm/disassembler.py
src/llvm-project/llvm/include/llvm/Object/ELFObjectFile.h
src/llvm-project/llvm/include/llvm/CodeGen/SelectionDAGISel.h
src/llvm-project/llvm/include/llvm/module.modulemap
src/llvm-project/llvm/include/llvm/IR/CallingConv.h
src/llvm-project/llvm/include/llvm/ADT/Triple.h
src/llvm-project/llvm/include/llvm/BinaryFormat/ELFRelocs/MSP430.def
src/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h
src/llvm-project/llvm/include/llvm-c/Core.h
src/llvm-project/llvm/unittests/ADT/TripleTest.cpp
src/llvm-project/llvm/docs/LangRef.rst
src/llvm-project/llvm/docs/GettingStarted.rst
src/llvm-project/llvm/docs/CodeGenerator.rst
src/llvm-project/llvm/CMakeLists.txt
src/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp
src/llvm-project/polly/lib/External/isl/config.sub
src/llvm-project/polly/lib/External/ppcg/config.sub
src/llvm-project/llgo/irgen/targets.go
src/llvm-project/llgo/autoconf/config.sub
src/llvm-project/llgo/third_party/gofrontend/config.sub
src/librustc_codegen_llvm/llvm/ffi.rs
src/librustc_codegen_llvm/abi.rs
src/librustdoc/clean/cfg.rs
src/librustc_target/spec/tl45_unknown_unknown.rs
src/librustc_target/spec/msp430_none_elf.rs
src/librustc_target/spec/mod.rs
src/librustc_target/spec/abi.rs
src/librustc_target/spec/nvptx64_nvidia_cuda.rs
src/librustc_target/spec/riscv_base.rs
src/librustc_target/abi/call/mod.rs
src/librustc_target/abi/call/msp430.rs
src/ci/docker/dist-armv7-linux/armv7-linux-gnueabihf.config
src/ci/docker/disabled/dist-x86_64-haiku/llvm-config.sh
src/ci/docker/dist-various-1/riscv64-unknown-linux-gnu.config
src/librustc/ty/layout.rs
src/rustllvm/PassWrapper.cpp
src/librustc_ast_passes/feature_gate.rs
src/librustc_span/symbol.rs
src/tools/compiletest/src/util.rs
src/librustc_feature/active.rs
msp430.grep
RELEASES.md
config.toml
@@ -77,6 +77,7 @@ fn main() {
"sparc",
"nvptx",
"hexagon",
"tl45",
];

let mut version_cmd = Command::new(&llvm_config);
@@ -125,6 +125,14 @@ pub fn initialize_available_targets() {
LLVMInitializeRISCVAsmPrinter,
LLVMInitializeRISCVAsmParser
);
init_target!(
llvm_component = "tl45",
LLVMInitializeTL45TargetInfo,
LLVMInitializeTL45Target,
LLVMInitializeTL45TargetMC,
LLVMInitializeTL45AsmPrinter,
LLVMInitializeTL45AsmParser
);
init_target!(
llvm_component = "sparc",
LLVMInitializeSparcTargetInfo,
@@ -22,6 +22,7 @@ mod wasm32_bindgen_compat;
mod x86;
mod x86_64;
mod x86_win64;
mod tl45;

#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum PassMode {
@@ -536,6 +537,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
"hexagon" => hexagon::compute_abi_info(self),
"riscv32" => riscv::compute_abi_info(self, 32),
"riscv64" => riscv::compute_abi_info(self, 64),
"tl45" => tl45::compute_abi_info(self, 32),
"wasm32" if cx.target_spec().target_os != "emscripten" => {
wasm32_bindgen_compat::compute_abi_info(self)
}
@@ -0,0 +1,48 @@
// TL45 ABI

use crate::abi::call::{ArgAbi, FnAbi};

fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>, xlen: u64) {
// "Scalars wider than 2✕XLEN are passed by reference and are replaced in
// the argument list with the address."
// "Aggregates larger than 2✕XLEN bits are passed by reference and are
// replaced in the argument list with the address, as are C++ aggregates
// with nontrivial copy constructors, destructors, or vtables."
if arg.layout.size.bits() > 2 * xlen {
arg.make_indirect();
}

// "When passed in registers, scalars narrower than XLEN bits are widened
// according to the sign of their type up to 32 bits, then sign-extended to
// XLEN bits."
arg.extend_integer_width_to(xlen); // this method only affects integer scalars
}

fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>, xlen: u64) {
// "Scalars wider than 2✕XLEN are passed by reference and are replaced in
// the argument list with the address."
// "Aggregates larger than 2✕XLEN bits are passed by reference and are
// replaced in the argument list with the address, as are C++ aggregates
// with nontrivial copy constructors, destructors, or vtables."
if arg.layout.size.bits() > 2 * xlen {
arg.make_indirect();
}

// "When passed in registers, scalars narrower than XLEN bits are widened
// according to the sign of their type up to 32 bits, then sign-extended to
// XLEN bits."
arg.extend_integer_width_to(xlen); // this method only affects integer scalars
}

pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>, xlen: u64) {
if !fn_abi.ret.is_ignore() {
classify_ret(&mut fn_abi.ret, xlen);
}

for arg in &mut fn_abi.args {
if arg.is_ignore() {
continue;
}
classify_arg(arg, xlen);
}
}
@@ -493,6 +493,8 @@ supported_targets! {
("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf),
("riscv64gc-unknown-linux-gnu", riscv64gc_unknown_linux_gnu),

("tl45-unknown-unknown", tl45_unknown_unknown),

("aarch64-unknown-none", aarch64_unknown_none),
("aarch64-unknown-none-softfloat", aarch64_unknown_none_softfloat),

@@ -0,0 +1,44 @@
use crate::spec::{LldFlavor, LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
use crate::spec::abi::{Abi};

pub fn target() -> TargetResult {
Ok(Target {
data_layout: "E-m:e-p:32:32-i32:32-i64:32-a:32-n8:16:32-S32".to_string(),
llvm_target: "tl45-unknown-unknown".to_string(),
target_endian: "big".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
target_os: "unknown".to_string(),
target_env: String::new(),
target_vendor: String::new(),
arch: "tl45".to_string(),
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),

options: TargetOptions {
linker: Some("ld.lld".to_string()),
cpu: String::new(),
max_atomic_width: Some(0),
atomic_cas: false, // incomplete +a extension
features: String::new(), // disable +c extension
executables: true,
panic_strategy: PanicStrategy::Abort,
relocation_model: "static".to_string(),
abi_blacklist: vec![
Abi::Cdecl,
Abi::Stdcall,
Abi::Fastcall,
Abi::Vectorcall,
Abi::Thiscall,
Abi::Aapcs,
Abi::Win64,
Abi::SysV64,
Abi::PtxKernel,
Abi::Msp430Interrupt,
Abi::X86Interrupt,
],
trap_unreachable: false,
emit_debug_gdb_scripts: false,
.. Default::default()
},
})
}
@@ -209,6 +209,12 @@ void LLVMRustAddLastExtensionPasses(
#define SUBTARGET_RISCV
#endif

#ifdef LLVM_COMPONENT_TL45
#define SUBTARGET_TL45 SUBTARGET(TL45)
#else
#define SUBTARGET_TL45
#endif

#ifdef LLVM_COMPONENT_SPARC
#define SUBTARGET_SPARC SUBTARGET(Sparc)
#else
@@ -232,6 +238,7 @@ void LLVMRustAddLastExtensionPasses(
SUBTARGET_SPARC \
SUBTARGET_HEXAGON \
SUBTARGET_RISCV \
SUBTARGET_TL45

#define SUBTARGET(x) \
namespace llvm { \
@@ -143,6 +143,7 @@ static TARGETS: &[&str] = &[
"x86_64-unknown-netbsd",
"x86_64-unknown-redox",
"x86_64-unknown-hermit",
"tl45-unknown-unknown",
];

static DOCS_TARGETS: &[&str] = &[

0 comments on commit 8004aab

Please sign in to comment.
You can’t perform that action at this time.