Skip to content

Commit

Permalink
Adding the MicroBlaze backend.
Browse files Browse the repository at this point in the history
The MicroBlaze is a highly configurable 32-bit soft-microprocessor for
use on Xilinx FPGAs. For more information see:
http://www.xilinx.com/tools/microblaze.htm
http://en.wikipedia.org/wiki/MicroBlaze

The current LLVM MicroBlaze backend generates assembly which can be
compiled using the an appropriate binutils assembler.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96969 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Wesley Peck committed Feb 23, 2010
1 parent 2cce371 commit a70f28c
Show file tree
Hide file tree
Showing 56 changed files with 6,736 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CREDITS.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,8 @@ D: Bunches of stuff
N: Bob Wilson
E: [email protected]
D: Advanced SIMD (NEON) support in the ARM backend

N: Wesley Peck
E: [email protected]
W: http://wesleypeck.com/
D: MicroBlaze backend
6 changes: 5 additions & 1 deletion autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch],
msp430-*) llvm_cv_target_arch="MSP430" ;;
s390x-*) llvm_cv_target_arch="SystemZ" ;;
bfin-*) llvm_cv_target_arch="Blackfin" ;;
mblaze-*) llvm_cv_target_arch="MBlaze" ;;
*) llvm_cv_target_arch="Unknown" ;;
esac])

Expand Down Expand Up @@ -427,6 +428,7 @@ else
MSP430) AC_SUBST(TARGET_HAS_JIT,0) ;;
SystemZ) AC_SUBST(TARGET_HAS_JIT,0) ;;
Blackfin) AC_SUBST(TARGET_HAS_JIT,0) ;;
MBlaze) AC_SUBST(TARGET_HAS_JIT,0) ;;
*) AC_SUBST(TARGET_HAS_JIT,0) ;;
esac
fi
Expand Down Expand Up @@ -493,7 +495,7 @@ if test "$enableval" = host-only ; then
enableval=host
fi
case "$enableval" in
all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend" ;;
all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend MBlaze" ;;
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
case "$a_target" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
Expand All @@ -512,6 +514,7 @@ case "$enableval" in
cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;;
cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
host) case "$llvm_cv_target_arch" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
Expand All @@ -520,6 +523,7 @@ case "$enableval" in
Alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;;
ARM) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
Mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
MBlaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
CellSPU|SPU) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
PIC16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;;
XCore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
Expand Down
7 changes: 6 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,7 @@ else
msp430-*) llvm_cv_target_arch="MSP430" ;;
s390x-*) llvm_cv_target_arch="SystemZ" ;;
bfin-*) llvm_cv_target_arch="Blackfin" ;;
microblaze-*) llvm_cv_target_arch="MBlaze" ;;
*) llvm_cv_target_arch="Unknown" ;;
esac
fi
Expand Down Expand Up @@ -4794,6 +4795,8 @@ else
SystemZ) TARGET_HAS_JIT=0
;;
Blackfin) TARGET_HAS_JIT=0
;;
MBlaze) TARGET_HAS_JIT=0
;;
*) TARGET_HAS_JIT=0
;;
Expand Down Expand Up @@ -4898,7 +4901,7 @@ if test "$enableval" = host-only ; then
enableval=host
fi
case "$enableval" in
all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend" ;;
all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend MBlaze" ;;
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
case "$a_target" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
Expand All @@ -4917,6 +4920,7 @@ case "$enableval" in
cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;;
cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
host) case "$llvm_cv_target_arch" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
Expand All @@ -4925,6 +4929,7 @@ case "$enableval" in
Alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;;
ARM) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
Mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
MBlaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
CellSPU|SPU) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
PIC16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;;
XCore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
Expand Down
1 change: 1 addition & 0 deletions include/llvm/ADT/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class Triple {
x86, // X86: i[3-9]86
x86_64, // X86-64: amd64, x86_64
xcore, // XCore: xcore
mblaze, // MBlaze: mblaze

InvalidArch
};
Expand Down
9 changes: 9 additions & 0 deletions lib/Support/Triple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const char *Triple::getArchTypeName(ArchType Kind) {
case x86: return "i386";
case x86_64: return "x86_64";
case xcore: return "xcore";
case mblaze: return "mblaze";
}

return "<invalid>";
Expand All @@ -62,6 +63,8 @@ const char *Triple::getArchTypePrefix(ArchType Kind) {
case ppc64:
case ppc: return "ppc";

case mblaze: return "mblaze";

case sparcv9:
case sparc: return "sparc";

Expand Down Expand Up @@ -127,6 +130,8 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) {
return ppc64;
if (Name == "ppc")
return ppc;
if (Name == "mblaze")
return mblaze;
if (Name == "sparc")
return sparc;
if (Name == "sparcv9")
Expand Down Expand Up @@ -198,6 +203,8 @@ const char *Triple::getArchNameForAssembler() {
return "ppc";
if (Str == "powerpc64")
return "ppc64";
if (Str == "mblaze" || Str == "microblaze")
return "mblaze";
if (Str == "arm")
return "arm";
if (Str == "armv4t" || Str == "thumbv4t")
Expand Down Expand Up @@ -234,6 +241,8 @@ void Triple::Parse() const {
Arch = ppc;
else if ((ArchName == "powerpc64") || (ArchName == "ppu"))
Arch = ppc64;
else if (ArchName == "mblaze")
Arch = mblaze;
else if (ArchName == "arm" ||
ArchName.startswith("armv") ||
ArchName == "xscale")
Expand Down
9 changes: 9 additions & 0 deletions lib/Target/MBlaze/AsmPrinter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/..
)

add_llvm_library(LLVMMBlazeAsmPrinter
MBlazeAsmPrinter.cpp
)
add_dependencies(LLVMMBlazeAsmPrinter MBlazeCodeGenTable_gen)
Loading

0 comments on commit a70f28c

Please sign in to comment.