AVR Xmega 64 bits floatting point support

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I am currently using the ATmel Studio 6.2 IDE on a project. I am running into some issue where the 32 bits floatting point does not give me enough accuracy. Anybody has recommendation into either a 64 bits floatting point that is available for the Xmega256D3 or

some other IDE available that support it?

Thanks,

 

Charles

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe something from this link can be usefull:

https://www.avrfreaks.net/forum/d...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IAR EWAVR has 64bit floating point;

Alternatively, AVR GCC has 64bit fixed point.

ftp://ftp.iar.se/WWWfiles/AVR/webic/doc/EWAVR_CompilerReference.pdf (5.3MB, "Basic data types—floating-point types", page 271)

http://gcc.gnu.org/wiki/avr-gcc#Fixed-Point_Support

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

64 bit floating point on an 8 bit AVR - not going to be very fast!

 

the usual solution for more accuracy is not brute force 64 bit doubles, but rather, re-think the algorithm.

 

Last Edited: Tue. Feb 3, 2015 - 08:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Imagecraft C also has support for 64bit doubles (in the "pro" version.)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am running into some issue where the 32 bits floatting point does not give me enough accuracy

I'm guessing that you are either:

 

(a) writing a scientific calculator

 

(b) doing GPS calculations accurate enough to target a housefly buzzing on the surface of the moon

 

Another solution might be IBM's decimal library. This has since passed into the public domain and is, I believe a component of GCC on some architectures. Not sure if it's available for avr-gcc or what the plans are to add it there though.

 

Having said that I seem to remember that when asked SprinterSB said that avr-gcc could be configured and built to have 64bit FP simply as a parameter to the configuration. But as this is not turned on by default there must presumably be some reason why (performance perhaps?).

 

As with others here I think there probably has to be a "better way" to achieve what it is you are attempting like fixed point or scaled integers or whatever.

 

Remember that any form of 64bit variable on an AVR is going to end up occupying 8 registers for each component of the calculation. While the 32 register AVR probably has enough it's likely to involve a loft of "shuffling about" by the compiler to get the values into the right place at the right time. This is likely as true for uint64_t as it is for 64 bit double.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you all the inputs. It is appreciated

 

Charles

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How hooked to C or ASM are you?

 

Bascom has a 64 bit data type.

 

JC