[Ecls-list] ECL behavior on some array related code

Matthew Mondor mm_lists at pulsar-zone.net
Wed May 19 15:56:42 UTC 2010


On Wed, 19 May 2010 15:31:41 +0200

Very impressive!  Perhaps a small note:

Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> wrote:

> [...]
> Sixth, DOTIMES now declares the type of the variable if the number of times
> is known in advance.

> [...]
>           (dotimes (n 50)
>         (dotimes (i 90)
>           (dotimes (j 90)
>             (dotimes (k 90)
> [...]

[...]
> /*  MAKE-PURE-ARRAY */;
>     {int8_t V2;                               /*  N               */
>     V2= ((int8_t)0);
>     goto L5;
> L4:;
>     {int8_t V3;                               /*  I               */
>     V3= ((int8_t)0);
>     goto L11;
> L10:;
>     {int8_t V4;                               /*  J               */
>     V4= ((int8_t)0);
>     goto L17;
> L16:;
>     {int8_t V5;                               /*  K               */
>     V5= ((int8_t)0);
>     goto L23;
> L22:;
>     {cl_fixnum V6;
>     {cl_fixnum V7;
>     cl_fixnum V8;
>     cl_fixnum V9;
>     V7= ((cl_fixnum)V3);
>     V8= V7;
>     V9= 0;
>     V9= (V1)->array.dims[0];
>     V8= (V8)*(V9);
>     V9= (V1)->array.dims[1];
>     V7= ((cl_fixnum)V4);
>     V8= (V8)+(V7);
>     V8= (V8)*(V9);
>     V9= (V1)->array.dims[2];
>     V7= ((cl_fixnum)V5);
>     V8= (V8)+(V7);
>     V6= V8;
>     }
>     (V1)->array.self.sf[V6]=    8.5    ;}
>     V5= ((int8_t)(((cl_fixnum)V5))+1);
[...]

I noticed that the smallest possible C signed int type, (uint8_t) was
selected for such low values, however on x86 (and possibly other 32+
bit processors, except that I know m68k is an exception), operations on
an int are generally faster than on an 8-bit or 16-bit type which
internally requires implicit shift/and.  However I'm not sure how much
this really matters if those variables are transitional (i.e. soon
converted into an int afterwards)...

Thanks,
-- 
Matt




More information about the ecl-devel mailing list