From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,702f67ce4b6ecb02,start X-Google-Attributes: gid1164f8,public From: ici@qua.crl.melco.co.jp (Toshinao Ishii) Subject: int v.s. long Date: 1996/03/25 Message-ID: #1/1 X-Deja-AN: 144168100 distribution: comp sender: @loamer1.adm.crl.melco.co.jp x-forwarded: by - (DeleGate/3.0.1) organization: Mitsubishi Electric Corp. Hyogo, Japan newsgroups: comp.sys.dec Hi. I've tried some simple benchmark about int and long on dUNIX 3.2C. The source was just like what is attached in the last. It was just a simple matrix multiplication of 'int' or 'long'. I want to know whether calculation of 'long' is faster than that of 'int' on Alpha which has 64bit architecture. (Of course, long is 8byte and int is 4byte.) According to my result on our Alpha Server 2100, calculation with 'int' was about 10% faster than the calculation with 'long'. My question is how this result should be evaluated. Well, ideally, it is very happy if the calculation with 'long' is faster than that with 'int'. However, in the long calculation, about twice of data have to come and go between memory and registers. My guess is that if the machine as well as cpu is well designed, the data transfer is parallelized so that the machine can handle 8byte data as fast as or faster than 4byte data. Since I am not a computer architect, I cannot well explain the bechmark result. I want to hear comments of the experts. Thanks you in advance. -=-=-=-=-=-=-=-=-=-=-=-= Toshinao Ishii Advanced Technology R&D Center Mitsubishi Electric Corporation email: ici@qua.crl.melco.co.jp (NeXTMAIL/MIME welcome) #include #define TYPE long /* or int */ #define N 500 main(){ int i,j,k; TYPE x; TYPE a[N][N], b[N][N],c[N][N]; /* some initialization of a[][] and b[][] */ ... for(i=0; i