From patchwork Sun Jan 2 16:56:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 49449 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00B66385802A for ; Sun, 2 Jan 2022 16:56:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from cmx-torrgo001.bell.net (mta-tor-002.bell.net [209.71.212.29]) by sourceware.org (Postfix) with ESMTP id 7E4673858C27 for ; Sun, 2 Jan 2022 16:56:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7E4673858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bell.net X-RG-CM-BuS: 0 X-RG-CM-SC: 0 X-RG-CM: Clean X-Originating-IP: [67.71.8.137] X-RG-Env-Sender: dave.anglin@bell.net X-RG-Rigid: 61C6317800A55D35 X-CM-Envelope: MS4xfJK2pIElG8Bd5J9nfzXWK0uwV+N5bdKmgEup2/eO+DoSe9+8Qxgh+i53ZpMp9AVlGgkitQfrTT9+ynHl0sfugvQE7m+Zpa3kdNmccUgjmGTr6LYt0CN8 FXHsaNp6AN1sUMDusShH4bOzFkgV0jGWN4IYcWiOmv5GdF4qUdZDa+ctNi0K0CAQQYHsHokIIyZ0g/NHeFrteayaBtKOgKw/AInKSSvhkahwAEzuuXsNqbnQ Z2gYDPpbism7XML2okguOlXPl2LjjgchnXlOjEytPBoEnzc4m/e9bI9D6yYypadXi8QTCU6z8lAtbDpFTyzVVQXRwTuSsns6ZZ43SpKy2zU= X-CM-Analysis: v=2.4 cv=f44ruM+M c=1 sm=1 tr=0 ts=61d1d929 a=jrdA9tB8yuRqUzQ1EpSZjA==:117 a=jrdA9tB8yuRqUzQ1EpSZjA==:17 a=DghFqjY3_ZEA:10 a=mDV3o1hIAAAA:8 a=blUxz6bU4cLP56PdSI0A:9 a=CjuIK1q_8ugA:10 a=-tobGG41x7QyFXN-ax4A:9 a=FfaGCDsud1wA:10 a=_FVE-zBwftR9WsbkzFJk:22 Received: from mx3210.localdomain (67.71.8.137) by cmx-torrgo001.bell.net (5.8.716.03) (authenticated as dave.anglin@bell.net) id 61C6317800A55D35; Sun, 2 Jan 2022 11:56:09 -0500 Received: by mx3210.localdomain (Postfix, from userid 1000) id 4119F220115; Sun, 2 Jan 2022 16:56:09 +0000 (UTC) Date: Sun, 2 Jan 2022 16:56:08 +0000 From: John David Anglin To: GCC Patches Subject: [COMMITTED] hppa: Use optab_libfunc to access sync_lock_test_and_set libfunc Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This patch revises the atomic store code for hppa-linux to use optab_libfunc to access the sync_lock_test_and_set libfunc. We now call convert_memory_address() to convert the memory address to Pmode. This should handle more memory addresses. Tested on hppa-unknown-linux-gnu. Committed to trunk and gcc-11 branch. Dave --- Use optab_libfunc to access sync_lock_test_and_set libfunc on hppa-linux. 2022-01-02 John David Anglin gcc/ChangeLog: * config/pa/pa.md (atomic_storeq): Use optab_libfunc to access sync_lock_test_and_set libfunc. Call convert_memory_address to convert memory address to Pmode. (atomic_storehi, atomic_storesi, atomic_storedi): Likewise. diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index af5449a9ea3..31e3b1bff80 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -10366,10 +10366,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_1"); + rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, QImode); + rtx addr = convert_memory_address (Pmode, XEXP (operands[0], 0)); - emit_library_call (libfunc, LCT_NORMAL, VOIDmode, - XEXP (operands[0], 0), Pmode, + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode, operands[1], QImode); DONE; } @@ -10386,10 +10386,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_2"); + rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, HImode); + rtx addr = convert_memory_address (Pmode, XEXP (operands[0], 0)); - emit_library_call (libfunc, LCT_NORMAL, VOIDmode, - XEXP (operands[0], 0), Pmode, + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode, operands[1], HImode); DONE; } @@ -10406,10 +10406,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_4"); + rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, SImode); + rtx addr = convert_memory_address (Pmode, XEXP (operands[0], 0)); - emit_library_call (libfunc, LCT_NORMAL, VOIDmode, - XEXP (operands[0], 0), Pmode, + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode, operands[1], SImode); DONE; } @@ -10459,10 +10459,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" if (TARGET_SYNC_LIBCALL) { - rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_8"); + rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, DImode); + rtx addr = convert_memory_address (Pmode, XEXP (operands[0], 0)); - emit_library_call (libfunc, LCT_NORMAL, VOIDmode, - XEXP (operands[0], 0), Pmode, + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode, operands[1], DImode); DONE; }