Deutsch English Français Italiano |
<vc8mhi$2n382$3@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feeds.phibee-telecom.net!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Thomas Koenig <tkoenig@netcologne.de> Newsgroups: comp.arch Subject: Re: Computer architects leaving Intel... Date: Mon, 16 Sep 2024 07:25:38 -0000 (UTC) Organization: A noiseless patient Spider Lines: 56 Message-ID: <vc8mhi$2n382$3@dont-email.me> References: <2024Aug30.161204@mips.complang.tuwien.ac.at> <vbcob9$dvp4$1@dont-email.me> <vbd6ia$e0ld$2@dont-email.me> <UxpCO.174965$Hld5.7714@fx15.iad> <vc41rl$1fhjd$1@dont-email.me> <86jzfccri4.fsf@linuxsc.com> Injection-Date: Mon, 16 Sep 2024 09:25:39 +0200 (CEST) Injection-Info: dont-email.me; posting-host="791bf6c76acc5f7d6a0b52e0480cb113"; logging-data="2854146"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/65kNYC+B7l47W87qIwVg0Dk0tXXYCU+0=" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:vNETa0ElU9O0Yhoq2N5innBpE5E= Bytes: 2909 Tim Rentsch <tr.17687@z991.linuxsc.com> schrieb: > If the loop variable > represents degrees C or F, or some other naturally signed measure it > should be signed (or maybe floating point). The first one is a bad idea because temperature is a continuous physical quantity. The second has bad implications for constructs like DO R = 0.0, 1.0, 0.1 where it will depend on details floating point arithmetic if the number of loop trips is 10 or 11. You can argue that people can write DO R=0.0, 1.05, 0.1 but this construct was error-prone enough that it was deleted from the Fortran standards. > What kind of loop it > is, whether ascending or descending, or what the increment is, etc, > is secondary; a more important factor is what sort of value is > being represented, and in almost all cases that is what should > determine the type used. Not for floating point numbers. For that, you should simply do DO I=0,10 R = I * 0.1 or R = 0.0 DO I=0,10 .... R = R + 0.1 END DO whichever rounding error you prefer. >> Bringing it back to "architecture" Like Anton Ertl has said, LP64 for >> C/C++ is a mistake. It should always have been ILP64, and this nonsense >> would go away. Any new architecture should make C ILP64 (looking at you >> RISC-V, missing yet another opportunity to not make the same mistakes as >> everyone else). > > I believe this view is shortsighted. The big mistake is developers > hardcoding types everywhere - especially int, but also long, and > their unsigned variants. It's almost never a good idea to hardcode > a specific width (eg, uint32_t) in a type name used for parameters > or local variables, but that is by far a very common practice. Hence Fortran's SELECTED_REAL_KIND and SELECTED_INT_KIND...