From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by sourceware.org (Postfix) with ESMTPS id BCE43388187D for ; Fri, 2 Oct 2020 20:03:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BCE43388187D Received: by mail-wr1-x444.google.com with SMTP id k10so3046567wru.6 for ; Fri, 02 Oct 2020 13:03:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eQjuEz5eAwOwW/nc+HtvbL4AUeoXfg5eRlYjkEYY6/o=; b=QJJ8Wah62pchOAB2ML1Oao7KfrPR25DA5LTh8vcO4bvxCrbOfEsJqT/oHBtr7uzDlj 4o3vt/T/xM6Gd+WM5sIKeQG5NVnL3zuN+2IiAYmsHALfz+x354PFTP+uAEP/VqqDJdtT 5TbVLDI7RYsLI/5/0EDPT4JFQGZbn6rCC60mios2F8N9qGh3n0Im+A61clJB1V7lmV4d S70pIwCGTgLcVJt24v36H8kon1yI+NsDP1Hcj+lWe+0Q7UZLOLcAlhMXez6vxgYL3Duh eXzoPMSkxItiaHiJKsWO4a+YEv6D1HVsXjYGUhSHFg5fCSwiN9v1X0b4FtlLnEs87T/X vPKA== X-Gm-Message-State: AOAM533U+y046MRY1gSXJSbLMlfSn/4OM0SPUfBoww1gHC88h0Gn8QMR GIX3/WFwaQuDvLunk90kiOE= X-Google-Smtp-Source: ABdhPJyCFgdpBHDeyHD/6Lu/qGNR6Rdegs6C6CVAFqsDIweqJN4NlVuXn/i/NBLma0si8l+xYNQqjw== X-Received: by 2002:adf:e385:: with SMTP id e5mr4733377wrm.129.1601669026733; Fri, 02 Oct 2020 13:03:46 -0700 (PDT) Received: from [192.168.1.143] ([170.253.60.68]) by smtp.gmail.com with ESMTPSA id g8sm2754819wmd.12.2020.10.02.13.03.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Oct 2020 13:03:46 -0700 (PDT) Subject: Re: [PATCH 1/4] system_data_types.7: Add '__int128' To: Paul Eggert Cc: Florian Weimer , Alejandro Colomar via Libc-alpha , linux-man@vger.kernel.org, gcc-patches@gcc.gnu.org, mtk.manpages@gmail.com References: <20201001163443.106933-1-colomar.6.4.3@gmail.com> <20201001163443.106933-2-colomar.6.4.3@gmail.com> <87eemg97ew.fsf@oldenburg2.str.redhat.com> From: Alejandro Colomar Message-ID: Date: Fri, 2 Oct 2020 22:03:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 20:03:49 -0000 Hi Paul, On 2020-10-02 21:54, Paul Eggert wrote: > On 10/2/20 12:01 PM, Alejandro Colomar wrote: >> If you propose not to document the stdint types either, > > This is not a stdint.h issue. __int128 is not in stdint.h and is not a > system data type in any real sense; it's purely a compiler issue. > Besides, do we start repeating the GCC manual too, while we're at it? At > some point we need to restrain ourselves and stay within the scope of > the man pages. I know it's not in stdint, but I mean that it behaves as any other stdint type. So I see value in having them documented together in the same page. And it's very useful in some (very specific) cases where portability isn't in mind (although many compilers are starting to provide this type). > > PS. Have you ever tried to use __int128 in real code? I have, to my > regret. It's a portability and bug minefield and should not be used > unless you really know what you're doing, which most people do not. I have. I used unsigned __int128, for operating on a big bit matrix. This type helped me remove a whole abstraction for the columns: unsigned __int128 mat[128]; // This is a 128x128 bit matrix. This way I avoided either having to use a shorter type, which would have been a bit weird: uint64_t mat[128][2]; // This is more complicated to see. Or having to use GMP, which would have also complicated unnecessarily my code. And of course, I didn't care about portability, because I just wanted it to work. Thanks, Alex