Re: 32 bit float emulation on 16 bit machine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried many configurations, but here is the point I want to reach:

_____________ target.h ____________________________
#ifdef IN_LIBGCC2
#define UNITS_PER_WORD    4
#else
#define UNITS_PER_WORD    2
#endif

...

#define FLOAT_TYPE_SIZE   32
#define DOUBLE_TYPE_SIZE  64
#define LONG_DOUBLE_TYPE_SIZE 64
_________________________________________________


_____________ t-target ____________________________
# 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
  echo '#define CMPtype HItype' >> fp-bit.c
  echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
  echo '#define SMALL_MACHINE' >> fp-bit.c
  cat $(srcdir)/config/fp-bit.c >> fp-bit.c

dp-bit.c: $(srcdir)/config/fp-bit.c
  echo '#define CMPtype HItype' > dp-bit.c
  echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c
  echo '#define SMALL_MACHINE' >> dp-bit.c
  cat $(srcdir)/config/fp-bit.c >> dp-bit.c

# LIBGCC1

LIB1ASMSRC =  target/lib1asm.S
LIB1ASMFUNCS =  _exit \
    _mulqi3 \
    _mulhi3 \
    _mulsi3 \
    _muldi3 \
    _udivmodqi4 \
    _divmodqi4 \
    _udivmodhi4 \
    _divmodhi4 \
    _udivmodsi4 \
    _divmodsi4 \
    _udivmoddi4 \
    _divmoddi4


TARGET_LIBGCC2_CFLAGS = -O0 -Dinhibit_libc -fno-inline

LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib

STMP_FIXINC =
_________________________________________________

With this configuration I run
configure ; make ; make install and when I use target-gcc to compile a
program with floats I get :

$ make clean all
Cleaning up directory
target-gcc -w -g -c -o main.o main.c
target-gcc -w -g -c -o output.o output.c
target-gcc -o main.elf  main.o output.o  -T pgm_ram.x
/home/guest1/target/lib/gcc/target/4.3.3/libgcc.a(_addsub_sf.o): In
function `_fpadd_parts':
/home/guest1/gcc/new_build/target/libgcc/../.././gcc/fp-bit.c:671:
undefined reference to `__ucmpsi2'
/home/guest1/gcc/new_build/target/libgcc/../.././gcc/fp-bit.c:676:
undefined reference to `__ucmpsi2'
collect2: ld returned 1 exit status
make: *** [main.elf] Error 1

Thank you.

Regards,

Florent.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux