From patchwork Fri Oct 25 19:46:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 99621 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 0F10C3858D35 for ; Fri, 25 Oct 2024 19:46:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 0A1553858C48 for ; Fri, 25 Oct 2024 19:46:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A1553858C48 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0A1553858C48 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729885575; cv=none; b=GzjyObkA6pvfmtL7t6VKx0kZ4gYxMOrPeOfoGVDfgrsTQNGEZPGTyInoKYsOJT5qS/lraNYApqbn8uhlzgrIZZOXubLAlfx0NOQ9Lp1SSOnHrKwUjSJXGlRCysNqUgWEaXLniL5aA8kl3Kb7VO5Ax9MU6P7urp7PAXB/dhB7Pvo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729885575; c=relaxed/simple; bh=9WoDMbFqB9jSf5h0XpK7xXiZPRQtjR32xfE7btP4YHk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Ek4XdsNxTaWkSl5Cad4Eq2jKjbb84VhM77FmjDtziw+viHaUWC/MuAD1fo3npYx875/N6epiyHLVP0cuWyfjOiD+bnDsG4x8MPRnl0+wkr+yFC3Bdggmz90Uel6Bn7c90XR9SCR10rVzcssK8LxiwTLTXZ/PG57TqfTMthIK8q8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49PGkVmX025195; Fri, 25 Oct 2024 19:46:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pp1; bh=OrAGvA3Be6RvqQLOqlvqlF5h8jnfgS B7DScqd8A/1Fk=; b=Z8Bfjqe78/AjQvdx1ZJFMuCCr1a2FZqHa3DKCiESxwHrGT lbdxFC8b/vIHKDHacwrotzWPm8uS+2xieJbzZMK/4zr7Nc3UGm2idB7SMVOLQJUe dBlqgmzsd/uM+gQHu6VVDsrRqWDB1S5uYJOOWe3OCmGTpfAbkVi/uFE7iTnlnjdA 1ICvPliyWXriqLNWW6+jB2GDkm9wc9r8YqNmIc7YfSL1+wHmp3m9+LRfsogyqGD6 l70S2og1fsM3geKBw/+cPS7C8O6dtyxSWTJ3xFJImRecCU8WTDSLMrsPUAXKEhNG LgHhqeeTgZ6ZHNefF+NfhfXVXmZfBmHq6sguoHow== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42emaf817g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Oct 2024 19:46:12 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 49PI5bZC008796; Fri, 25 Oct 2024 19:46:11 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 42emkayegn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Oct 2024 19:46:11 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 49PJk9JW45416786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Oct 2024 19:46:10 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D632D5805E; Fri, 25 Oct 2024 19:46:09 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72A0458043; Fri, 25 Oct 2024 19:46:09 +0000 (GMT) Received: from cowardly-lion.the-meissners.org (unknown [9.61.120.201]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTPS; Fri, 25 Oct 2024 19:46:09 +0000 (GMT) Date: Fri, 25 Oct 2024 15:46:07 -0400 From: Michael Meissner To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , "Kewen.Lin" , Peter Bergner Subject: [PATCH 5/11] Change TARGET_FPRND to TARGET_POWER5X Message-ID: Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , "Kewen.Lin" , Peter Bergner References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 2hYlcBsS5bYu5stT42V3LLYdFVimlTTu X-Proofpoint-ORIG-GUID: 2hYlcBsS5bYu5stT42V3LLYdFVimlTTu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 phishscore=0 spamscore=0 mlxscore=0 mlxlogscore=981 priorityscore=1501 suspectscore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410250148 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 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 As part of the architecture flags patches, this patch changes the use of TARGET_FPRND to TARGET_POWER5X. The FPRND instruction was added in power5+. I have built both big endian and little endian bootstrap compilers and there were no regressions. In addition, I constructed a test case that used every archiecture define (like _ARCH_PWR4, etc.) and I also looked at the .machine directive generated. I ran this test for all supported combinations of -mcpu, big/little endian, and 32/64 bit support. Every single instance generated exactly the same code with the patches installed compared to the compiler before installing the patches. Can I install this patch on the GCC 15 trunk? 2024-10-25 Michael Meissner * config/rs6000/rs6000.cc (report_architecture_mismatch): Use TARGET_POWER5X instead of TARGET_FPRND. * config/rs6000/rs6000.md (fmod3): Use TARGET_POWER5X instead of TARGET_FPRND. (remainder3): Likewise. (fctiwuz_): Likewise. (btrunc2): Likewise. (ceil2): Likewise. (floor2): Likewise. (round): Likewise. --- gcc/config/rs6000/rs6000.cc | 2 +- gcc/config/rs6000/rs6000.md | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index a944ffde28a..dd51d75c495 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -25428,7 +25428,7 @@ report_architecture_mismatch (void) rs6000_isa_flags |= (ISA_2_5_MASKS_SERVER & ~ignore_masks); else if (TARGET_CMPB) rs6000_isa_flags |= (ISA_2_5_MASKS_EMBEDDED & ~ignore_masks); - else if (TARGET_FPRND) + else if (TARGET_POWER5X) rs6000_isa_flags |= (ISA_2_4_MASKS & ~ignore_masks); else if (TARGET_POPCNTB) rs6000_isa_flags |= (ISA_2_2_MASKS & ~ignore_masks); diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 10d13bf812d..7f9fe609a03 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -5171,7 +5171,7 @@ (define_expand "fmod3" (use (match_operand:SFDF 1 "gpc_reg_operand")) (use (match_operand:SFDF 2 "gpc_reg_operand"))] "TARGET_HARD_FLOAT - && TARGET_FPRND + && TARGET_POWER5X && flag_unsafe_math_optimizations" { rtx div = gen_reg_rtx (mode); @@ -5189,7 +5189,7 @@ (define_expand "remainder3" (use (match_operand:SFDF 1 "gpc_reg_operand")) (use (match_operand:SFDF 2 "gpc_reg_operand"))] "TARGET_HARD_FLOAT - && TARGET_FPRND + && TARGET_POWER5X && flag_unsafe_math_optimizations" { rtx div = gen_reg_rtx (mode); @@ -6687,7 +6687,7 @@ (define_insn "fctiwuz_" (define_insn "*friz" [(set (match_operand:DF 0 "gpc_reg_operand" "=d,wa") (float:DF (fix:DI (match_operand:DF 1 "gpc_reg_operand" "d,wa"))))] - "TARGET_HARD_FLOAT && TARGET_FPRND + "TARGET_HARD_FLOAT && TARGET_POWER5X && flag_unsafe_math_optimizations && !flag_trapping_math && TARGET_FRIZ" "@ friz %0,%1 @@ -6815,7 +6815,7 @@ (define_insn "btrunc2" [(set (match_operand:SFDF 0 "gpc_reg_operand" "=d,wa") (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" "d,wa")] UNSPEC_FRIZ))] - "TARGET_HARD_FLOAT && TARGET_FPRND" + "TARGET_HARD_FLOAT && TARGET_POWER5X" "@ friz %0,%1 xsrdpiz %x0,%x1" @@ -6825,7 +6825,7 @@ (define_insn "ceil2" [(set (match_operand:SFDF 0 "gpc_reg_operand" "=d,wa") (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" "d,wa")] UNSPEC_FRIP))] - "TARGET_HARD_FLOAT && TARGET_FPRND" + "TARGET_HARD_FLOAT && TARGET_POWER5X" "@ frip %0,%1 xsrdpip %x0,%x1" @@ -6835,7 +6835,7 @@ (define_insn "floor2" [(set (match_operand:SFDF 0 "gpc_reg_operand" "=d,wa") (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" "d,wa")] UNSPEC_FRIM))] - "TARGET_HARD_FLOAT && TARGET_FPRND" + "TARGET_HARD_FLOAT && TARGET_POWER5X" "@ frim %0,%1 xsrdpim %x0,%x1" @@ -6846,7 +6846,7 @@ (define_insn "round2" [(set (match_operand:SFDF 0 "gpc_reg_operand" "=") (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" "")] UNSPEC_FRIN))] - "TARGET_HARD_FLOAT && TARGET_FPRND" + "TARGET_HARD_FLOAT && TARGET_POWER5X" "frin %0,%1" [(set_attr "type" "fp")])