🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #838

Re: vector length CSR?

#838
From: Thomas Koenig
Date: Fri, 20 Nov 2026 18:57
33 lines
2708 bytes
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.

>
> For unsigned integers: The associative law holds for modulo
> arithmetic, in particular unsigned addition and multiplication in C.
>
> For signed integers: The compiler can choose what it wants to do in
> case of overflow; e.g., it can choose modulo arithmetic, which is
> associative.

Or it can issue an overvlow trap, for example with -fsanitize=undefined.

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Technical Details
Message-ID: <11dq56a$3f094$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
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>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.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: Fri, 20 Nov 2026 18:57:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <11dq56a$3f094$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>
Injection-Date: Fri, 20 Nov 2026 18:57:15 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3637540"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19JxK4Vb4+XTRajOjp9hLk9nlKhLB6/mFg="; posting-host="cce1ce4f534eaa522f8d9a959d055012"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:hq4JU9EnfALWw0mNhth/EuAcUyY= sha256:rHO2dm6bVvkzJ+L3RHEwTv8v75w80klNo+Ruq+gqk+A=
	sha1:S2ZE4NEQnol+NaTkhPdC7dvMnZY= sha256:DCp39wE1KuyxrjR7nrKbrkN12PFPSjbGE4cIwPWGP6o=