From patchwork Sun May 24 13:33:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kamlesh kumar X-Patchwork-Id: 1296852 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=OABEnl59; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49VLm14bHGz9sPF for ; Sun, 24 May 2020 23:33:52 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C91903894410; Sun, 24 May 2020 13:33:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C91903894410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590327228; bh=zBXVT79Bp/2KWRz0blROJLxhyCowGMhmPxH5CG7FwPU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=OABEnl59Y1+80yIznZB88M4hSSCSBqmMrYLcjysEZGNTTbT45V5RVe6rmD4b+YsZl 1PpyoWOjCHkP6y/4xM4tjDi/c6y0mpJxNVaX64LL7WnI7D6EqM1e2zF30z8vs5JFFZ 16a3pLMKBaEqyHCLbemFhRYO1imon4rAdRuPz4vY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id B00FC3870872; Sun, 24 May 2020 13:33:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B00FC3870872 Received: by mail-pl1-x636.google.com with SMTP id k22so6456008pls.10; Sun, 24 May 2020 06:33:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zBXVT79Bp/2KWRz0blROJLxhyCowGMhmPxH5CG7FwPU=; b=Pth1uk/YgUD4jSVc9z3JTCujS/FKf3JOfq16WUaQBUWEOqrJe/71bqCvJUgu7Oufdt mfk+nr8//bKAIyAezKJfxWUhBO3dVIbKutoQGjJz8oLQrLcvbw2zK8g9i4wg8ESaIdd5 bPI/r+Lk/KxDRTwQjeD7a4+g/PzGEbsZ7bXV1Axq4nf0UgGll+I8Q1Lji1zg45f2SkWG 4gIXAnmQ8CeusJOvf65DppsKjl58ptILe9+qHhWVcZZUY/vVW03D4c4j08ULjTQ9bWNJ +Ixc/lKoSYfTTB2GmC3yBoGlOKyj5o6T5eWc14IciiBDVAxr4u59fMaubsvaTpJzpUTz fTgQ== X-Gm-Message-State: AOAM5330/yAZ3krL8ku3sSOec0g/rhu+lYT7JuVmhrInyvEZu+j0PVfm vaUV+5ScFYupe/CMCsBwmkmiKgIiFik= X-Google-Smtp-Source: ABdhPJzxnpCzD+w4QVkclf1oYwd0Jq7pyyne8CmVUNRqM9PmAoKYNPQnUbrtJqwKMnnosP67nKVARQ== X-Received: by 2002:a17:902:d886:: with SMTP id b6mr23790840plz.263.1590327224358; Sun, 24 May 2020 06:33:44 -0700 (PDT) Received: from localhost.localdomain ([49.204.85.206]) by smtp.gmail.com with ESMTPSA id z18sm11036132pfj.148.2020.05.24.06.33.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2020 06:33:43 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH v1 1/2][PPC64] [PR88877] Date: Sun, 24 May 2020 19:03:13 +0530 Message-Id: <1590327193-24688-1-git-send-email-kamleshbhalui@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20200523144345.GZ31009@gate.crashing.org> References: <20200523144345.GZ31009@gate.crashing.org> X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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 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-Patchwork-Original-From: Kamlesh Kumar via Gcc-patches From: kamlesh kumar Reply-To: Kamlesh Kumar Cc: jakub@redhat.com, segher@kernel.crashing.org, rguenth@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Here is a discussion we did some time ago regarding the defect. https://gcc.gnu.org/pipermail/gcc/2019-January/227834.html please see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88877 for testcase behavior. We incorporating below Jakub's suggestion in this patch series. Jakub wrote: "" Yeah, all the callers of emit_library_call* would need to be changed to pass triplets rtx, machine_mode, int/bool /*unsignedp*/, instead of just rtx_mode_t pair. "" In this patch series trying to address same by creating a struct Tuple which bundles existing rtx and machine_mode and added one more bool member which store unsigned_p which by default is false. This patch does not change underlying behavior yet. This will be done in follow up patches. ChangeLog Entry: 2020-05-24 Kamlesh Kumar * rtl.h (Tuple): Defined and typedefed to rtx_mode_t. (emit_library_call): Added default arg unsigned_p. (emit_library_call_value): Added default arg unsigned_p. --- gcc/rtl.h | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/gcc/rtl.h b/gcc/rtl.h index b0b1aac..ee42de7 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2238,10 +2238,20 @@ struct address_info { enum rtx_code base_outer_code; }; -/* This is used to bundle an rtx and a mode together so that the pair - can be used with the wi:: routines. If we ever put modes into rtx - integer constants, this should go away and then just pass an rtx in. */ -typedef std::pair rtx_mode_t; +/* This is used to bundle an rtx and a mode and unsignedness together so + that the tuple can be used with the wi:: routines. If we ever put modes + into rtx integer constants, this should go away and then just pass an rtx in. */ +typedef struct Tuple { + rtx first; + machine_mode second; + /* unsigned_p */ + bool third; + Tuple (rtx f, machine_mode s, bool t = false) { + first = f; + second = s; + third = t; + } +} rtx_mode_t; namespace wi { @@ -4176,9 +4186,9 @@ emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode) inline void emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode, - rtx arg1, machine_mode arg1_mode) + rtx arg1, machine_mode arg1_mode, bool unsigned_p = false) { - rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode) }; + rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode, unsigned_p) }; emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 1, args); } @@ -4238,9 +4248,9 @@ emit_library_call_value (rtx fun, rtx value, libcall_type fn_type, inline rtx emit_library_call_value (rtx fun, rtx value, libcall_type fn_type, machine_mode outmode, - rtx arg1, machine_mode arg1_mode) + rtx arg1, machine_mode arg1_mode, bool unsigned_p = false) { - rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode) }; + rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode, unsigned_p) }; return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 1, args); }