AVR floating point speed

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Can someone point me a web site or something...
for information of AVR floating point speed.
I guess that this depends also on the lib used.

I don't need exactly accurate info, but rough estimates
for basic float operations like:
-32 bit float mul & div at xxx MHz
-any additional info is a bonus..

I guess that any AVR-uC will perform alike when
clocked with same crystal...right?

    Pygmi



Re: AVR floating point speed

Quoted text here. Click to load it

You could try the documentation of the avr-libc. Unfortunately, the
savannah server is down right now, because it has been hacked. I
hope, it will be back sometime this weekend :-(

http://savannah.gnu.org/projects/avr-libc /

Quoted text here. Click to load it

Not exactly, the classic line (AT90Sxxxx) has no integer multiplier,
but the newer ATmega-series has. So there should be a huge difference
in multiplication speed between these.

/Jan-Hinnerk


Re: AVR floating point speed
OK, that's nice to know.
Server seems to be still down...but i'll check it later.
Thanks.

     Pygmi

Quoted text here. Click to load it



Re: AVR floating point speed
Quoted text here. Click to load it

I have a little test prof I run that times fp add, mult, div. I'm using
imagecraft iccavr... 14.7456MHz mega128 does about 60K fp ops per sec.


Re: AVR floating point speed
I have been wondering this issue and already asked once in this
group wo. clear answer. 60 Kflops is probably more that I need...

If you have the data available, I would VERY much like to know
the details for each of those separately. Even though you couldn't
provide that info, thanks anyway for the info you have already
shared with us.

   Pygmi

Quoted text here. Click to load it



Re: AVR floating point speed
Hi if you look on microchips site you can find the times for floating point
calcs. I know its not an avr but i doubt if there is much difference.

Re: AVR floating point speed
Quoted text here. Click to load it

Considering the paucity of registers on the PIC (1 eight bit) I
would be extremely surprised if the PIC could ever compete in
speed.  This is not a good machine for arithmetic.

--
Chuck F ( snipped-for-privacy@yahoo.com) ( snipped-for-privacy@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.
Re: AVR floating point speed
On Sun, 28 Dec 2003 15:52:01 GMT, the renowned CBFalconer

Quoted text here. Click to load it

I second this. I'd be surprised if a PIC was half as fast (cycle for
cycle) doing floating point math.

Best regards,
Spehro Pefhany
--
"it's the network..."                          "The Journey is the reward"
snipped-for-privacy@interlog.com             Info for manufacturers: http://www.trexon.com
We've slightly trimmed the long signature. Click to see the full one.
Re: AVR floating point speed
Hi, it's a starting point more than an end point. actual time is data dependent
so it's all approximate anyway. If the PIC times will suffice then he should
have no trouble with the AVR.

Re: AVR floating point speed
Quoted text here. Click to load it

//file fpbench.c
//test avr flops
//Mar 4 2003 Bob G ( snipped-for-privacy@aol.com) compile w iccavr 6.27
//Jan 22 04 Bob G compile with iccavr 6.30

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "math.h"
#include <iom128v.h>

#define INTR_OFF() asm("CLI")
#define INTR_ON()  asm("SEI")

extern void init_devices(void);
extern int _textmode;

//-----globals----------
long int n,i,j;
float x,y,z;
char buf1[1024],buf2[1024];

//----------------
void main(void){
//fpbench main program
char c;

  init_devices();
  _textmode=1;
  c=0;
  n10%0000;
  while(c != 'q'){
    printf("\nfpbench Jan 22 2004 snipped-for-privacy@aol.com\n");
    printf("\nbegin %ld overhead loops\n",n);
    for(i=0; i<n; i++){
      j=n-i;
      x=i;
      y=j;
      z=x;
    }
    printf("end (any char...)");
    c=getchar();
    
    printf("\nbegin %ld fp adds\n",n);
    for(i=0; i<n; i++){
      j=n-i;
      x=i;
      y=j;
      z=x+y;
    }
    printf("end (any char...)");
    c=getchar();
  
    printf("\nbegin %ld fp mults\n",n);
    for(i=0; i<n; i++){
      j=n-i;
      x=i;
      y=j;
      z=x*y;
    }
    printf("end (any char...)");
    c=getchar();

    printf("\nbegin %ld fp mults by 1\n",n);
    for(i=0; i<n; i++){
      j=n-i;
      x=i;
      y=j;
      z=x*1;
    }
    printf("end (any char...)");
    c=getchar();

    printf("\nbegin %ld fp mults by 0\n",n);
    for(i=0; i<n; i++){
      j=n-i;
      x=i;
      y=j;
      z=x*0;
    }
    printf("end (any char...)");
    c=getchar();

    printf("\nbegin %ld fp divs\n",n);
    for(i=0; i<n; i++){
      j=n-i;
      x=i;
      y=j;
      z=x/y;
    }
    printf("end (any char...)");
    c=getchar();

    n10%000;
    printf("\nbegin %ld sin\n",n);
    for(i=0; i<n; i++){
      j=n-i;
      x=i;
      y=j;
      z=sin(x);
    }
    printf("end (any char...)");
    c=getchar();

    printf("\nbegin %ld log\n",n);
    for(i=0; i<n; i++){
      j=n-i;
      x=i;
      y=j;
      z=log(x);
    }
    printf("end\n");
    c=getchar();

    printf("\nbegin %ld 1k block moves\n",n);
    for(i=0; i<n; i++){
      memcpy(buf2,buf1,sizeof(buf1)); //took 5 sec for 10 meg... about 2 megs/sec
    }
    printf("end\n");
    c=getchar();
  }
}
//--------eof------------


Site Timeline