From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by sourceware.org (Postfix) with ESMTPS id A2E42386EC3E for ; Fri, 2 Oct 2020 20:03:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A2E42386EC3E Received: by mail-wr1-x441.google.com with SMTP id z4so3056462wrr.4 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=GHjVl9HmJMnFKhFPtAnAQt86eQy2IXxLd9tCPoqCFlfwdYUd/bhbJwa5iZUuOUfg+Z AdOfR4oHcRlkfTZ71oqhZe4ORA7/YAY53gi+ZF0kACUWJq+8sRZLHjTCLF5U9e/pb+LY xJ2HbzNDWzdhEr24Jdzs7JnA21pZBdoNLfBNPvUBT+EeVgk0LJ7hVTDJbb8nMmEKcaaA A1dO1nNrPZoBm/HjO6e+X1b94lMaOSsB8oUYfiSe1x8bqtlxs4Dp86IWpfiNsK621HJG ABYSP7LDh8+GrF95NatL8sIMhvbCF80a5ncBA1/kJDDHrozD8TP3GUls8UxxvB99Pyi4 jLEQ== X-Gm-Message-State: AOAM530kpIQS1pNKNrrAb9Cfv6T6iyB/Vjrj1Wy3tmesy2wykSnq1WT9 lTbpS9e2MGi3X75NOm8vc+s= 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=-4.8 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=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches 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