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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bf14abf90022db2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-01 05:18:53 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: ian0kerr@my-deja.com (Ian) Newsgroups: comp.lang.ada Subject: Re: Little function generates lots of object code. Date: 1 Oct 2001 05:18:52 -0700 Organization: http://groups.google.com/ Message-ID: <11bf7180.0110010418.46fb6a7c@posting.google.com> References: <14df6e36.0109291652.73e61d20@posting.google.com> NNTP-Posting-Host: 141.245.40.230 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1001938733 25211 127.0.0.1 (1 Oct 2001 12:18:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 1 Oct 2001 12:18:53 GMT Xref: archiver1.google.com comp.lang.ada:13568 Date: 2001-10-01T12:18:53+00:00 List-Id: Mike_Harrison80@yahoo.com (Mike Harrison) wrote in message news:<14df6e36.0109291652.73e61d20@posting.google.com>... > Hello group, > > I am using AdaMulti 3.1 with a Sun target (optimized for size). > The following little function seems to be generating a lot more object > code than it deserves. > Is this what other people would expect? > Is there something that I could do to reduce this? > > .Mike. > > ---------------------------------------------------------- > function "-" (Right : in Matrix) return Matrix is > Result : Matrix (Right'range(1), Right'range(2)); > begin > for Row in Right'range(1) loop > for Column in Right'range(2) loop > Result(Row,Column) := -Right(Row,Column); > end loop; > end loop; > return Result; > end "-"; > ---------------------------------------------------------- > > > 0x5c230: .byte 00,00,00,01 > function "-" (Right : in Matrix) return Matrix is . . . . . > 0x5c3a0 M+0x16c: 0xb0100008 mov %o0,%i0=implicit_dope_for_result > 0x5c3a4 M+0x170: 0x81c7e008 ret > 0x5c3a8 M+0x174: 0x91ea0000 restore %o0,%g0,%o0 > end "-"; Mike, If I can count correctly you have 6 semi-colons and 10 SLOCS with 376 Bytes of object code. This gives 62.7 B per ; and 37.6 B per SLOC. Out current project with a very much larger code base, using Rational Apex 3.0.1 generating for a PPC604 target is loaded into FLASH and then copied to RAM after which it is elaborated. We get 66.5 B per ; in FLASH (this is maybe object code with the libraries swamped out due to the large image size). When copied into RAM and elaborated it grows to 133 B per ; Looks like Greenhills MultiAda is about typical. If you want to estimate the RAM needed, this expansion should be taken into account. I was wondering if the increase is all explained by the heap. We probably use a lot of this. Has anyone got the correct answer to this? Ian.