From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id D39823857016 for ; Mon, 5 Sep 2022 18:37:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D39823857016 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-ed1-x52a.google.com with SMTP id z8so12325481edb.6 for ; Mon, 05 Sep 2022 11:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date; bh=5viOJLJNAxQgO5U2CaDOfSO7RaEun2rxHBaYupKCDj0=; b=XqNIE02fdsFsDogfeLggp1Fm2FdM3vR1gS7aFUUVEasImbZ+ekuwNsiu47GnJVEX/u GsUcD8Hl7wffNhlLzoj/rNFT1D5s/gOhMV4x92vZ3+8AH/l7xK86pVHrkkPUxxjIk/GG RuPMQacCk3uYrhCtdmUZYcZPDbOfKsjISlQRgX/N3GcnICVecHIWK7BWTdjIdBSsEmqq 0+NAg5fmxPIALLANSHw29NmiCAdcMfDkV1N1eJsrV5bODZHCfbTdXfLOgj3JGY34e1nV DsnmmZkJ7gyV2haHQ9Xg9p6MB24fD49UIYASEqAZZoZaqBZRkEME/aGzAvAmvcYfe9Ty mYdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date; bh=5viOJLJNAxQgO5U2CaDOfSO7RaEun2rxHBaYupKCDj0=; b=UsetzMou+k3Vw8/2j4KEj0IhtiwgtGQqYV0bcurgqxnRvTvmpOAVQc2Ua4SqidOalf Pu2V965YNcQoY2mNLx6JUn7T3S6C8xwjLzjDxgxx2EP87lAPPjT17/Oj5rr6DJIAmzhO laTSuqaddIZgi0qXujxmimMRR/OOqmyEgXtUy0E0v9WtXuxZh0KxFhgB0JAyi3QS5jiF YyCcJv7iJ5xZoLtegYRfBMZIxFVsIepDBAYRYka6iP8RAAeOpoLTnzq1s0atWw8j1SFS xJTgoEmXb4301rd8cRwmW3iq70mtNEC0siL+eEX/LxzvsNashNjS+Pk1nmaJKaHGky7v Serw== X-Gm-Message-State: ACgBeo0MjIbXNwHv5dikwEp6TvvkXC/GBCMUgiv6BXmNZ+xx97Ffv/Bh B1XPNSenyXVgjevIYhyUYD4yiJYq2d4= X-Google-Smtp-Source: AA6agR6Nith9Mdn/QhgsW0Prwme2yBM+S4OKfO/6h6ySKi1oaoVO+ReViobVOFcrZV/hdoeNIy2bXg== X-Received: by 2002:a05:6402:27cf:b0:448:706c:184b with SMTP id c15-20020a05640227cf00b00448706c184bmr31351443ede.1.1662403074900; Mon, 05 Sep 2022 11:37:54 -0700 (PDT) Received: from smtpclient.apple (dynamic-077-002-042-242.77.2.pool.telefonica.de. [77.2.42.242]) by smtp.gmail.com with ESMTPSA id jr23-20020a170906515700b0073ddd36ba8csm5405115ejc.145.2022.09.05.11.37.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Sep 2022 11:37:54 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Richard Biener Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] rs6000: Use NO_EXPR to cast to MMA pointer types Date: Mon, 5 Sep 2022 20:37:53 +0200 Message-Id: References: <20220905145108.GB25951@gate.crashing.org> Cc: Peter Bergner , GCC Patches In-Reply-To: <20220905145108.GB25951@gate.crashing.org> To: Segher Boessenkool X-Mailer: iPhone Mail (19G82) X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: > Am 05.09.2022 um 16:53 schrieb Segher Boessenkool : >=20 > =EF=BB=BFOn Mon, Sep 05, 2022 at 11:25:21AM +0200, Richard Biener wrote: >>> On Fri, Sep 2, 2022 at 7:24 PM Segher Boessenkool >>> wrote: >>> On Fri, Sep 02, 2022 at 12:02:54PM -0500, Peter Bergner wrote: >>>> On 9/2/22 11:31 AM, Segher Boessenkool wrote: >>>>> (Did you also look at non-MMA VIEW_CONVERT_EXPR uses btw?) >>>>=20 >>>> I did. It seemed they were all related to pointers to vectors and I re= member >>>> you mentioning that as one of the reasons for using VIEW_CONVERT_EXPR o= ver >>>> NOP_EXPR, so I left them alone to be safe. >>>=20 >>> Huh? I have no idea what you mean here. >>>=20 >>> Casting from one pointer type to another never needs it. Casting from a= >>> scalar integer type to a pointer type not either AFAIKi. But I am not a= >>> Gimple expert, all this might be wrong, it isn't documented anywbere :-(= >>=20 >> NOP_EXPR is for conversions between types with the same kind >> (and pointer-to-integer and integer-to-pointer >> conversions when pointer and integer are of the same size). >> When used on vectors it converts the vector elements. When you want to >> re-interpret V4SI as V4SF you need VIEW_CONVERT_EXPR (bit_cast), >> likewise V4SI interpreted as V16QI needs that. >>=20 >> Think of VIEW_CONVERT as bit_cast and NOP_EXPR as conversion. >> Of course for some conversions (like unsigned int to int) you can also >> use a VIEW_CONVERT since it's semantically the same. In those cases >> we canonicalize to NOP_EXPR via folding. >=20 > Thanks for the explanation! >=20 > About that last point... You say VIEW_CONVERT_EXPR is folded to > NOP_EXPR where possible. Does that happen in all cases / can we depend > on that? So that in target code like what started this thread the only > real difference is documentation of intent? (Which never is unimportant > of course!) You should be able to depend on that, yes. Richard=20 >=20 >=20 > Segher