Source code for floating point arithmetic?

Asked by Matthew Mucker

I downloaded the source code package and extracted a few of the embedded archives. I'm looking for the source code for floating point arithmetic for the Cortex-M0 core, and I haven't been able to find it. I'm probably just looking in the wrong place. If someone could point me to the correct source code file for these functions, I'd be very grateful.

Thanks,

-Matthew

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Joey Ye (jinyun-ye) said :
#1

Floating point code is under gcc/libgcc
On Sep 30, 2012 10:01 PM, "Matthew Mucker" <
<email address hidden>> wrote:

> New question #209985 on GCC ARM Embedded:
> https://answers.launchpad.net/gcc-arm-embedded/+question/209985
>
> I downloaded the source code package and extracted a few of the embedded
> archives. I'm looking for the source code for floating point arithmetic for
> the Cortex-M0 core, and I haven't been able to find it. I'm probably just
> looking in the wrong place. If someone could point me to the correct source
> code file for these functions, I'd be very grateful.
>
> Thanks,
>
> -Matthew
>
> --
> You received this question notification because you are an answer
> contact for GCC ARM Embedded.
>

Revision history for this message
Matthew Mucker (78luphr0rnk2nuqimstywepozxn9kl19tqh0tx66b5dki1xxsh5mkz9gl21a5rlwfnr8jn6ln0m3jxne2k9x1ohg85w3jabxlrqbgszpjpwcmvkbcvq9spp6z3w5j1m33k06tlsfszeu-launchpad-a811i2i3ytqlsztthjth0svbccw8inm65tmkqp9sarr553jq53in4xm1m8wn3o4rlwaer06ogwvqwv9mrqoku2x334n7di44o65qze67n1wneepmidnuwnde1rqcbpgdf70gtqq2x9th) said :
#2

Joey, thank you for the reply. However, I'm still a bit confused. In gcc/libgcc, there are only three .c files:

-fixed-bit.c
-generic-morestack.c
-generic-morestack-thread.c

If I go into config/arm, there is a file bpabi-lib.h, which has a number of #defines that appear to be related to floating point math, but I still can't find the implementation of floating point arithmetic.

Revision history for this message
chengbin (can-finner) said :
#3

Hi Matthew,
I am not an expert in software floating point of GCC, but maybe can help a little here.
For our release, which is in GCC version 4.6, there are two version of implementations of software floating point:
1. the traditional implementation in files like gcc/config/fp-bit.c.
2. the soft-fp implementation which is extracted from GNU C library and used in GCC, it resides in directory gcc/config/soft-fp.
3. Additionally, ARM target implement its own software floating point arithmetic in assembly code, which resides in gcc/config/arm/leee754-{s,d}f.S something like that.

For GCC trunk, which is version 4.8, these files and directory has been relocated to directory libgcc/ in similar directory structure.

In Trunk:
For Thumb2 and ARM, I believe the 3rd is used for software-fp arithmetic.
For Thumb1, I think soft-fp is used.

Again, I am not familiar with software floating point in GCC and not sure about:
1. The 3rd implementation could be a supplement to the 1st/2nd.
2. Same story for 4.6 as in TRUNK.

You can build the toolchain and check the .dep files in libgcc/ to see which source file is used.

Or maybe someone with expertise in this field can answer this question better.

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Matthew Mucker for more information if necessary.

To post a message you must log in.