Author Topic: RC5 - VFP compile option  (Read 2228 times)

Wood

  • Newbie
  • *
  • Posts: 10
    • View Profile
RC5 - VFP compile option
« on: October 09, 2004, 08:08:13 am »
What compile option(s) must be added to make sure vector floating point library is used? I've tried using the options "-mcpu=xscale -Wa,-mfpu=softvfp", but this did not result in a performance boost.
_________________
Sharp SL-C760 zUbuntu 1.0 RC1

djtreble

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://
RC5 - VFP compile option
« Reply #1 on: October 09, 2004, 01:25:12 pm »
interestingly

float test(float a, float b)
{
   return(a*b);
}

compiles to (gcc -O3 -S float.c -o float.s)

str lr, [sp,#-4]!
bl __mulsf3
ldr pc, [sp], #4

which calls another function to do the multiply. I thought it might inline the body of the multiply, but I guess that would really bloat the code.
« Last Edit: October 09, 2004, 01:28:14 pm by djtreble »

sashz

  • Sr. Member
  • ****
  • Posts: 388
    • View Profile
    • http://
RC5 - VFP compile option
« Reply #2 on: October 09, 2004, 02:22:50 pm »
on default, gcc/g++ generate code for xscale with softvfp calls. soft VFP unit compiled inside libgcc*.so. For speed optimization i use next flags -Os -fomit-frame-pointer
inline softvfp code must be faster with bigger code size, but gcc cannot generate this. Anyway that faster than kernel FPA emulator %)
« Last Edit: October 09, 2004, 02:26:12 pm by sashz »

djtreble

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://
RC5 - VFP compile option
« Reply #3 on: October 10, 2004, 09:21:54 am »
Now I understand how floating point emulation was done before

http://www.heyrick.co.uk/assembler/coprocmnd.html

An undefined instruction trap for a coprosessor instruction is caught by the kernel and handled there.

SLOW!

Still haven't worked out whether lib gcc has Nicolas Pitre's hand coded floating point emulation though, that is meant to be even faster. Tryed some objdumb -d action, but libgcc doesn't have any symbols.