https://github.com/redstar/llvm-m88k Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Copilot + Packages + Security + Code review + Issues + Discussions + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Skills + GitHub Sponsors + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} redstar / llvm-m88k Public * Notifications * Fork 0 * Star 12 LLVM backend for m88k architecture 12 stars 0 forks Star Notifications * Code * Issues 19 * Pull requests 0 * Projects 1 * Wiki * Security * Insights More * Code * Issues * Pull requests * Projects * Wiki * Security * Insights redstar/llvm-m88k This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main-m88k Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 45 branches 219 tags Code Latest commit @redstar redstar [m88k] Add some functions to M88kISelLowering ... 6c49188 Jul 22, 2022 [m88k] Add some functions to M88kISelLowering These functions are used by CodeGenPrepare and/or IRTranslator and CombineHelper, so given a good answer may help. 6c49188 Git stats * 430,848 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github [github] format and refactor GitHub workflows Jun 11, 2022 bolt [cmake] Don't export LLVM_TOOLS_INSTALL_DIR anymore Jul 21, 2022 clang-tools-extra [clangd] Make forwarding parameter detection logic resilient Jul 22, 2022 clang [m88k] First try at divs/divu instruction. Jul 22, 2022 cmake [CMake] Make FindLibEdit.cmake more robust May 27, 2022 compiler-rt tsan: remove unnecessary brackets Jul 21, 2022 cross-project-tests Pretty printer test fixes Jul 12, 2022 flang [mlir][arith] cmpi: move constant to the right side Jul 22, 2022 libc [libc] Add a convenience class and function for integer to string con... Jul 21, 2022 libclc libclc: Add clspv64 target Jan 13, 2022 libcxx [libc++] Take advantage of -fexperimental-library in libc++ Jul 22, 2022 libcxxabi [libcxxabi][CMake] Set --unwindlib=none when using LLVM libunwind Jul 14, 2022 libunwind [libunwind][SystemZ] Use process_vm_readv to avoid potential segfaults Jul 18, 2022 lld [ELF] Simplify createObjectFile/createLazyFile. NFC Jul 22, 2022 lldb [lldb][ARM] Invert emulation test assert message Jul 22, 2022 llvm-libgcc [llvm-libgcc] initial commit Feb 16, 2022 llvm [m88k] Add some functions to M88kISelLowering Jul 22, 2022 mlir [MLIR,OpenMP] : Add Conversion pattern for Critical Op Jul 22, 2022 openmp [Libomptarget] Only export needed definitions in the BC library Jul 22, 2022 polly Use any_of (NFC) Jul 22, 2022 pstl [libc++] Use _LIBCPP_ASSERT by default for _PSTL_ASSERTions May 20, 2022 runtimes [runtimes] adds llvm-libgcc to the list of runtimes to be sorted Jun 30, 2022 third-party Ensure newlines at the end of files (NFC) Dec 26, 2021 utils [bazel] add headers now required after 17e4c21 Jul 21, 2022 .arcconfig Add modern arc config for default "onto" branch Feb 22, 2021 .arclint PR46997: don't run clang-format on clang's testcases. Aug 5, 2020 .clang-format Revert "Title: [RISCV] Add missing part of instruction vmsge {u}. VX ... Apr 14, 2021 .clang-tidy [clangd] Cleanup of readability-identifier-naming Feb 1, 2022 .git-blame-ignore-revs Add __config formatting to .git-blame-ignore-revs Jun 14, 2022 .gitignore [llvm] Ignore .rej files in .gitignore Apr 28, 2022 .mailmap .mailmap: remove stray space in comment Feb 24, 2022 CONTRIBUTING.md docs: update some bug tracker references (NFC) Jan 10, 2022 README.markdown Update README.markdown Jul 22, 2022 README.md Fix grammar and punctuation across several docs; NFC Apr 7, 2022 SECURITY.md [docs] Describe reporting security issues on the chromium tracker. May 19, 2021 View code [ ] The LLVM m88k backend implementation Building LLVM with the m88k backend Development Status Support General information about m88k Programming manuals Systems Toolchain README.markdown The LLVM m88k backend implementation This repository contains the current state of my m88k backend for LLVM. For general information about LLVM, please read README.md. The Motorola 88000 is a RISC architecture developed by Motorola in the late 1980s. See Wikipedia for a general overview. The code is based on the example from my book "Learn LLVM 12" (see O'Reilly, Packt or Amazon). It differs in the following ways: * Uses only GlobalISel. SelectionDAG support has been removed. * Minimal clang support. Makes it easy to crash the backend. * All machine instructions are implemented. * Assembler supports .requires81100 directive. * Updates/refactoring of AsmParser, register definition, calling convention, etc. * Removed all Itineries in favor of the new scheduling model. Building LLVM with the m88k backend The m88k backend is added as experimental backend to LLVM, named M88k. It's prefined in the CMake files, but if you want to compile other experimental targets, too, then you have to pass option -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="M88k" to CMake. Development The main development happens in branch main-m88k. The branch release/ 13.x-m88k contains an older state based on LLVM 13.x. The branch release/12.x-m88k contains the source from my book on top of LLVM 12.x. This repository mirrors the LLVM main and release/* branches. I keep my files on top of main, which means that I often rebase. Sorry! Status It is already possible to cross-compile small applications. For example, save the following C source on your development machine as hello.c: int printf(const char * __restrict, ...); int gcd_sub(int a, int b) { while (a != b) { if (a > b) a -= b; else b -= a; } return a; } int main(int argc, char *argv[]) { int gcd = gcd_sub(123, 99); printf("gcd(123, 99) = %d\n", gcd); return 0; } Compile the file with clang using clang -target m88k-openbsd -c hello.c and copy the resulting object file hello.o to your OpenBSD m88k system. On the m88k system, you can link the program and run it: gcc hello.o && ./a.out gcd(123, 99) = 3 Support If you like this work, then there are several ways you can support me: * You can contributes patches. * You can provide access to real hardware, e.g. as ssh login. * If you find some documentation (e.g. the ABI updates from 88open) I would be happy to receive a copy. * You can buy me a beer or a coffee. General information about m88k Programming manuals You can find the user manuals for the 88100 and 88110 CPUs, the 88200 MMU and the 88410 secondary cache controller at bitsavers: http:// www.bitsavers.org/components/motorola/88000/. The manual for the 88110 CPU and the 88410 cache controller are also available on GitHub: https://github.com/awesome-cpus/awesome-cpus-m88k. Some of the files can also be found on https://archive.org/. The ELF ABI is only available at https://archive.org/details/ bitsavers_attunixSysa0138776555SystemVRelease488000ABI1990_8011463. The book Programming the Motorola 88000 by Michael Tucker and Bruce Coorpender (ISBN-13: 978-0830635337, ISBN-10: 0830635335) is out of print. In the book Microprocessor Architectures, 2nd Edition by Steve Heath, you find a description of the M88000 architecture in chapter 3. Regarding the ABI, there were some changes made by the 88open consortium. I have not yet found that documents. If you have some of them then please contact me! Systems The OpenBSD/luna88k port is still active and provides the latest OS releases. On a Linux or FreeBSD machine, you can use GXemul to run OpenBSD/luna88k. You can find information about real hardware at m88k.com. Toolchain gcc 3.3.6 is last version with support for the m88k architecture. See the manual page at https://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/ M88K-Options.html#M88K-Options. You can download that version from ftp://ftp.nluug.nl/mirror/ languages/gcc/releases/gcc-3.3.6/gcc-3.3.6.tar.gz binutils 2.16 is last version with support for the m88k architecture. See the manual page at https://sourceware.org/binutils/docs-2.16/ About LLVM backend for m88k architecture Topics backend llvm m88k m88100 m88110 Resources Readme Stars 12 stars Watchers 3 watching Forks 0 forks Releases 219 tags Packages 0 No packages published Contributors 1,013 * @redstar * @nikic * @RKSimon * @MaskRay * @topperc * @fhahn * @preames * @llvmgnsyncbot * @rotateright * @jhuber6 * @klausler + 1,002 contributors Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.