Skip to content
/ gcc Public
forked from stffrdhrn/gcc

GCC port rewrite for OpenRISC

License

GPL-2.0 and 2 other licenses found

Licenses found

GPL-2.0
COPYING
LGPL-2.1
COPYING.LIB
Unknown
COPYING.RUNTIME
Notifications You must be signed in to change notification settings

mithro/gcc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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));
    }

About

GCC port rewrite for OpenRISC

Resources

License

GPL-2.0 and 2 other licenses found

Licenses found

GPL-2.0
COPYING
LGPL-2.1
COPYING.LIB
Unknown
COPYING.RUNTIME

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 47.6%
  • Ada 17.5%
  • C++ 14.8%
  • Go 7.5%
  • GCC Machine Description 4.7%
  • Fortran 2.4%
  • Other 5.5%