Article View: comp.arch
Article #813Re: vector length CSR?
From: Thomas Koenig
Date: Thu, 19 Nov 2026 19:02
Date: Thu, 19 Nov 2026 19:02
43 lines
3311 bytes
3311 bytes
Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb: > 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: >>>> >>>>> It seems the >>>>> advantage of an SIMD approach is the large set of addressable registers >>>>> that can be used to keep data readily available for future use. >>>> >>>> Plus, you can do wide permutes, and it can also help with reduction. >>>> Having mask for reducing operations also helps (or a length field). >>>> >>>> There is one other thing that VVM does not do natively: Reductions >>>> on commutative operators. Consider the implementation of a simple >>>> SUM intrinsic of FORTRAN. If you write the assembly equivalent of >>>> >>>> s = 0; >>>> for (long int i=0; i<n; i++) >>>> s = s + a[i]; >>> >>> I am certainly not a numerical analyst, so correct me if I am wrong, but >>> if the code above is C, then the reduction is not commutative unless you >>> don't care about intermediate overflow or S is defined as unsigned, e.g. >>> suppose consecutive elements are Max-10, 20, -Max+50 (where Max is the >>> maximum value allowed, either integer or FP). >> >> That is how I understand it, too. But the language definition of C does >> not give the compiler permission to sum up things in a different order. > > 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? I think the "as if" rule would apply in this case, so it would be permitted. For integers, doubtful; for floating point, no. -- This USENET posting was made without artificial intelligence, artificial impertinence, artificial arrogance, artificial stupidity, artificial flavorings or artificial colorants.
Technical Details
Message-ID:
<11dnh4b$2hnkj$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.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>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.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: Thu, 19 Nov 2026 19:02:35 -0000 (UTC) Organization: A noiseless patient Spider Lines: 43 Message-ID: <11dnh4b$2hnkj$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> Injection-Date: Thu, 19 Nov 2026 19:02:36 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2678419"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RUzWF2SQ6+/V4q1+BODllxr8+hgo2FKs="; posting-host="0ad3151e3bbdab8598ee465797a16a02" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:0+oF/oK7j+JT2cGdA2uK1vrMumE= sha256:1puTkYuu6Ud6pLHaayTjN55hLGnPE2sopblP6K5Q/jg= sha1:MEaQNb1ipDkxSUIF1SEHQYphZOc= sha256:sISobtV+Mv1U7pMVStbmSwb0FYFRoqIsxENqwzs2G/Y=