Re: Tonights Tradeoff - Carry and Overflow

Liste des GroupesRevenir à c arch 
Sujet : Re: Tonights Tradeoff - Carry and Overflow
De : mitchalsup (at) *nospam* aol.com (MitchAlsup1)
Groupes : comp.arch
Date : 13. Oct 2024, 00:28:26
Autres entêtes
Organisation : Rocksolid Light
Message-ID : <531204abc9366f7dff2f288acb941f9a@www.novabbs.org>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Rocksolid Light
On Sat, 12 Oct 2024 22:20:50 +0000, Robert Finch wrote:

On 2024-10-12 4:14 p.m., BGB wrote:
On 10/12/2024 1:50 PM, MitchAlsup1 wrote:
On Sat, 12 Oct 2024 9:38:01 +0000, Robert Finch wrote:
>
On 2024-10-09 6:44 a.m., Robert Finch wrote:
Mulled over carry and overflow in arithmetic operations. Looked at
widening the datapath to 66-bits to hold carry and overflow bits.
Thinking it may increase the size of the design by over 3% just to
support carry and overflow. For now, an instruction, ADDGC, was added to
generate the carry bit as a result. A 256-bit add looks like:
>
; 256 bit add
; A = r1,r2,r3,r4
; B = r5,r6,r7,r8
; S = r9,r10,r11,r12
>
    add r9,r1,r5,r0
    addgc r13,r1,r5,r0
    add r10,r2,r6,r13
    addgc r13,r2,r6,r13
    add r11,r7,r3,r13
    addgc r13,r7,r3,r13
    add r12,r8,r4,r13
>
My 66000 version::
>
       CARRY   R8,{{IO}{IO}{IO}{O}}
       ADD     R4,R12,R16
       ADD     R5,R13,R17
       ADD     R6,R14,R18
       ADD     R7,R15,R19
            // R{8,7,6,5,4} contain the 257-bit result.
>
256-bit add giving 257-bit result.
>
BJX2 / XG2, assuming in-register (A/D=R4..R7, B=R20..R23):
   CLRT
   ADDC  R20, R4
   ADDC  R21, R5
   ADDC  R22, R6
   ADDC  R23, R7
>
Or, D=R16..R19
   MOV.X R4, R16
   MOV.X R6, R18
   CLRT
   ADDC  R20, R16
   ADDC  R21, R17
   ADDC  R22, R18
   ADDC  R23, R19
>
ADDC is itself mostly a holdover from SH.
>
Could almost make sense to make it have a 3R form though and move it to
updating SR.S instead, since SR.T is likely better left exclusively to
predication (vs mostly predication, and obscure edge-case ops like ADDC/
SUBC/ROTCL/...).
>
Could almost add an ADDC.X op which operates 128 bits at a time, say:
   CLRT
   ADDC.X R4, R20, R16
   ADDC.X R6, R22, R18
>
Except that it would be rarely used enough to make its existence
debatable at best.
>
>
>
Not very elegant a solution, but it is simple. I think it requires
minimal hardware. Three input ADD is already present and ADDGC just
routes the carry bit to the output.
>
BJX2 / XG2 has destroys the value of the one source operand, I noted the
extra code to preserve the one operand. Is that only for the ADDC
instruction?
>
What is the limit on the My66000 CARRY modifier for the number of
carries? Assuming the sequence is interruptible there must be a few bits
of state that need to be preserved.
CARRY casts its modification over 8 subsequent instructions using its
16-bit immediate.

I found incorporating modifiers have a tendency to turn my code into
spaghetti. Maybe my grasp of implementation is not so great though.
DECODE has a shift register to attach 2-bits to subsequent instructions
each. However, the Rd provided by CARRY carries 64-bits from instruction
to instruction--which makes 256×64 -bit multiplication straightforward.

The add, addgc can execute at the same time. So, it is 4 clocks at the
worst to add two 256-bit numbers. (The first / last instructions may
execute at the same time as other instructions).
I wanted to avoid using instruction modifiers and special flags
registers as much as possible. It is somewhat tricky to have a carry
flag in flight. Q+ is not very code dense, but the add can be done. It
is also possible to put the carry bit in a predicate register.

Date Sujet#  Auteur
11 Sep 24 * Re: Tonights Tradeoff86MitchAlsup1
15 Sep 24 `* Re: Tonights Tradeoff85Robert Finch
16 Sep 24  `* Re: Tonights Tradeoff84Robert Finch
24 Sep 24   `* Re: Tonights Tradeoff - Background Execution Buffers83Robert Finch
24 Sep 24    `* Re: Tonights Tradeoff - Background Execution Buffers82MitchAlsup1
26 Sep 24     `* Re: Tonights Tradeoff - Background Execution Buffers81Robert Finch
26 Sep 24      `* Re: Tonights Tradeoff - Background Execution Buffers80MitchAlsup1
27 Sep 24       `* Re: Tonights Tradeoff - Background Execution Buffers79Robert Finch
4 Oct 24        `* Re: Tonights Tradeoff - Background Execution Buffers78Robert Finch
4 Oct 24         +* Re: Tonights Tradeoff - Background Execution Buffers75Anton Ertl
4 Oct 24         i`* Re: Tonights Tradeoff - Background Execution Buffers74Robert Finch
5 Oct 24         i `* Re: Tonights Tradeoff - Background Execution Buffers73Anton Ertl
9 Oct 24         i  `* Re: Tonights Tradeoff - Background Execution Buffers72Robert Finch
9 Oct 24         i   +* Re: Tonights Tradeoff - Background Execution Buffers3MitchAlsup1
9 Oct 24         i   i+- Re: Tonights Tradeoff - Background Execution Buffers1Robert Finch
12 Oct 24         i   i`- Re: Tonights Tradeoff - Background Execution Buffers1BGB
12 Oct 24         i   +* Re: Tonights Tradeoff - Carry and Overflow67Robert Finch
12 Oct 24         i   i`* Re: Tonights Tradeoff - Carry and Overflow66MitchAlsup1
12 Oct 24         i   i `* Re: Tonights Tradeoff - Carry and Overflow65BGB
12 Oct 24         i   i  `* Re: Tonights Tradeoff - Carry and Overflow64Robert Finch
13 Oct 24         i   i   +* Re: Tonights Tradeoff - Carry and Overflow3MitchAlsup1
13 Oct 24         i   i   i`* Re: Tonights Tradeoff - ATOM2Robert Finch
13 Oct 24         i   i   i `- Re: Tonights Tradeoff - ATOM1MitchAlsup1
13 Oct 24         i   i   +- Re: Tonights Tradeoff - Carry and Overflow1BGB
31 Oct 24         i   i   `* Page fetching cache controller59Robert Finch
31 Oct 24         i   i    +- Re: Page fetching cache controller1MitchAlsup1
6 Nov 24         i   i    `* Re: Q+ Fibonacci57Robert Finch
17 Apr 25         i   i     `* Re: register sets56Robert Finch
17 Apr 25         i   i      +* Re: register sets53Stephen Fuld
17 Apr 25         i   i      i+- Re: register sets1Robert Finch
17 Apr 25         i   i      i+* Re: register sets46MitchAlsup1
18 Apr 25         i   i      ii`* Re: register sets45Robert Finch
18 Apr 25         i   i      ii `* Re: register sets44MitchAlsup1
20 Apr 25         i   i      ii  `* Re: register sets43Robert Finch
21 Apr 25         i   i      ii   `* Re: auto predicating branches42Robert Finch
21 Apr 25         i   i      ii    `* Re: auto predicating branches41Anton Ertl
21 Apr 25         i   i      ii     +- Is an instruction on the critical path? (was: auto predicating branches)1Anton Ertl
21 Apr 25         i   i      ii     `* Re: auto predicating branches39MitchAlsup1
22 Apr 25         i   i      ii      `* Re: auto predicating branches38Anton Ertl
22 Apr 25         i   i      ii       +- Re: auto predicating branches1MitchAlsup1
22 Apr 25         i   i      ii       `* Re: auto predicating branches36Anton Ertl
22 Apr 25         i   i      ii        `* Re: auto predicating branches35MitchAlsup1
23 Apr 25         i   i      ii         +* Re: auto predicating branches3Stefan Monnier
23 Apr 25         i   i      ii         i`* Re: auto predicating branches2Anton Ertl
25 Apr 25         i   i      ii         i `- Re: auto predicating branches1MitchAlsup1
23 Apr 25         i   i      ii         `* Re: auto predicating branches31Anton Ertl
23 Apr 25         i   i      ii          `* Re: auto predicating branches30MitchAlsup1
24 Apr 25         i   i      ii           `* Re: asynch register rename29Robert Finch
27 Apr 25         i   i      ii            `* Re: fractional PCs28Robert Finch
27 Apr 25         i   i      ii             `* Re: fractional PCs27MitchAlsup1
28 Apr 25         i   i      ii              `* Re: fractional PCs26Robert Finch
28 Apr 25         i   i      ii               +* Re: fractional PCs15MitchAlsup1
29 Apr 25         i   i      ii               i`* Re: fractional PCs14Robert Finch
5 May 25         i   i      ii               i `* Re: control co-processor13Robert Finch
5 May 25         i   i      ii               i  `* Re: control co-processor12Al Kossow
5 May 25         i   i      ii               i   `* Re: control co-processor11Stefan Monnier
6 May 25         i   i      ii               i    +* Re: control co-processor3MitchAlsup1
7 May 25         i   i      ii               i    i+- Re: control co-processor1MitchAlsup1
15 Jul 25         i   i      ii               i    i`- Re: control co-processor1MitchAlsup1
7 May 25         i   i      ii               i    `* Scan chains (was: control co-processor)7Stefan Monnier
7 May 25         i   i      ii               i     +* Re: Scan chains (was: control co-processor)2Al Kossow
7 May 25         i   i      ii               i     i`- Re: Scan chains1Stefan Monnier
7 May 25         i   i      ii               i     +* Re: Scan chains3MitchAlsup1
7 May 25         i   i      ii               i     i`* Re: Scan chains2Stefan Monnier
8 May 25         i   i      ii               i     i `- Re: Scan chains1MitchAlsup1
15 Jul 25         i   i      ii               i     `- Re: Scan chains1MitchAlsup1
29 Apr 25         i   i      ii               `* Re: fractional PCs10Robert Finch
29 Apr 25         i   i      ii                `* Re: fractional PCs9MitchAlsup1
30 Apr 25         i   i      ii                 `* Re: fractional PCs8Robert Finch
30 Apr 25         i   i      ii                  +* Re: fractional PCs6Thomas Koenig
1 May 25         i   i      ii                  i+- Re: fractional PCs1Robert Finch
2 May 25         i   i      ii                  i`* Re: fractional PCs4moi
2 May 25         i   i      ii                  i +* Re: millicode, extracode, fractional PCs2John Levine
2 May 25         i   i      ii                  i i`- Re: millicode, extracode, fractional PCs1moi
2 May 25         i   i      ii                  i `- Re: fractional PCs1moi
30 Apr 25         i   i      ii                  `- Re: fractional PCs1MitchAlsup1
15 Jul 25         i   i      i`* Re: register sets5John Savard
15 Jul 25         i   i      i `* Re: register sets4MitchAlsup1
19 Jul 25         i   i      i  `* Re: register sets3Robert Finch
19 Jul 25         i   i      i   `* Re: register sets2Anton Ertl
19 Jul 25         i   i      i    `- Re: register sets1MitchAlsup1
15 Jul 25         i   i      `* Re: register sets2John Savard
15 Jul 25         i   i       `- Re: register sets1MitchAlsup1
13 Oct 24         i   `- Re: Tonights Tradeoff - Background Execution Buffers1Anton Ertl
4 Oct 24         +- Re: Tonights Tradeoff - Background Execution Buffers1BGB
6 Oct 24         `- Re: Tonights Tradeoff - Background Execution Buffers1MitchAlsup1

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal