From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0947FC43387 for ; Fri, 14 Dec 2018 16:31:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93848206C2 for ; Fri, 14 Dec 2018 16:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730125AbeLNQbC (ORCPT ); Fri, 14 Dec 2018 11:31:02 -0500 Received: from esgaroth.petrovitsch.at ([78.47.184.11]:3205 "EHLO esgaroth.tuxoid.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730057AbeLNQbB (ORCPT ); Fri, 14 Dec 2018 11:31:01 -0500 Received: from [10.68.100.236] (h10-gesig.woeg.acw.at [217.116.178.11] (may be forged)) (authenticated bits=0) by esgaroth.tuxoid.at (8.15.2/8.15.2) with ESMTPSA id wBEGTwYI003118 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Fri, 14 Dec 2018 17:29:58 +0100 Subject: Re: Can we drop upstream Linux x32 support? To: Rich Felker Cc: John Paul Adrian Glaubitz , Andy Lutomirski , X86 ML , LKML , Linux API , "H. Peter Anvin" , Peter Zijlstra , Borislav Petkov , Florian Weimer , Mike Frysinger , "H. J. Lu" , x32@buildd.debian.org, Arnd Bergmann , Will Deacon , Catalin Marinas , Linus Torvalds References: <70bb54b2-8ed3-b5ee-c02d-6ef66c4f27eb@physik.fu-berlin.de> <20181213160242.GV23599@brightrain.aerifal.cx> <20181214161732.GY23599@brightrain.aerifal.cx> From: Bernd Petrovitsch Message-ID: Date: Fri, 14 Dec 2018 17:29:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181214161732.GY23599@brightrain.aerifal.cx> Content-Type: multipart/mixed; boundary="------------B32AFA45FC795731541F9B92" Content-Language: en-US X-DCC-URT-Metrics: esgaroth.tuxoid.at 1060; Body=17 Fuz1=17 Fuz2=17 X-Virus-Scanned: clamav-milter 0.97 at esgaroth.tuxoid.at X-Virus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------B32AFA45FC795731541F9B92 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 14/12/2018 17:17, Rich Felker wrote: > On Fri, Dec 14, 2018 at 03:13:10PM +0100, Bernd Petrovitsch wrote: [..] >> FWIW I have >> ---- snip ---- >> #if defined __x86_64__ >> # if defined __ILP32__ // x32 >> # define PRI_time_t "lld" // for time_t >> # define PRI_nsec_t "lld" // for tv_nsec in struct timespec >> # else // x86_64 >> # define PRI_time_t "ld" // for time_t >> # define PRI_nsec_t "ld" // for tv_nsec in struct timespec >> # endif >> #else // i[3-6]68 >> # define PRI_time_t "ld" // for time_t >> # define PRI_nsec_t "ld" // for tv_nsec in struct timespec >> #endif >> ---- snip ---- >> in my userspace code for printf() and friends - I don't know how libc'= s >> react to such a patch (and I don't care for the name of the macros as >> long it's obviously clear for which type they are). >> I assume/fear we won't get additional modifiers into the relevant >> standards for libc types (as they are far more like pid_t, uid_t etc.)= =2E >> And casting to u/intmaxptr_t to get a defined printf()-modifier doesn'= t >> look appealing to me to "solve" such issues. >=20 > This is all useless (and wrong since tv_nsec is required to have type > long as part of C and POSIX, regardless of ILP32-vs-LP64; that's a bug Thanks. OK, I didn't know that - and 32bit is enough to represent 1E9 (as a second won't have more nanosecs). Hmm, can we fix that in the x32 world? Sry, I'm not the expert on glibc vs ABI va syscall interface vs breakage there though. > in glibc's x32). Just do: >=20 > printf("%jd", (intmax_t)t); >=20 > Saving 2 or 3 insns (for sign or zero extension) around a call to > printf is not going to make any measurable difference to performance Until someone comes up with hardware with ASIC support for 1k bit int's and (ab)uses intmax_t for that. SCNR .... > or any significant difference to size, and it's immeasurably more > readable than the awful PRI* macros and the > adjacent-string-concatenation they rely on. One gets used to the PRI_* macros over time (and there no calculated format strings in my world) - and type casts are not better in my eyes ..= =2E MfG, Bernd --=20 "I dislike type abstraction if it has no real reason. And saving on typing is not a good reason - if your typing speed is the main issue when you're coding, you're doing something seriously wrong." - Linus Torvalds --------------B32AFA45FC795731541F9B92 Content-Type: application/pgp-keys; name="pEpkey.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pEpkey.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- mQGNBFss+8cBDACpXlq0ZC9Qp8R+iFPx5vDPu12FpnmbbV8CwexVDchdizF2qz+A PFh12RrkE6yudI0r7peAIRePiSVYqv8XT82TpJM+tbTYk/MSQaPhcmz8jl1HaKv0 q8g5nKtr42qRsswU7Q2Sa6mWXaIdOisPYZ9eLZC9BDBhI/YrgdAwszyYJ1HUwNkp Dw5i4wW/SsIKrotCboYzbBjZfHbmDJr4dFYSoMg5jQVHD2Yz8fqNSoRyd7i/oicn 1bH/DjEkrmIu9YuptuHYmblpCRo5dLww7kgszNw12j8Iljp64uJ/uz5+asBUmRZM mGey82BB1DnIvy1v+GnbGWFIYy79/HeqdN+KbOgO/sXoqYKS5KJ6aSqWOLTQk6sv AnDN2PNF5jOB9ROCNwoQSH/YNEfMd/mQ5pGB0UJ4ykD0UnjW7DdXbVOwvwWzfHF7 HaZXB1NMpBzHxold3W19DThd4HECvXYZ6Au6p0WE8IfABS11CzbX7KJuD5Ua+xKG 3W05fMg5i0td2aMAEQEAAbQtQmVybmQgUGV0cm92aXRzY2ggPGJlcm5kQHBldHJv dml0c2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10D3d473WzCplWR4A+Rdm8ysi2haas7KZnL+ajcEo2jCghW83BQPBD57fEtl UWLXihAFcEiSx0i2AUAXYOcAEQEAAYkBvAQYAQoAJhYhBIA1sshxMJLHm6Oee4VK uwIQRyhmBQJbLPvJAhsMBQkB4TOAAAoJEIVKuwIQRyhmrGIL/3rsdQqaO3umXj9X Ts4nAme/2DVsEyGUFzeDllbzOKH7PsjJhbEsQRRE+kDk0tp2xbpVzNZ73wFhXFL+ zqa8tdMhYEjLUZ4ry/bg83yZH2bNj/jTii32AkvmL2zcYf0/knuAAAypdfTM4K6S PVlwOo09Drkiz/SDXyvpSG9GdCZLVR/HbQpsob0JddcouWwliATRrnUETb/MN6MO WI4687r1wi4Kn28CHydWA5YONvFyb7BJZRHiLQnJwlh7dgBtOSCeZClrKfhIBFB2 YgfBcgmHnpYkzyBGdUTnrrlmiMeuxZqG2SzwswRMACYqUFoe+3E7RZQX5ym17oUP Kat5L8uZbd2+TlbICXnxwTadBKDvk8qxjLSwzthoHlmM6zeFekQdq67aiBWfa9oV 6tljJtvE9QREo+hDjQaiVmzHqeB8pMGVHWzAGJzvxFuXMaKzUI8vWDH5jaht0Sqn xHyhVz8+rEsLoB67PBuY3GLecTeQ3rr52BVMzfNRPdSyVHESzw=3D=3D =3Dv2Yn -----END PGP PUBLIC KEY BLOCK----- --------------B32AFA45FC795731541F9B92--