[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cpuuse, rtmonuse and gcc (was: erc32 wrong compilation flagsfor initial task with fpu?)
- Date: Fri, 28 Mar 2008 09:07:52 -0500
- From: george.a.kitchen at nasa.gov (Kitchen, George A. (JSC-ES5)[ESCG])
- Subject: cpuuse, rtmonuse and gcc (was: erc32 wrong compilation flagsfor initial task with fpu?)
Perhaps I misunderstand this email, so I will ask. Are you saying that one cannot use the FPU under the latest version of RTEMS with a Sparc?
From: rtems-users-bounces at rtems.org on behalf of Joel Sherrill
Sent: Fri 3/28/2008 8:58 AM
To: Jiri Gaisler
Cc: rtems-users at rtems.org
Subject: Re: cpuuse, rtmonuse and gcc (was: erc32 wrong compilation flagsfor initial task with fpu?)
Jiri Gaisler wrote:
> This is pretty bad. If the kernel uses floats, then compilation
> with -msoft-float will not work if the application later is linked
> without -msoft-float. Are the CPU_usage_Dump() and Period_usage_Dump()
> new functions or have they always been around?
I think our emails crossed. Older versions had floating
point math if the FPU defined was set to TRUE.
Newer versions have been rewritten to completely
use integer math.
So the question for Aleix is what version of RTEMS
do you have? If it is the older FP using version,
can you backport the integer version of the functions
and post a patch.
> Are there other
> functions in the kernel that uses floats as well?
There are not supposed to be. But gcc has surprised
us in the past by generating FP using code when you
least expected it.
So AFAIK "float/double" C types should not be found
anywhere in the code except to declare the FP context
> Aleix Conchillo Flaqu? wrote:
>> Hi again,
>> I forced the SPARC_HAS_FPU to 1, so CPU_HARDWARE_FP is set to TRUE.
>> Now (compiling RTEMS with -msoft-float), the CPU_usage_Dump and
>> Period_usage_Dump print 0.000 for percentage values.
>> I have disassembled the code and I have seen that the compiler forces
>> those functions (by chance, only these two) to use __floatsidf and
>> __divdf3 functions, which I think are for software floating point
>> emulation. This is fine, the problem is that they use floating point
>> registers internally.
>> So, even RTEMS is compiled with -msoft-float, gcc floating point
>> software emulation function use floating point registers, which is
>> kind of scary.
>> Luckily, my task had the RTEMS_FLOATING_POINT attribute set, so I
>> could see the statistics. Removing the attribute, which I think it
>> should, crashed the application because of the gcc problem cited
>> The problems I am facing now are:
>> - gcc uses floating point registers for some floating point software
>> emulation routines.
>> - cpu_usage_dump and period_usage_dump do not print correct percentage
>> values. I am not sure if this is caused by the point above.
>> Does this makes any sense at all?
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
rtems-users mailing list
rtems-users at rtems.com
-------------- next part --------------
An HTML attachment was scrubbed...