🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #895

Re: CISC are not "unreduced"

#895
From: BGB
Date: Sun, 22 Nov 2026 21:26
107 lines
5800 bytes
On 11/15/2026 1:49 PM, Thomas Koenig wrote:
> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>> Thomas Koenig <tkoenig@netcologne.de> writes:
>>> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>>>> Michael S <already5chosen@yahoo.com> writes:
>>>>> How would you do it for non-associative arithmetic opcodes like
>>>>> floating-point?
>>>>
>>>> IIRC Mitch Alsup's answer to FP reduction is an accumulator with about
>>>> 2100 bits or so.
>> ...
>>>> It's not clear to me how one can accumulate 16 DP FP
>>>> values per cycle, like Zen5 can do.
>>>
>>> Lots of pipelining and lots of full adders would be my guess.
>>
>> One way to do it would be to add up the 16 operands using pairwise
>> addition, and then finally add the result to the accumulator.  That
>> approach would cost a lot of transistors, however.
> 
> That would be quite inefficient.  Far better to use full adders to
> do 3:2 compressions (for example); six layers would compress 19
> inputs down to 2, and that could be doable in a cycle or two
> Afterwards, it is "only" an addition of two numbers with around
> 2100 bits (I forget the exact number).
> 
> But I suspect a lot of optimization can go into that sort of thing.
> 

My thought here:
16x could be broken up into a lot of parallel 4-bit adders, each 
producing effectively an 8-bit result.

Build one value from the low 4 bits of each result, and another from the 
high bits;
Add them together, with full carry propagation.

This means the final main carry chain need only look like a simpler 
2-input add.

Or, 3 input, if 16x against a running accumulator.


Cost and latency would still be very high though.

Though as can be noted, the latency of a carry-select adder seems to 
scale with the log2 of the final width (rather than linearly), albeit 
with a higher initial constant cost.


But, even then, for ~ 2 ^ 11.05, an 11.05 cost scale still pretty steep 
in latency terms. Probably going to need 3 or 4 clock cycles for this 
part...

Could maybe be more reasonable to use 512 bits or so and accept the 
possibility of "imperfect" results (say, if some of the values are too 
small relative to the others and fall off the bottom).

Most cases, wont matter, unless the sum is approximately 0.


In the near zero situation, either one would still not match the results 
exactly with a sequential FADD sequence. Each sequential FADD would 
perform its own rounding step (and adding a large and small value would 
result in the small value dropping out immediately), and a large N-way 
adder would not.

So, a large N-way adder in this scenario would be burdened with being 
too accurate.

In this case though, likely the results between the two strategies would 
be "closer" if using RTZ rather than RNE or similar. However, 
variability would still exist in terms of the carry propagation from low 
order results, which would invariably differ depending on which order 
the values are added together.

It is kind of like the "curse" of single-rounded FMA:
While one can argue it is more accurate... Its results are not an exact 
match for double-rounded FMA.


So, for a compiler, casually turning "x*y+z" into an FMA op is 
invariably playing with fire even when it is both more accurate and 
faster, because the fused and non-fused cases may produce different 
results (and most ISA's tend not to have separate single and double 
rounded FMA instructions with guarantees that each produces the 
specified result).


But, a lesson one may learn from other contexts is:
If you need determinism, don't use floating point.

Deterministic results being more usually being the domain of fixed-point 
math.

But, then a lot of ISAs don't have particularly efficient support for 
large integer math.


And, the people designing SSE and AVX seemingly at no point decided to 
grace the programmers with a convenient way to use them for doing 128 or 
256 bit integer math (say, so that people can use it to do large 
fixed-point calculations).


...
Technical Details
Message-ID: <11dvmm5$1b02u$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-mail
References: <11cpqih$acf5$1@dont-email.me> <11cuoa4$21279$1@dont-email.me> <jwvcxscsjsa.fsf-monnier+comp.arch@gnu.org> <1794357499-5857@newsgrouper.org> <jwvik23o10u.fsf-monnier+comp.arch@gnu.org> <2026Nov12.072121@mips.complang.tuwien.ac.at> <jwvy0axmx8f.fsf-monnier+comp.arch@gnu.org> <2026Nov13.192642@mips.complang.tuwien.ac.at> <2026Nov13.225125@mips.complang.tuwien.ac.at> <20261114183612.00006a3f@yahoo.com> <2026Nov14.185307@mips.complang.tuwien.ac.at> <11dc4s1$2m81d$1@dont-email.me> <2026Nov15.180332@mips.complang.tuwien.ac.at> <11dd2d4$31ftt$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: BGB <cr88192@gmail.com>
Newsgroups: comp.arch
Subject: Re: CISC are not "unreduced"
Date: Sun, 22 Nov 2026 15:26:29 -0600
Organization: A noiseless patient Spider
Lines: 107
Message-ID: <11dvmm5$1b02u$1@dont-email.me>
References: <11cpqih$acf5$1@dont-email.me> <11cuoa4$21279$1@dont-email.me>
 <jwvcxscsjsa.fsf-monnier+comp.arch@gnu.org> <1794357499-5857@newsgrouper.org>
 <jwvik23o10u.fsf-monnier+comp.arch@gnu.org>
 <2026Nov12.072121@mips.complang.tuwien.ac.at>
 <jwvy0axmx8f.fsf-monnier+comp.arch@gnu.org>
 <2026Nov13.192642@mips.complang.tuwien.ac.at>
 <2026Nov13.225125@mips.complang.tuwien.ac.at>
 <20261114183612.00006a3f@yahoo.com>
 <2026Nov14.185307@mips.complang.tuwien.ac.at> <11dc4s1$2m81d$1@dont-email.me>
 <2026Nov15.180332@mips.complang.tuwien.ac.at> <11dd2d4$31ftt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 22 Nov 2026 21:26:30 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1409118"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19mnftXSvXwUBPeOc/qDSfTjtWIoDNe1iU="; posting-host="960efb15034855165b74bf9fa300ee70"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:W4eFS+po0yrU7nlsoisYq2sE6gA= sha256:tA9TfYBGahmaAUfP3lQjXLnXyAEUZyHNSb0FFQh8Tr0=
	sha1:tc2y/8dxYkJa176mkXKTp8nOlec= sha256:HX/sU8Wl8qmZ0UWVG7DHDqcVdGKkLjA9yVa/op9CNEc=
In-Reply-To: <11dd2d4$31ftt$1@dont-email.me>
Content-Language: en-US