Article View: comp.arch
Article #856Re: vector length CSR?
From: Thomas Koenig
Date: Sat, 21 Nov 2026 14:01
Date: Sat, 21 Nov 2026 14:01
34 lines
2951 bytes
2951 bytes
David Brown <david.brown@hesbynett.no> schrieb: > On 20/11/2026 19:57, Thomas Koenig wrote: >> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb: >>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes: >>>> On 11/19/2026 10:00 AM, Thomas Koenig wrote: >>>>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb: >>>>>> On 11/11/2026 10:53 PM, Thomas Koenig wrote: >>>>>>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb: >>>>>>> s = 0; >>>>>>> for (long int i=0; i<n; i++) >>>>>>> s = s + a[i]; >>> ... >>>> So does that mean that no parallelization of the above loop is legal? >>>> Even if if wouldn't make any difference, e.g. the array entries are >>>> unsigned integers? >>> >>> For unsigned integers and signed integers in C, this loop can be >>> reassociated just fine. >> >> Not according to the C standard. > > Yes, according to the C standards. UB on signed integer overflow means > the language does not say anything about what happens on overflow - it > does not mean the compiler has to handle it specially. Yep, I was too short in what I wrote. Of course, the compiler can assign any meaning to undefined behavior that it choses. What I *did* mean to write is that a programmer cannot expect this loop to be reassociated. -- This USENET posting was made without artificial intelligence, artificial impertinence, artificial arrogance, artificial stupidity, artificial flavorings or artificial colorants.
Technical Details
Message-ID:
<11ds88c$46jd$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11cpqih$acf5$1@dont-email.me> <sgu0flpndaqltpdbft40fghmi7vk78q2hs@4ax.com> <11cq2v7$dh5b$1@dont-email.me> <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com> <11csull$1ef6e$1@dont-email.me> <2026Nov9.230104@mips.complang.tuwien.ac.at> <11cvcr4$28k7g$1@dont-email.me> <11d3npt$3mmho$1@dont-email.me> <11dn936$2ebc2$1@dont-email.me> <11dndfd$2fr9j$1@dont-email.me> <11dngb5$2he51$1@dont-email.me> <2026Nov19.203832@mips.complang.tuwien.ac.at> <11dq56a$3f094$1@dont-email.me> <11ds0io$12f8$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Thomas Koenig <tkoenig@netcologne.de> Newsgroups: comp.arch Subject: Re: vector length CSR? Date: Sat, 21 Nov 2026 14:01:48 -0000 (UTC) Organization: A noiseless patient Spider Lines: 34 Message-ID: <11ds88c$46jd$1@dont-email.me> References: <11cpqih$acf5$1@dont-email.me> <sgu0flpndaqltpdbft40fghmi7vk78q2hs@4ax.com> <11cq2v7$dh5b$1@dont-email.me> <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com> <11csull$1ef6e$1@dont-email.me> <2026Nov9.230104@mips.complang.tuwien.ac.at> <11cvcr4$28k7g$1@dont-email.me> <11d3npt$3mmho$1@dont-email.me> <11dn936$2ebc2$1@dont-email.me> <11dndfd$2fr9j$1@dont-email.me> <11dngb5$2he51$1@dont-email.me> <2026Nov19.203832@mips.complang.tuwien.ac.at> <11dq56a$3f094$1@dont-email.me> <11ds0io$12f8$1@dont-email.me> Injection-Date: Sat, 21 Nov 2026 14:01:48 +0000 (UTC) Injection-Info: dont-email.me; logging-data="137837"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WBFZ1gEE5pOUFnh+aC8rdDIk+CM11dV4="; posting-host="5e74d6d8398cbd6755052d4645bce983" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:zA3N6wOOh65Z4upGVaz2jGsGPRk= sha256:PVkAo+LhG6Ebqyt1LUKmFdtGecJgYomVojoYpHztwuk= sha1:VnNcMOZyjK5tHGWxL+MKb1qrONw= sha256:t2rEtxB3FHrUDresvSt9N1wCBsRmbwsYL+J/eBmjwgc=