This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: porting gcc can't compile libgcc2.c

----Original Message----
>From: Eric Fisher
>Sent: 01 September 2005 09:43

> Hello,
> Here is a question about porting gcc.  After I modified and
> other backend files, I can make cc1 and xgcc now. But libgcc2.o still
> failed. I'd like to know does we must make libgcc2.o since the target
> machine don't have float registers and 64bit registers.
> Thanks a lot.
> Eric

  If it doesn't have float registers, get libgcc2 to use fp emulation:

File:,  Node: Target Fragment,  Next: Host Fragment,  Up:

Target Makefile Fragments

   Target makefile fragments can set these Makefile variables.
`Floating Point Emulation'
     To have GCC include software floating point libraries in `libgcc.a'
     define `FPBIT' and `DPBIT' along with a few rules as follows:
          # We want fine grained libraries, so use the new code
          # to build the floating point emulation libraries.
          FPBIT = fp-bit.c
          DPBIT = dp-bit.c

          fp-bit.c: $(srcdir)/config/fp-bit.c
                  echo '#define FLOAT' > fp-bit.c
                  cat $(srcdir)/config/fp-bit.c >> fp-bit.c

          dp-bit.c: $(srcdir)/config/fp-bit.c
                  cat $(srcdir)/config/fp-bit.c > dp-bit.c

     You may need to provide additional #defines at the beginning of
     `fp-bit.c' and `dp-bit.c' to control target endianness and other

  As for the 64-bit registers, just don't tell it you have any:

File:,  Node: Values in Registers,  Next: Leaf Functions,  Prev:
location Order,  Up: Registers

How Values Fit in Registers

   This section discusses the macros that describe which kinds of values
(specifically, which machine modes) each register can hold, and how many
consecutive registers are needed for a given mode.

     A C expression for the number of consecutive hard registers,
     starting at register number REGNO, required to hold a value of mode

     On a machine where all registers are exactly one word, a suitable
     definition of this macro is

          #define HARD_REGNO_NREGS(REGNO, MODE)            \
             ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
              / UNITS_PER_WORD)

     A C expression that is nonzero if it is permissible to store a
     value of mode MODE in hard register number REGNO (or in several
     registers starting with that one).  For a machine where all
     registers are equivalent, a suitable definition is

          #define HARD_REGNO_MODE_OK(REGNO, MODE) 1

  With those macros you can tell it to store floats and 64-bit ints in two
(or more) consecutive hard registers.

Can't think of a witty .sigline today....

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]