GCC port rewrite for OpenRISC
Switch branches/tags
or1k-9.0.0 or1k-9.0.0-20180730 or1k-9.0.0-20180722 or1k-9.0.0-20180715 or1k-9.0.0-20180613 or1k-9.0.0-20180608 or1k-9.0.0-20180604 or1k-9.0.0-20180523 gcc_5_3_0_release gcc_5_2_0_release gcc-7_3_0-release gcc-7_2_0-release gcc-7_1_0-release gcc-6_4_0-release gcc-6_3_0-release gcc-6_2_0-release gcc-6_1_0-release gcc-5_5_0-release gcc-5_4_0-release gcc-5_3_0-release gcc-5_2_0-release gcc-5_1_0-release gcc-4_9_4-release gcc-4_9_3-release gcc-4_9_2-release gcc-4_9_1-release gcc-4_9_0-release gcc-4_8_5-release gcc-4_8_4-release gcc-4_8_3-release gcc-4_8_2-release gcc-4_8_1-release gcc-4_8_0-release gcc-4_7_4-release gcc-4_7_3-release gcc-4_7_2-release gcc-4_7_1-release gcc-4_7_0-release gcc-4_6_4-release gcc-4_6_3-release gcc-4_6_2-release gcc-4_6_1-release gcc-4_6_0-release gcc-4_5_4-release gcc-4_5_3-release gcc-4_5_2-release gcc-4_5_1-release gcc-4_5_0-release gcc-4_4_7-release gcc-4_4_6-release gcc-4_4_5-release gcc-4_4_4-release gcc-4_4_3-release gcc-4_4_2-release gcc-4_4_1-release gcc-4_4_0-release gcc-4_3_6-release gcc-4_3_5-release gcc-4_3_4-release gcc-4_3_3-release gcc-4_3_2-release gcc-4_3_1-release gcc-4_3_0-release gcc-4_2_4-release gcc-4_2_3-release gcc-4_2_2-release gcc-4_2_1-release gcc-4_2_0-release gcc-4_1_2-release gcc-4_1_1-release gcc-4_1_0-release gcc-4_0_4-release gcc-4_0_3-release gcc-4_0_2-release gcc-4_0_1-release gcc-4_0_0-release gcc-3_4_6-release gcc-3_4_5-release gcc-3_4_4-release gcc-3_4_3-release gcc-3_4_2-release gcc-3_4_1-release gcc-3_4_0-release gcc-3_3_4-release gcc-3_3_3-release gcc-3_3_2-release gcc-3_2_3-release gcc-3_2_2-release gcc-3_2_1-release gcc-3_2-release gcc-3_1_1-release gcc-3_1-release gcc-3_0_4-release gcc-3_0_3-release gcc-3_0_2-release gcc-3_0_1-release gcc-3_0-release gcc-2_95_3-release gcc-2_95_2-release gcc-2_95_1-release
Nothing to show
Clone or download
Pull request Compare This branch is 108 commits ahead, 3186 commits behind gcc-mirror:master.
Cannot retrieve the latest commit at this time.
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
INSTALL 2014-10-12 Manuel López-Ibáñez <manu@gcc.gnu.org> Oct 12, 2014
config x86/CET: Add -fcf-protection to STAGE4_CFLAGS Apr 24, 2018
contrib test_summary: handle single quotes Mar 21, 2018
fixincludes PR jit/85384 Apr 18, 2018
gcc or1k: Fix exception handling for fallthrough case Jul 30, 2018
gnattools Update copyright years. Jan 3, 2018
gotools * Makefile.am (check-runtime): Pass -test.timeout Mar 21, 2018
include [IEPM] Introduce inline entry point markers Feb 9, 2018
intl
libada PR jit/85384 Apr 18, 2018
libatomic
libbacktrace Regenerate configure of target libraries Apr 24, 2018
libcc1 PR c++/69560 - wrong alignof(double) on x86. Apr 23, 2018
libcpp Regenerate .pot files. Apr 23, 2018
libdecnumber
libffi PR jit/85384 Apr 18, 2018
libgcc or1k: Add linux-unwind.h May 28, 2018
libgfortran
libgo
libgomp [nvptx, libgomp] Add GOMP_NVPTX_JIT=-O[0-4] in nvptx libgomp plugin Apr 26, 2018
libhsail-rt PR jit/85384 Apr 18, 2018
libiberty Fix gcc.dg/debug/pr41893-1.c with Solaris ld (PR lto/81968) Apr 13, 2018
libitm x86: Update __CET__ check Apr 24, 2018
libmpx
libobjc Regenerate configure of target libraries Apr 24, 2018
liboffloadmic PR jit/85384 Apr 18, 2018
libquadmath Regenerate configure of target libraries Apr 24, 2018
libsanitizer If someone has access to a 64-bit mips-linux system to test Apr 26, 2018
libssp Regenerate configure of target libraries Apr 24, 2018
libstdc++-v3 Regenerate configure of target libraries Apr 24, 2018
libvtv Regenerate configure of target libraries Apr 24, 2018
lto-plugin PR jit/85384 Apr 18, 2018
maintainer-scripts
zlib 2017-03-15 Yaakov Selkowitz <yselkowitz@redhat.com> Mar 15, 2017
.dir-locals.el * .dir-locals.el: Add. Oct 16, 2013
.gitattributes add basic .gitattributes files to notice whitespace issues Apr 23, 2016
.gitignore .gitignore: Ignore in-tree prerequisites. Sep 9, 2016
ABOUT-NLS
COPYING 2005-07-14 Kelley Cook <kcook@gcc.gnu.org> Jul 14, 2005
COPYING.LIB Update COPYING.LIB from upstream. Correct last Changelog. Jul 14, 2005
COPYING.RUNTIME
COPYING3 * COPYING_v3: New file. Contains version 3 of the GNU General Public … Jul 17, 2007
COPYING3.LIB * COPYING_v3: New file. Contains version 3 of the GNU General Public … Jul 17, 2007
ChangeLog 2018-04-26 Richard Biener <rguenther@suse.de> Apr 26, 2018
ChangeLog.jit Merger of dmalcolm/jit branch from git Nov 11, 2014
ChangeLog.tree-ssa
MAINTAINERS 2018-04-25 Catherine Moore <clm@codesourcery.com> Apr 25, 2018
Makefile.def Remove Cilk Plus support. Nov 28, 2017
Makefile.in 2018-04-26 Richard Biener <rguenther@suse.de> Apr 26, 2018
Makefile.tpl 2018-04-26 Richard Biener <rguenther@suse.de> Apr 26, 2018
README * README: Document use of ranges of years in copyright notices. Jul 16, 2012
README.md or1k: implement delay slot filling with nop May 3, 2018
compile Update from upstream Automake files. Nov 16, 2014
config-ml.in
config.guess * config.guess: Import latest version. Jan 3, 2018
config.rpath Remove freebsd1 from libtool.m4 macros and config.rpath. Feb 13, 2011
config.sub * config.guess: Import latest version. Jan 3, 2018
configure WebAssembly: Disable subdirectory configuration for unsupported LD Feb 13, 2018
configure.ac WebAssembly: Disable subdirectory configuration for unsupported LD Feb 13, 2018
depcomp Update from upstream Automake files. Nov 16, 2014
install-sh Update from upstream Automake files. Nov 16, 2014
libtool-ldflags PR sanitizer/56781 Apr 17, 2014
libtool.m4
ltgcc.m4 * libtool.m4: Update to libtool 2.2.6. Sep 26, 2008
ltmain.sh Ensure libgcc_s unwinder is always used on 64-bit Solaris 10+/x86 (PR… Feb 4, 2014
ltoptions.m4 Sync from git Libtool and regenerate. Dec 5, 2009
ltsugar.m4
ltversion.m4 Sync from git Libtool and regenerate. Dec 5, 2009
lt~obsolete.m4 Sync from git Libtool and regenerate. Dec 5, 2009
missing Update from upstream Automake files. Nov 16, 2014
mkdep
mkinstalldirs
move-if-change Update move-if-change from gnulib Nov 16, 2014
symlink-tree 2005-07-14 Kelley Cook <kcook@gcc.gnu.org> Jul 14, 2005
ylwrap

README.md

OpenRISC GCC port

this is the start of a new OpenRISC fsf clean port for gcc.

Todo

These items should be done to get to a point where very basic things compile. DONE - just means something is in place so we can move on not done and tested.

  • build infra + basic files - DONE
  • register definitions - DONE
  • calling conventions - DONE
  • memory layout
  • load/store - DONE
  • moves - DONE
  • jump - DONE
  • branches - DONE
  • tuning
    • ensure varargs are to spec
    • ensure we can return 64-bit values in r11 and r12 - DONE (OOTB)
    • proper support for returning small structs/vectors in regs
    • optional support for frame pointers
    • delay slot - DONE
    • optional support for delay slot
    • correct predicates and constraints - OK

building

Stage 1 build

mkdir build
cd build
../gcc/configure --target=or1k-elf --disable-shared --enable-languages=c --prefix=/home/shorne/work/gnu-toolchain/local
make -j5 all-gcc
make install-gcc

../local/bin/or1k-elf-gcc -S ../gcc/test2.c -fdump-rtl-all

bootstrap tests

Below are some really basic test programs we can compile before we move on to the testsuite to check things. I pulled these from the ggx toolchain porting tutorial.

Verify types

/* Just test some types */
    int myint;
    short myshort;
    double mydouble;

Verify call/return

    int foo(int, int);
    int main()
    {
       return foo (111, 222);
    }

Verify prolog/epilog


    int g;

    int add(int a, int b, int c, int d, int e, int f)
    {
      return a + b + c + d + e + f + g;
    }

    int main()
    {
      g = 7;
      return (add (1, 2, 3, 4, 5, 6));
    }