Does Studio directly support fractional/fmul?

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

Hi,

 

I will be diving down the rabbit hole of DSP on an MEGA644A. I see it has fractional multiplication capabilities, but can I use them in C?  Or do I have to do it in assembly?  Are there any examples of how to do this?

 

Thanks!

Tim Ressel
Portland, OR
timr@earthling.net

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

I forget when it was added exactly but sometime from about avr-gcc 4.8 onwards it gained fixed point:

 

https://gcc.gnu.org/wiki/avr-gcc...

 

So if you have 4.8, 4.9 or 5.0 then you should find this supported and "under the hood" I think you are going to find it is implemented using FMUL.

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

I should add that I am using Studio 6 for coding. It would be nice if the compiler supported fixed point variables and operations.

 

--tr

 

Tim Ressel
Portland, OR
timr@earthling.net

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

According to Cliff, it does support fixed point.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

Yup, as Jim says I just told you thta 4.8 onwards has fixed point support. Studio 6.2 has GCC 4.8.1 so you have it.

 

See:

 

https://gcc.gnu.org/onlinedocs/g...

 

You may want to inspect the asm that generates to verify that FMUL etc are in use.