Has there been historical work done to investigate small integer optimization?

Vincent Lefevre vincent at vinc17.net
Mon Feb 12 13:22:10 CET 2024


On 2024-02-12 13:01:45 +0100, Richard Biener wrote:
> Oh, and _mp_alloc < 0 could also simply mean the allocation is
> "inline", aka
> 
> typedef struct
> {
>   int _mp_alloc;                /* Number of *limbs* allocated and pointed
>                                    to by the _mp_d field.  */
>   int _mp_size;                 /* abs(_mp_size) is the number of limbs 
> the
>                                    last field points to.  If _mp_size is
>                                    negative this is a negative number.  */
>   union {
>      mp_limb_t *_mp_d;             /* Pointer to the limbs.  */
>      mp_limb_t _mp_inline_limbs[]; /* Inline limbs if _mp_alloc < 0.  */
>   };
> } __mpz_struct;

It is not possible to use a flexible array member in a union.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-devel mailing list