- Hi!

Alejandro Verdín a écrit :>

You can override the floating point operations by providing them either

> how can I override the standard floating point libraries (the elemental

> ones: sum, substraction, div & mul) with my own ones.

>

> Best regards, Alejandro.

>

explicitly (in .o files) or by providing them in a library that you pass

to gcc.

You have to be cautious on the following:

- use exactly the same name of symbols for the math operations as GCC

(something like __addsf3, __subsf3, __mulsf3, __divsf3, __adddf3,

__subdf3, __divdf3, ...)

- use exactly the same prototype for these functions.

- use the IEEE-754 format, or, also redefine all int <-> float conversions

(something like __fixsfsi, __fixdfsi, ...)

Take care that by default, we have

sizeof (float) = sizeof(long) = 4

sizeof (double) = sizeof(long long) = 8

and in that case, you also need the __xxxdf3 functions.

BUT, if you specify -fshort-double when compiling ALL your programs, GCC

treats the double as a float and you don't need to implement the __xxxdf3.

If the math functions you have implemented do not use exactly match

the GCC functions, I suggest to write some wrappers that do the translation.

Something like:

float __addsf3(float a, float b)

{

float r;

// translate a to your format

// translate b

my_op(a,b,&r);

// translate r to IEEE-754

return r;

}

If you have a better and smaller library to share with others, I think several

people could be interested. The libgcc math implementation is pretty big.

Stephane

-----------------------------------------------------------------------

Home Office

E-mail: stcarrez@... Stephane.Carrez@...

WWW: http://home.worldnet.fr/stcarrez http://www.sun.com

Mail: 17, rue Foucher Lepelletier 6, avenue Gustave Eiffel

92130 Issy Les Moulineaux 78182 Saint Quentin en Yvelines

France - Hello,

Is it possible for me to use your floating point librairies with GCC 2.95.2 ?

I would like to use __fixsfsi, floatsisf and __XXsf2 comparation functions.

Thanks and best regards

Toufiké HENNI-CHEBRA

Alejandro Verdín a écrit :

> Hi!

>

> I developed a special format floating point libraries, three years

> ago. As I was using no more than 10 bit precision sensors end was urgently

> needing these libraries, I crafted a 16 bit mantisa-8 bit exp floating

> point format ones. They are dirty, and not perfectly reliable, but they

> had been worked for me.

>

> Recently, I wrote wraps for __addsf3, __subsf3, __mulsf3,

> __divsf3, __fixsfsi, floatsisf and __XXsf2 comparation functions. They

> take 995 bytes en size. If somebody wants it, just e-mail.

>

> Best regards, Alejandro.

>

>

>

> To Post a message, send it to: gnu-m68hc11@...

>

> To Unsubscribe, send a blank message to: gnu-m68hc11-unsubscribe@...