Jump to content
Sign in to follow this  
pushkar

Include Floats In Boostc And Boostc++

Recommended Posts

Hi,

 

Is it possible to integrate the float library in boostc and boostc++ ?

It's more simple to write :

 

float a;

float b;

float c;

 

a = a + (b * c)

 

even :

 

b = float32_mul(b,c);

a = float32_add(a,:);

 

Thank you.

Share this post


Link to post
Share on other sites

The floating point library is an extra available to download from the main site.

 

myself, i would think it funny to have a floating point library available by default

for devices that do not have an internal hardware floating point processor.

Floating point libraries typically add a huge amount of overhead since everything

has to be done in software.

Share this post


Link to post
Share on other sites

Yes, floating point library is very good but some compiler like CCS or HiTec have a 'native' float type and don't need a external library. That seems that you can write 'a = b + c'.

I think it would be great if boostc can do the same....no ?

Share this post


Link to post
Share on other sites

I agree. It would be great if it was built in and smart about it. If you use floating point math, you get a pile of crud. If you don't use it you don't get the crud. Just like if you use multiplies you get some multiply subroutines added to your code.

 

I don't follow the logic that if it is not supported in hardware the compile should not support it as 16-bit math is not performed in hardware (nor multiply or divide) but I don't hear compliants that these features should be removed.

Share this post


Link to post
Share on other sites

Yes, I understand your logic, if PIC don't have float hardware capabilities, compiler don't have too.

But 'float' is a data type and I have some problem to use it with the floating point library. I don't know if the problem is boostc or other but, for example, I can't use float with pointers. I have structures arrays with some floats in my program and boostc return an error.

Then, 'include floats in boostc' is just a sugestion. I like boostc and it's the better PIC compiler for me....

Thank you for your responses.

Share this post


Link to post
Share on other sites
I agree. It would be great if it was built in and smart about it. If you use floating point math, you get a pile of crud. If you don't use it you don't get the crud. Just like if you use multiplies you get some multiply subroutines added to your code.

 

I don't follow the logic that if it is not supported in hardware the compile should not support it as 16-bit math is not performed in hardware (nor multiply or divide) but I don't hear compliants that these features should be removed.

 

Was not aware they were even available ... or maybe i am just an integer math junky.

 

Your crud comment rather justifies the logic fairly well. If it were "native", then people

would tend not to think twice about the substantial amount of extra overhead that

is required to handle floating point numbers in software.

This then tends to cause a cascade of other problems, especially interrupt and

timing issues as people get lazy and use them for everything. (PC programming-itis)

 

But i suppose a warning when you compile if you use floats amounts to about the

same thing as requiring someone to download the library to use it.

 

/me shrugges

Share this post


Link to post
Share on other sites

pushkar,

Is it possible to integrate the float library in boostc and boostc++ ?

It's more simple to write :

 

float a;

float b;

float c;

 

a = a + (b * c)

 

even :

 

b = float32_mul(b,c);

a = float32_add(a,:);

Full native support will be added eventually, but it won't happen soon.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...