Re: binary128 implementation

Liste des GroupesRevenir à c arch 
Sujet : Re: binary128 implementation
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.arch
Date : 25. May 2024, 17:53:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2t1ik$2uds3$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Mozilla Thunderbird
On 5/24/2024 6:29 PM, MitchAlsup1 wrote:
BGB-Alt wrote:
 Don't you EVER snip useless crap off the top of your posts ??
 
In my case, BGBCC supports __int128 operations whether or not the ALUX instructions are enabled (along with _BitInt, *1).
 I am guessing that your CPU does not do 128, 256, 384 bit calculations
natively, but the compiler supports those by emitting sequences of instructions.
 
The (optional) ALUX extension does native 128-bit operations, albeit internally via pairing registers and function units across lanes.
For 256 and wider, it is necessary to fall back to 64-bit operations (unless I added a ADCX instruction or something...).
So, ALUX has:
   ADDX          Xm, Xo, Xn  //128-bit ADD
   SUBX          Xm, Xo, Xn  //128-bit SUB
   ANDX/ORX/XORX             //128-bit AND/OR/XOR
   SHADX/SHLDX   Xm, Ro, Xn  //128-bit shift
   SHADX/SHLDX  Xm, Imm, Xn  //128-bit shift
   MOVX          Xm, Xn      //128-bit MOV
   CMPEQX/CMPGTX Xm, Xn      //128-bit compare
   ...
Encodings had been reserved for 128-bit multiply, but this is not implemented as of yet. These are also a different extension, and only exist as 2R ops, but this isn't a huge loss as it is not exactly like these would be pipelined...
If the ALUX extension is not enabled in BGBCC (disabled is the default, except in the G and H profiles, *), it will fall back to using 64-bit operations to perform __int128 arithmetic, or runtime calls for other operations.
Many operations in this case will become a multi-instruction sequence.
*1: The G and H profiles are also the ones that have 128-bit pointers and assume a 96-bit address space, differing mostly in "sizeof(void *)":
   G assumes "sizeof(void *)==16", whereas H assumes 8.
In any case though, 128-bit multiply or divide will still require a runtime call (which in some cases may produce or require working with 256 bit values, which will always require runtime calls).

*1:
   _BitInt(56)  x0;  //maps to 64-bit
   _BitInt(64)  x1;  //maps to 64-bit
   _BitInt(80)  x2;  //maps to 128-bit
   _BitInt(128) x3;  //maps to 128-bit
   _BitInt(160) x4;  //maps to 256-bit
   _BitInt(256) x5;  //maps to 256-bit
   _BitInt(272) x6;  //maps to 384-bit
   ...
All sizes beyond 256 bit mapping to the next integer multiple of 128 bits. The 256-bit type is special, in that it has its own dedicated logic, but exists via the _BitInt type. For 384 and beyond, generic logic is used that deals with any size value, but is slower.
 
Can note that in my implementation, BitInt does not enforce modulo behavior in the case of overflow (it is modulo only to the size of the container; enforcing odd-bit modulo behavior would add a fair bit of cost to using them).
 The multi-precision arithmetic in My 66000 supports rather arbitrary width calculations, although only those 256-bits and smaller can be considered fast and/or efficient. In addition, both signed and unsigned multi-precision arithmetic is available.
 
In my case, these ones are done in software. Supporting fine-grain variable width would come at a performance penalty.

 
Terje
>

Date Sujet#  Auteur
12 May 24 * Making Lemonade (Floating-point format changes)101John Savard
12 May 24 +* Re: Making Lemonade (Floating-point format changes)3wolfgang kern
15 May 24 i`* Re: Making Lemonade (Floating-point format changes)2Michael S
15 May 24 i `- Re: Making Lemonade (Floating-point format changes)1BGB
12 May 24 +* Re: Making Lemonade (Floating-point format changes)6Thomas Koenig
12 May 24 i`* Re: Making Lemonade (Floating-point format changes)5John Savard
12 May 24 i +- Re: Making Lemonade (Floating-point format changes)1John Savard
12 May 24 i `* Re: Making Lemonade (Floating-point format changes)3MitchAlsup1
13 May 24 i  `* Re: Making Lemonade (Floating-point format changes)2John Savard
13 May 24 i   `- Re: Making Lemonade (Floating-point format changes)1BGB
12 May 24 `* Re: Making Lemonade (Floating-point format changes)91John Dallman
12 May 24  `* Re: Making Lemonade (Floating-point format changes)90Thomas Koenig
13 May 24   `* Re: Making Lemonade (Floating-point format changes)89Michael S
13 May 24    +* Re: Making Lemonade (Floating-point format changes)56Thomas Koenig
14 May 24    i`* Re: Making Lemonade (Floating-point format changes)55Michael S
15 May 24    i `* Re: Making Lemonade (Floating-point format changes)54Thomas Koenig
15 May 24    i  `* Re: Making Lemonade (Floating-point format changes)53Michael S
19 May 24    i   `* Re: Making Lemonade (Floating-point format changes)52Thomas Koenig
19 May 24    i    +* Re: Making Lemonade (Floating-point format changes)3Michael S
19 May 24    i    i+- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
20 May 24    i    i`- Re: Making Lemonade (Floating-point format changes)1Thomas Koenig
19 May 24    i    `* Re: Making Lemonade (Floating-point format changes)48Terje Mathisen
19 May 24    i     +* Re: Making Lemonade (Floating-point format changes)40Michael S
19 May 24    i     i+- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
20 May 24    i     i+* Re: Making Lemonade (Floating-point format changes)30Terje Mathisen
20 May 24    i     ii`* Re: Making Lemonade (Floating-point format changes)29Michael S
20 May 24    i     ii `* Re: Making Lemonade (Floating-point format changes)28Terje Mathisen
20 May 24    i     ii  `* Re: Making Lemonade (Floating-point format changes)27Michael S
20 May 24    i     ii   +* Re: Making Lemonade (Floating-point format changes)19BGB
20 May 24    i     ii   i`* Re: Making Lemonade (Floating-point format changes)18MitchAlsup1
20 May 24    i     ii   i +- Re: Making Lemonade (Floating-point format changes)1Chris M. Thomasson
20 May 24    i     ii   i +- Re: Making Lemonade (Floating-point format changes)1Thomas Koenig
21 May 24    i     ii   i `* Re: Making Lemonade (Floating-point format changes)15BGB
21 May 24    i     ii   i  +* Re: Making Lemonade (Floating-point format changes)12Thomas Koenig
21 May 24    i     ii   i  i+* Re: Making Lemonade (Floating-point format changes)7Michael S
21 May 24    i     ii   i  ii+* Re: Making Lemonade (Floating-point format changes)5Terje Mathisen
21 May 24    i     ii   i  iii+- Re: Making Lemonade (Floating-point format changes)1Michael S
21 May 24    i     ii   i  iii`* Re: Making Lemonade (Floating-point format changes)3BGB
22 May 24    i     ii   i  iii `* Re: Making Lemonade (Floating-point format changes)2MitchAlsup1
22 May 24    i     ii   i  iii  `- Re: Making Lemonade (Floating-point format changes)1BGB-Alt
21 May 24    i     ii   i  ii`- Re: Making Lemonade (Floating-point format changes)1Thomas Koenig
21 May 24    i     ii   i  i`* Re: Making Lemonade (Floating-point format changes)4BGB
21 May 24    i     ii   i  i `* Re: Making Lemonade (Floating-point format changes)3MitchAlsup1
21 May 24    i     ii   i  i  +- Re: Making Lemonade (Floating-point format changes)1BGB
22 May 24    i     ii   i  i  `- Re: Making Lemonade (Floating-point format changes)1Terje Mathisen
21 May 24    i     ii   i  `* Re: Making Lemonade (Floating-point format changes)2MitchAlsup1
21 May 24    i     ii   i   `- Re: Making Lemonade (Floating-point format changes)1BGB
20 May 24    i     ii   `* Re: Making Lemonade (Floating-point format changes)7Terje Mathisen
21 May 24    i     ii    `* Re: Making Lemonade (Floating-point format changes)6Michael S
21 May 24    i     ii     `* Re: Making Lemonade (Floating-point format changes)5MitchAlsup1
21 May 24    i     ii      +* Re: Making Lemonade (Floating-point format changes)2Stefan Monnier
22 May 24    i     ii      i`- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
22 May 24    i     ii      +- Re: Making Lemonade (Floating-point format changes)1Terje Mathisen
22 May 24    i     ii      `- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
20 May 24    i     i`* binary128 implementation (was: Making Lemonade (Floating-point format changes)8Anton Ertl
20 May 24    i     i `* Re: binary128 implementation7Terje Mathisen
23 May 24    i     i  `* Re: binary128 implementation6BGB-Alt
23 May 24    i     i   `* Re: binary128 implementation5MitchAlsup1
24 May 24    i     i    `* Re: binary128 implementation4Terje Mathisen
24 May 24    i     i     `* Re: binary128 implementation3BGB-Alt
25 May 24    i     i      `* Re: binary128 implementation2MitchAlsup1
25 May 24    i     i       `- Re: binary128 implementation1BGB
19 May 24    i     +* Re: Making Lemonade (Floating-point format changes)6BGB
19 May 24    i     i`* Re: Making Lemonade (Floating-point format changes)5MitchAlsup1
20 May 24    i     i `* Re: Making Lemonade (Floating-point format changes)4BGB
20 May 24    i     i  `* Re: Making Lemonade (Floating-point format changes)3MitchAlsup1
20 May 24    i     i   `* Re: Making Lemonade (Floating-point format changes)2BGB
20 May 24    i     i    `- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
19 May 24    i     `- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
13 May 24    `* Re: Making Lemonade (Floating-point format changes)32BGB
13 May 24     `* Re: Making Lemonade (Floating-point format changes)31MitchAlsup1
14 May 24      +* Re: Making Lemonade (Floating-point format changes)22BGB
14 May 24      i`* Re: Making Lemonade (Floating-point format changes)21MitchAlsup1
14 May 24      i `* Re: Making Lemonade (Floating-point format changes)20BGB
14 May 24      i  `* Re: Making Lemonade (Floating-point format changes)19MitchAlsup1
14 May 24      i   +* Re: Making Lemonade (Floating-point format changes)2Michael S
15 May 24      i   i`- Re: Making Lemonade (Floating-point format changes)1Michael S
14 May 24      i   +- Re: Making Lemonade (Floating-point format changes)1BGB
16 May 24      i   `* Re: Making Lemonade (Floating-point format changes)15MitchAlsup1
17 May 24      i    `* Re: Making Lemonade (Floating-point format changes)14MitchAlsup1
17 May 24      i     +* Re: Making Lemonade (Floating-point format changes)2MitchAlsup1
18 May 24      i     i`- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
18 May 24      i     `* Re: Making Lemonade (Floating-point format changes)11Chris M. Thomasson
19 May 24      i      `* Re: Making Lemonade (Floating-point format changes)10Chris M. Thomasson
19 May 24      i       `* Re: Making Lemonade (Floating-point format changes)9Chris M. Thomasson
19 May 24      i        `* Re: Making Lemonade (Floating-point format changes)8Chris M. Thomasson
20 May 24      i         `* Re: Making Lemonade (Floating-point format changes)7Chris M. Thomasson
20 May 24      i          `* Re: Making Lemonade (Floating-point format changes)6Chris M. Thomasson
20 May 24      i           `* Re: Making Lemonade (Floating-point format changes)5Chris M. Thomasson
24 May 24      i            `* Re: Making Lemonade (Floating-point format changes)4Chris M. Thomasson
26 May 24      i             `* Re: Making Lemonade (Floating-point format changes)3George Neuner
27 May 24      i              +- Re: Making Lemonade (Floating-point format changes)1Chris M. Thomasson
1 Jun 24      i              `- Re: Making Lemonade (Floating-point format changes)1Chris M. Thomasson
14 May 24      +* Re: Making Lemonade (Floating-point format changes)4Anton Ertl
14 May 24      i`* Re: Making Lemonade (Floating-point format changes)3MitchAlsup1
14 May 24      i +- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
14 May 24      i `- Re: Making Lemonade (Floating-point format changes)1BGB
10 Jun 24      `* Re: Making Lemonade (Floating-point format changes)4Lawrence D'Oliveiro
10 Jun 24       `* Re: Making Lemonade (Floating-point format changes)3Terje Mathisen
10 Jun 24        `* Re: Making Lemonade (Floating-point format changes)2Niklas Holsti
11 Jun 24         `- Re: Making Lemonade (Floating-point format changes)1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal