Deutsch English Français Italiano |
<vc8qor$2od9v$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feeds.phibee-telecom.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Terje Mathisen <terje.mathisen@tmsw.no> Newsgroups: comp.arch Subject: Re: Computer architects leaving Intel... Date: Mon, 16 Sep 2024 10:37:47 +0200 Organization: A noiseless patient Spider Lines: 55 Message-ID: <vc8qor$2od9v$1@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> <2024Sep14.152652@mips.complang.tuwien.ac.at> <d93c1dc0455692767c89ea9f7bd47ed1@www.novabbs.org> <vc4o0l$1kuqf$1@dont-email.me> <vc6vno$285g2$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Date: Mon, 16 Sep 2024 10:37:47 +0200 (CEST) Injection-Info: dont-email.me; posting-host="72cf2766236da00f6658f17f99cdc0aa"; logging-data="2897215"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/E1HkrglKhhecJp0J6u5F6Bcyl6cdaGkCJdu5UAcMNXg==" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.19 Cancel-Lock: sha1:oY5A6VdegEJnSNuTeCr/rh3znP4= In-Reply-To: <vc6vno$285g2$1@dont-email.me> Bytes: 3222 David Brown wrote: > On 14/09/2024 21:26, Thomas Koenig wrote: >> MitchAlsup1 <mitchalsup@aol.com> schrieb: >> >>> In many cases int is slower now than long -- which violates the notio= n >>> of int from K&R days. >> >> That's a designers's choice, I think.=C2=A0 It is possible to add 32-b= it >> instructions which should be as fast (or possibly faster) than >> 64-bit instructions, as AMD64 and ARM have shown. >> >=20 > For some kinds of instructions, that's true - for others, it's not so=20 > easy without either making rather complicated instructions or having=20 > assembly instructions with undefined behaviour (imagine the terror that= =20 > would bring to some people!). >=20 > A classic example would be for "y =3D p[x++];" in a loop.=C2=A0 For a 6= 4-bit=20 > type x, you would set up one register once with "p + x", and then have = a=20 > load with post-increment instruction in the loop.=C2=A0 You can also do= that=20 > with x as a 32-bit int, unless you are of the opinion that enough apple= s=20 > added to a pile should give a negative number of apples.=C2=A0 But with= a=20 > wrapping type for x - such as unsigned int in C or modulo types in Ada,= =20 > you have little choice but to hold "p" and "x" separately in registers,= =20 > add them for every load, and do the increment and modulo operation.=C2=A0= I=20 > really can't see this all being handled by a single instruction. This becomes much simpler in Rust where usize is the only legal index typ= e: Yeah, you have to actually write it as y =3D p[x]; x +=3D 1; instead of a single line, but this makes zero difference to the=20 compiler, right? Terje --=20 - <Terje.Mathisen at tmsw.no> "almost all programming can be viewed as an exercise in caching"