From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 6ACFC3858D20 for ; Thu, 10 Aug 2023 07:26:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6ACFC3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-26948743648so429208a91.0 for ; Thu, 10 Aug 2023 00:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691652412; x=1692257212; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uiNNtpefLgaKOqVMU8C+IYU1IQUpNoHrRt0J6RJVbQI=; b=TAwDI8nmi+u4xIseFkEgVja79cqwQcGqhzxyZGjDuS9n31kkBAr9NqAivY9nbhGQhe YABpUIBlJZjxPbQbiiFCg5a30oQDx//c5qV8aPcGpeOT7Rqn3CuXZrzL6eMaX1oejFjm MxpvCvLFRdBGA+uchAqegbQQTViy2oJ4aX5CKDx9flADQZflDzH7UFU+wWHdjl6ssu0M r/cmrbjs1CQeWATnGCZUfdQ24k9Z1nrU1nGz9IAnErRVQZr5KGttjWX5OCluuA0KTsZm Ln3alt32k2LO8H+zSPpxj1AKe+dfhXu90Z691MHjE8cfUKF2QiQoFNWKTUsk4O+63RdA /q4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691652412; x=1692257212; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uiNNtpefLgaKOqVMU8C+IYU1IQUpNoHrRt0J6RJVbQI=; b=Lp8JMWzPGBC7pyf/f4piTGHjabzL8jcO1uf6lVnsALwyMmpHvR4VydG5lw7OB2z5kU n8Ba7ec13mjQ65vaeg2tN7mRrjYxMtlqNSKf1KdwUmHSgYZ4o9r53LqKTlIhG68H5PPt mIsAf6UfCcuf6KRidpZ2A5vZF9v5/COHU7nxOZ0fl6sV6lFC2EeNJI/y1PaTKhMWjb8Z w2g9Pc0GOtnVEMBxg+8ICXEQatD6qUxDXFby86nFOSSdI3G1v5Lk7zfsVOUPG8RS3X6G dO4JffGZNCNrjwkzYv7TCj095ol/GxtYpgK0CVlrmORTGlm50t/HWRzXIVFD8H/zIWgH 57eg== X-Gm-Message-State: AOJu0YxZCzr/yPIc8zWWq6LoSbqf2mYM1cqKRXKxK7f9a1h4Bkiws/8c hMWQtKo/5pJxp+POKYPtxnmJJ3tKihM6iQ1Dlww= X-Google-Smtp-Source: AGHT+IF8xy0Q1SDc4XoNQwI37zLiAw5pD7IGyAXDYiXXqkmCafHTT8gAVXfARFB+5yfP3VClBylbAgaxkJ5lxtEqdOU= X-Received: by 2002:a17:90a:738f:b0:262:e84f:ad80 with SMTP id j15-20020a17090a738f00b00262e84fad80mr1462959pjg.9.1691652412288; Thu, 10 Aug 2023 00:26:52 -0700 (PDT) MIME-Version: 1.0 References: <696ce2b2-5ac2-8946-29de-d5dd4fb3aff2@codesourcery.com> In-Reply-To: From: Andrew Pinski Date: Thu, 10 Aug 2023 00:26:40 -0700 Message-ID: Subject: Re: [PATCH 0/12] GCC _BitInt support [PR102989] To: Jakub Jelinek Cc: Richard Biener , Joseph Myers , Uros Bizjak , hjl.tools@gmail.com, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Aug 10, 2023 at 12:13=E2=80=AFAM Jakub Jelinek via Gcc-patches wrote: > > On Thu, Aug 10, 2023 at 06:55:05AM +0000, Richard Biener wrote: > > On Wed, 9 Aug 2023, Joseph Myers wrote: > > > > > On Wed, 9 Aug 2023, Jakub Jelinek via Gcc-patches wrote: > > > > > > > - _Complex _BitInt(N) isn't supported; again mainly because none of= the psABIs > > > > mention how those should be passed/returned; in a limited way the= y are > > > > supported internally because the internal functions into which > > > > __builtin_{add,sub,mul}_overflow{,_p} is lowered return COMPLEX_T= YPE as a > > > > hack to return 2 values without using references/pointers > > > > > > What happens when the usual arithmetic conversions are applied to > > > operands, one of which is a complex integer type and the other of whi= ch is > > > a wider _BitInt type? I don't see anything in the code to disallow t= his > > > case (which would produce an expression with a _Complex _BitInt type)= , or > > > any testcases for it. > > > > > > Other testcases I think should be present (along with any correspondi= ng > > > changes needed to the code itself): > > > > > > * Verifying that the new integer constant suffix is rejected for C++. > > > > > > * Verifying appropriate pedwarn-if-pedantic for the new constant suff= ix > > > for versions of C before C2x (and probably for use of _BitInt type > > > specifiers before C2x as well) - along with the expected -Wc11-c2x-co= mpat > > > handling (in C2x mode) / -pedantic -Wno-c11-c2x-compat in older modes= . > > > > Can we go as far as deprecating our _Complex int extension for > > C17 and make it unavailable for C2x, side-stepping the issue? > > Or maybe at least considering that for C2x? > > I can just sorry at it for now. And now that I search through the x86-64 > psABI again, it doesn't mention complex integers at all, so we are there = on > our own. And it seems we don't have anything for complex integers on the > library side and the complex lowering is before bitint lowering, so it mi= ght > just work with < 10 lines of changes in code + testsuite, but if we do > enable it, let's do it incrementally. _Complex int division also has issues which is another reason to deprecate/remove it; see PR 104937 for that and https://gcc.gnu.org/legacy-ml/gcc/2001-11/msg00790.html (which was the first time to deprecate _Complex int; https://gcc.gnu.org/legacy-ml/gcc/2001-11/msg00863.html). Thanks, Andrew > > Jakub >