This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiling libgcc not optimized

Good moorning,

I am trying to compile libgcc for arm-none-eabi target from scratch, since I need to compare Floating Point SW emulation on an ARM Cortex-M4 and Risc-V based processors. The problem is that by default GCC includes the optimized version of FP SW emulation functions which is ieee754-sf.S. 

Does anyone knows how to exclude ieee754-sf.S in the libgcc compilation process? In particular how to configure GCC?

Thanks,

Parents
  • Okay. Those steps replaced the optimized code with the unoptimized one, afaics within the libgcc.a built.

    Additionally, libgcc.a and gcc compiler redefine __addsf3 to __aeabi_fadd. Such redefinitions are applied to other functions too.

    For the sake of testing a single function __addsf3, these additional changes (on top of earlier ones) were made:

    gccsrc/gcc/config/arm/arm.c has:
    ...
    set_optab_libfunc (add_optab, SFmode, "__aeabi_fadd");
    ...

    Comment that line.

    gccsrc/libgcc/config/arm/sfp-machine.h has at the end of the file:
    #ifdef __ARM_EABI__
    ...
    #endif


    Change the #ifdef to #ifdef 0.

    I only tested that gcc -c emitted __addsf3, and that libgcc.a had addsf3.0 with __addsf3 function inside it.

Reply
  • Okay. Those steps replaced the optimized code with the unoptimized one, afaics within the libgcc.a built.

    Additionally, libgcc.a and gcc compiler redefine __addsf3 to __aeabi_fadd. Such redefinitions are applied to other functions too.

    For the sake of testing a single function __addsf3, these additional changes (on top of earlier ones) were made:

    gccsrc/gcc/config/arm/arm.c has:
    ...
    set_optab_libfunc (add_optab, SFmode, "__aeabi_fadd");
    ...

    Comment that line.

    gccsrc/libgcc/config/arm/sfp-machine.h has at the end of the file:
    #ifdef __ARM_EABI__
    ...
    #endif


    Change the #ifdef to #ifdef 0.

    I only tested that gcc -c emitted __addsf3, and that libgcc.a had addsf3.0 with __addsf3 function inside it.

Children
No data