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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,e56fd2619c02e35a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!news.albasani.net!.POSTED!not-for-mail From: Mok-Kong Shen Newsgroups: comp.lang.ada Subject: Re: 64 bit codes Date: Tue, 27 Sep 2011 15:48:16 +0200 Organization: albasani.net Message-ID: References: <4e817fdb$0$7615$9b4e6d93@newsspool1.arcor-online.net> <213da3b7-f9d0-4a7d-b215-9992ee0f1a02@f6g2000vbm.googlegroups.com> <2a797a9e-f0e3-4fbe-8f40-b6787b4e2879@o11g2000yqc.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net 6LcYeIfgYgBVbBVVbg4HbgJx6zG/Tuy3Myjp9P3EtL/jYJzcBOJIB7aVMr19/Ard8pG/Yy+nPeQObCtFBP3ZvO9HseNl8Uo4M6/uUOOJffs4KKiBiFGjUad3JkoEKfrt NNTP-Posting-Date: Tue, 27 Sep 2011 13:48:17 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="G7glKhwdyx7/fqCy+W3VX8/ovoFDwTyiFxa7u2kYHWWoH0Fd7CSazYmfV3YLbeyzOGBPg87dl8zdRPxrQ8goRRyaN/4np0QefjEdYt203LiPYTGfBukaIav8tA47PS0k"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: Cancel-Lock: sha1:S8hZ4PnoO9+p+Sn1E8nzAY861N0= Xref: g2news2.google.com comp.lang.ada:22108 Date: 2011-09-27T15:48:16+02:00 List-Id: Am 27.09.2011 15:09, schrieb Ludovic Brenta: > Mok-Kong Shen wrote on comp.lang.ada: >> I have some computations that would be much more efficient, if done >> with 64-bit arithmetics ("natively") than with 32-bit arithmetics >> and I don't like to take the trouble/"risk" of having a 2nd OS on my >> PC (I don't think currently to possess even the proper knowledge to >> do that at all). > > I'm not sure what you mean exactly by "64-bit arithmetic". If you > require 64-bit addresses, then yes you need a 64-bit compiler. But if > you only need 64-bit floating point numbers, the 32-bit compiler can > provide them just fine. In fact, on Intel hardware, Long_Floats are > normally 80 bits wide IIRC. Similarly, I think Long_Long_Integer is > 64 bits wide even with a 32-bit compiler. On 32-bit gcc, arithmetic operations (+, *, etc.) on "unsigned long long int" certainly all work, but it's inefficient. Anyway the runtime, as I have observed in the past, is much higher than I would expect. For lack of knowledge I have not attempted to see the actual code generated, but I suppose that's done with the help of some low-level macros. (By definition, there aren't 64-bit arithmetic instructions on 32-bit hardware.) For on 64-bit hardware a native 64-bit arithmetic operation shouldn't last very much longer than a corresponding 32-bit opeartion, I would think. M. K. Shen