[comp.sys.amiga] Lattice C questions.

bader+@andrew.cmu.edu (Miles Bader) (09/11/88)

What extra does the "professional" get you?

What is their upgrade policy?  since 5.0 (with debugger) is supposed
to follow relatively quickly, would I have to buy it for full price
if I bought 4.0 now?

Please respond via email; our net feed is VERRRRRY backed up.

Thanks, -Miles

sutherla@qtp.ufl.edu (Scott Sutherland) (07/16/90)

	I am about to delve into the world of Amiga C. (Most
of my C programming has been on a SUN 3/50)  I have read
many of the Amiga C books, but I am going to start simple
so that I can learn the intricacies of the Lattice C compiler.
I have version 5.05 installed on the Hard Disk of my A3000.
Now, the documentation for the 5.0 version says that the 
compiler can optimize for the 68030 chip AND can take into
account the 68882.  I want to run some test programs (one
of them given to me by a fellow grad student who uses it 
as his unofficial benchmark for computer system speeds) 
optimized for the 68030 and I want to test them both with
the 68882 AND without it (e.g. software emulation of math 
functions).  

	As a novice to the Lattice environment, could someone
please explain to me, with examples if possible, the major 
compiler flags involved in optimizing for the 68030, 68882, and
software floating point emulation?  I could ferret through
the manual for a while and figure it out, but my friend is
leaving Friday and he is very interested in seeing the results
of his unofficial benchmarks.  

Thanks,

Scott Sutherland
sutherla@qtp.ufl.edu

BTW, this unofficial benchmark is doing a 3x3 matrix multiply
20000 times and then checks to see what the number of calculations
per minute are.  Here is the code.  I'd appreciate it if someone 
would tell me if it will run UNALTERED on the A3000 AND what the
optimum compiling options would be.




Source:

* Program to get a "crude" estimate of the performance of a system.
* The rate is the number of 3x3 matrix multiplies done 20000 times
* divided by the elapsed time in seconds.
*
*
* 6/24/90
*
* rates for Idx loop of 20000:
*
*
*	Machine				rate		relative
*------------------------------------------------------------------
* 1 Leading Edge PC-XT 7.44 MHz		 185.19		 1.0 
*   with 8087.
* 2 Sun 3/280 ffpa			2857.14		15.4
* 3 Sun 3/50  68881 			1176.47		 6.4
* 4 Sun 3/280 SPARC		       10000.0		54.0
* 5 Packard-Bell 386SX w/out /387	 127.39		 0.69
*   16 MHz floating point emulation
*
*
*


#include <stdio.h>
#include <time.h>

double a[3][3], b[3][3], c[3][3];

void main()

{
 unsigned	Idx;
 int		i, j, k;
 long		time1, time2;
 double		rate;

	time (&time1);

	for (Idx=0; Idx<20000; Idx++) {
	   for (i=0; i<3; i++)
	      for (j=0; j<3; j++) {
		c[i][j] = 0;

		for (k=0; k<3; k++)
		   c[i][j] += a[i][k] * b[k][i];
	   {
	{

	time (&time2);

	rate = (20000)/((double)(time2 - time1));

	printf ("\n\n rate = %8.41f\n", rate);


}

sutherla@qtp.ufl.edu (Scott Sutherland) (07/16/90)

In article <1083@orange9.qtp.ufl.edu> sutherla@qtp.ufl.edu (Scott Sutherland) writes:
>
>
>BTW, this unofficial benchmark is doing a 3x3 matrix multiply
>20000 times and then checks to see what the number of calculations
>per minute are.  Here is the code.  I'd appreciate it if someone 
     ^^^^^^

OOPS!  That should read "second"!

S.S.

sutherla@qtp.ufl.edu

martin@cbmvax.commodore.com (Martin Hunt) (07/18/90)

In article <1083@orange9.qtp.ufl.edu> sutherla@qtp.ufl.edu (Scott Sutherland) writes:
>
>	I am about to delve into the world of Amiga C. (Most
>of my C programming has been on a SUN 3/50)  I have read
>many of the Amiga C books, but I am going to start simple
>so that I can learn the intricacies of the Lattice C compiler.
>I have version 5.05 installed on the Hard Disk of my A3000.
>Now, the documentation for the 5.0 version says that the 
>compiler can optimize for the 68030 chip AND can take into
>account the 68882.  I want to run some test programs (one
>of them given to me by a fellow grad student who uses it 
>as his unofficial benchmark for computer system speeds) 
>optimized for the 68030 and I want to test them both with
>the 68882 AND without it (e.g. software emulation of math 
>functions).  
>
>	As a novice to the Lattice environment, could someone
>please explain to me, with examples if possible, the major 
>compiler flags involved in optimizing for the 68030, 68882, and
>software floating point emulation?  I could ferret through
>the manual for a while and figure it out, but my friend is
>leaving Friday and he is very interested in seeing the results
>of his unofficial benchmarks.  
>
>Thanks,
>
>Scott Sutherland
>sutherla@qtp.ufl.edu
>
>BTW, this unofficial benchmark is doing a 3x3 matrix multiply
>20000 times and then checks to see what the number of calculations
>per minute are.  Here is the code.  I'd appreciate it if someone 
>would tell me if it will run UNALTERED on the A3000 AND what the
>optimum compiling options would be.
>
Except for a problem with a few '{'s that should be '}'s, the code
you posted runs as is on a 3000.
I linked in my own time() function that has higher resolution than
1 second.
>
>Source:
>
>* Program to get a "crude" estimate of the performance of a system.
>* The rate is the number of 3x3 matrix multiplies done 20000 times
>* divided by the elapsed time in seconds.
>*
>*
>* 6/24/90
>*
>* rates for Idx loop of 20000:
>*
>*
>*	Machine				rate		relative
>*------------------------------------------------------------------
>* 1 Leading Edge PC-XT 7.44 MHz		 185.19		 1.0 
>*   with 8087.
>* 2 Sun 3/280 ffpa			2857.14		15.4
>* 3 Sun 3/50  68881 			1176.47		 6.4
>* 4 Sun 3/280 SPARC		       10000.0		54.0
>* 5 Packard-Bell 386SX w/out /387	 127.39		 0.69
>*   16 MHz floating point emulation
>*
Amiga 3000/68882                        3740              20
Amiga 500                                146              .79

For the 3000, use lc -m3 -f8 -O -Lm program.c

It is rather interesting that an Amiga 500 runs this benchmark faster
than a 386SX.  


-- 
Martin Hunt                     martin@cbmvax.commodore.com
Commodore-Amiga Engineering     {uunet|pyramid|rutgers}!cbmvax!martin

coy@ssc-vax.UUCP (Stephen B Coy) (07/20/90)

In article <13270@cbmvax.commodore.com>, martin@cbmvax.commodore.com (Martin Hunt) writes:
> >* 5 Packard-Bell 386SX w/out /387	 127.39		 0.69
> >*   16 MHz floating point emulation
> Amiga 500                                146              .79
> 
> It is rather interesting that an Amiga 500 runs this benchmark faster
> than a 386SX.  

Since the benchmark is heavily floating point oriented I'd think
that the results would depend on the floating point library used.
Was the Amiga benchmark compiled for IEEE or FFP?  Microsoft C also
offers an alternate floating point library which gives better speed
at the cost of accuaracy.  Without this information the benchmarks
are just noise.

> Martin Hunt                     martin@cbmvax.commodore.com
> Commodore-Amiga Engineering     {uunet|pyramid|rutgers}!cbmvax!martin

Stephen Coy
uw-beaver!ssc-vax!coy

martin@cbmvax.commodore.com (Martin Hunt) (07/20/90)

In article <3448@ssc-vax.UUCP> coy@ssc-vax.UUCP (Stephen B Coy) writes:
>In article <13270@cbmvax.commodore.com>, martin@cbmvax.commodore.com (Martin Hunt) writes:
>> >* 5 Packard-Bell 386SX w/out /387	 127.39		 0.69
>> >*   16 MHz floating point emulation
>> Amiga 500                                146              .79
>> 
>> It is rather interesting that an Amiga 500 runs this benchmark faster
>> than a 386SX.  
>
>Since the benchmark is heavily floating point oriented I'd think
>that the results would depend on the floating point library used.
>Was the Amiga benchmark compiled for IEEE or FFP?  Microsoft C also
>offers an alternate floating point library which gives better speed
>at the cost of accuaracy.  Without this information the benchmarks
>are just noise.
>
Most benchmarks are just noise.  I should have put a :^) at the end of
my post.  This benchmark is very dependent on what compilers
and math libraries are used.

I used double precision IEEE libraries, of course.  FFP is too inaccurate
for scientific work.  In 2.0 we have a single precision IEEE library
that is as fast as FFP, but more accurate.

-- 
Martin Hunt                     martin@cbmvax.commodore.com
Commodore-Amiga Engineering     {uunet|pyramid|rutgers}!cbmvax!martin