From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by sourceware.org (Postfix) with ESMTPS id 98420386F002 for ; Tue, 17 Nov 2020 17:14:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98420386F002 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jimw@sifive.com Received: by mail-ej1-x643.google.com with SMTP id 7so30489764ejm.0 for ; Tue, 17 Nov 2020 09:14:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h0XVRn/RUijP8QQzcGqQaodMlVAELBPCYLVHr2bXt9Y=; b=ieZeU0YF1+rWnd0FLneKP4IyvN6zQygKMchkPtPpYvLWGMMegms41zFrUAMzkMbvCd dkvkekSxapU2QjE9gHolHlTb6c0OWwsQ7xDh6t8PEoQ73BPMz3jD1v5QebivwgeJD38N O98FSnU4DcKGrqsywTZDFqtoMCR5WG3Y5uG1Zi9vMoTJQiXroFaOsrAAj144FQupWska f8pvfXpsYnrDX+9Lbf7cZvNzfcaQ+tN2cZf/SptiqMcctLYeD5iUPWOuyj7SqteNprO5 FWWzj7Ih2uWcevzsxg3aFTO/uwzURJ+2BHkGCu62QklIJ/TVd45mDFyelYMe9szZ22P2 Q6Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h0XVRn/RUijP8QQzcGqQaodMlVAELBPCYLVHr2bXt9Y=; b=Yij7iMrruM4uqeZgW4ne5fsTL6NFamLsdQ7VhI1rsdjtpYXhDqS4iAv54XnzdkX3GG 96qJzdLJOXjvtDn22glIEtTLsIdEKH/3LYOd3WNZ/DSTsegw5F/kcqM746MRdyGf49lL UG2eLAx4lykFFzTcrocXf4o4te/CvJMZvy9DpXC0k6PTOkr4+YMFIrLYmS4caAyYvx+c ho/fz3JKFiXsoNPowGD4jC3vB0rmdkGXRmT61dn0A1CGOJrcAmoiU++3YVTOKcdhA1Od eNRjEnIFnHQgPUuWfkQIrbaQkK+wtqwCRBk6KWUMe8GH2LK55xn8lRdtqi9aRKWZBZen gfNQ== X-Gm-Message-State: AOAM5317Yvh45VKX4LdYrX5JAZAX0yJv/3PnbLRzjUzGqUnlH+YJh4Ol aqrbXJTy5fxLWcpOSiZHDwDMCzufxPCus4InuIqYKA== X-Google-Smtp-Source: ABdhPJwkMLAdrNJdfBp7/Nwb2iKsFgEqnh2Iw0dHg3gDVKONBSROsoiBc7AK7ioZRgFNIPo+Of3BFKxfgIDMBttTp+Y= X-Received: by 2002:a17:906:1f92:: with SMTP id t18mr21070760ejr.539.1605633282252; Tue, 17 Nov 2020 09:14:42 -0800 (PST) MIME-Version: 1.0 References: <1605553027-5331-1-git-send-email-philipp.tomsich@vrull.eu> <20201117164612.GW3788@tucnak> In-Reply-To: <20201117164612.GW3788@tucnak> From: Jim Wilson Date: Tue, 17 Nov 2020 09:14:31 -0800 Message-ID: Subject: Re: [PATCH v1 1/2] Simplify shifts wider than the bitwidth of types To: Jakub Jelinek Cc: Philipp Tomsich , GCC Patches , Philipp Tomsich , Philipp Tomsich X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Tue, 17 Nov 2020 17:14:45 -0000 On Tue, Nov 17, 2020 at 8:46 AM Jakub Jelinek via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > On Tue, Nov 17, 2020 at 05:29:57PM +0100, Philipp Tomsich wrote: > > > > In other words, the change to VRP canonicalizes what a lshift_expr > with an > > > > shift-amount outside of the type width means... it doesn't assume > anything > > > > about the original language. > > Well, I said if we want to do it at all, it should be done in VRP, because > there is not really a difference between ((int) x) << 32 and ((int) x) << y > for y in [32, 137] etc. > How does this stuff interact with SHIFT_COUNT_TRUNCATED and TARGET_SHIFT_TRUNCATION_MASK? We already provide a mechanism to truncate shift counts to fit based on how the hardware handles out-of-range shift counts. Handling out-of-range shift counts differently in VRP would confuse things. Maybe VRP should be using SHIFT_COUNT_TRUCNATED and/or TARGET_SHIFT_TRUNCATION_MASK here? Or maybe we give up on the shift truncation macros? Jim