From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114669,94472ba0fa186a8d X-Google-Attributes: gid114669,public X-Google-Thread: 1147fc,94472ba0fa186a8d X-Google-Attributes: gid1147fc,public X-Google-Thread: 103376,94472ba0fa186a8d X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: ADA on the super Date: 1998/04/20 Message-ID: #1/1 X-Deja-AN: 346155856 References: <6h7v0c$r68$1@bambi.zdv.Uni-Mainz.DE> <6ha2lu$5cb$1@nnrp1.dejanews.com> <6hfjmg$hvt@top.mitre.org> Distribution: inet X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 893122584 617 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.sys.super,comp.parallel.mpi,comp.lang.ada Date: 1998-04-20T00:00:00+00:00 List-Id: <> Actually, this is probably an over-generalization. Packed array stuff is notorious, since there are so many special cases, and a given compiler is likely to do some but not all special casing. GNAT does some packed array stuff really efficiently, and other stuff is pretty horrible. A good challenge is Mats Weber's x := x(1 .. 31) & x(0); to do a simple rotate. It would be impressive if a compiler generated a single rotate instruction for this -- well to be more accurate, it would be surprising if such an optimization came out of a general approach (it is always easy to add one more special case). Certainly GNAT comes *nowhere* near generating a single instruction for this particular case. If you are worrying about efficiency and using packed arrays other than in the simplest manner (setting and testing bits say), you should definitely have a look at what the compiler is doing. One thing that is quite useful in GNAT is the capability of looking at the generated code at the Ada source level (use the -gnatdg switch). This is quite informative in a case like this, and much less painful than looking at assembly language.