From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id 555C23858C83 for ; Mon, 5 Sep 2022 09:25:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 555C23858C83 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-ej1-x631.google.com with SMTP id p16so15792962ejb.9 for ; Mon, 05 Sep 2022 02:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=pzpIf7FO37Qz6CEFHB76TKEJYlpwA237KRtbMNP5vZA=; b=EhFfrziBh6qJOHDuhV2DCZtO0hYWEqpJLnKcB0evNIGNajy6RLTv8yGv5FWX/qkdYJ 8uCUFs106rnmePSsaqq9AC5/ZOQNWFyTqwl4sY0ARwvm62bOvRnMNDF4nOWDGogaaMlA V8ylGh76XREmY1x7o6ueUQwxQa9bHiFPB++w81/UWheeb55M0hGfuAXezQ3TgPidW427 irxugyaNGnvND8jH404uQfTQgBAtypQjoYIs3V22Sp6uAnKiC9kGVbncogDqNf7Pmosp Mu5LfGe5k3KopDlmJg67FunkEwjJs3oZh+zZuQxjD/57CpjO3ho5e8iRZcjLjGqi0cGV ykvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=pzpIf7FO37Qz6CEFHB76TKEJYlpwA237KRtbMNP5vZA=; b=Tp/8XHJ7SArTYDL2EwAA2IuXqOBBEPidH7cME0BjMpH6MZY2RY1P5/Y5KtWbVghAB1 DkGqn2EdB3WzrSaVRTrYTURjb+xCn8h/muuP5CXsDrtl3FqUZiVxu2jz27MEp7rB49fV Mb+dz1+pjnE2xfxu3H1nN7q49/uBY0sZ/UJn5OdlOxtlg/pV2yl6NTBHx6/yIEEohUwW 3EpJPqxwKErcB5oB165O6dFWGtCK6MumyZhZ1oAL9DYosDaH4c+k1PboxvJg2HOpUvPo EWoU3OmsyiaBMutaLl2a1Zcz2soWaJ3uKdIy9/TRFZ8MrcC1OQfNXTedsyveLrAY6yy9 wl2w== X-Gm-Message-State: ACgBeo3FuWmsdNcdWwwU9R4/RR+QD9kpR2DmUoD57BUsLuuztt2nqMUj 11Bbhn2uY54pv8R+r7UrYrjlMIcuAzw2sWzr9/w= X-Google-Smtp-Source: AA6agR48NorGHMntxQ3brEhn1NVaejlbKiN+Qr1r7k+AQELA4nli+tGXsb9qc9S03hlMrOjXH+DMQ5IHLvxEzpiBHlw= X-Received: by 2002:a17:907:2722:b0:731:23a3:be78 with SMTP id d2-20020a170907272200b0073123a3be78mr35325066ejl.330.1662369933067; Mon, 05 Sep 2022 02:25:33 -0700 (PDT) MIME-Version: 1.0 References: <58acc8c2-b6a4-e9ec-c89b-ad841cf759ed@linux.ibm.com> <20220902163134.GT25951@gate.crashing.org> <996b058b-a9de-6a0f-c4d0-45a30387f591@linux.ibm.com> <20220902172325.GV25951@gate.crashing.org> In-Reply-To: <20220902172325.GV25951@gate.crashing.org> From: Richard Biener Date: Mon, 5 Sep 2022 11:25:21 +0200 Message-ID: Subject: Re: [PATCH] rs6000: Use NO_EXPR to cast to MMA pointer types To: Segher Boessenkool Cc: Peter Bergner , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 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: 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?) > > > > I did. It seemed they were all related to pointers to vectors and I remember > > you mentioning that as one of the reasons for using VIEW_CONVERT_EXPR over > > NOP_EXPR, so I left them alone to be safe. > > Huh? I have no idea what you mean here. > > 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 :-( 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. 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. Richard. > > > Segher