From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 516863858409 for ; Wed, 17 Nov 2021 17:45:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 516863858409 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AHGgR7d006908; Wed, 17 Nov 2021 17:45:07 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cd5gc1a39-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Nov 2021 17:45:06 +0000 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1AHHJTJk015102; Wed, 17 Nov 2021 17:45:06 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cd5gc1a2w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Nov 2021 17:45:06 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1AHHXlvR000976; Wed, 17 Nov 2021 17:45:05 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma02wdc.us.ibm.com with ESMTP id 3ca50bs0ne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Nov 2021 17:45:05 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1AHHj4cM36962592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Nov 2021 17:45:04 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACCCFAE066; Wed, 17 Nov 2021 17:45:04 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2ED40AE06B; Wed, 17 Nov 2021 17:45:04 +0000 (GMT) Received: from li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com (unknown [9.65.92.51]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTPS; Wed, 17 Nov 2021 17:45:04 +0000 (GMT) Date: Wed, 17 Nov 2021 11:45:02 -0600 From: "Paul A. Clarke" To: wschmidt@linux.ibm.com Cc: GCC Patches , Segher Boessenkool , David Edelsohn Subject: Re: [PATCH] rs6000: Better error messages for power8/9-vector builtins Message-ID: <20211117174502.GB7755@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> References: <00061cd6-52e1-457d-5a7b-b5feac1c20f5@linux.ibm.com> <20211117165459.GA7755@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> <1540c206-56b4-3f65-3477-43a7ecaec0c8@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1540c206-56b4-3f65-3477-43a7ecaec0c8@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 X-Proofpoint-GUID: xON7N8KIVrbexhICAAsecjDgSPi7Z2Pb X-Proofpoint-ORIG-GUID: -dOovqcChfjuM4xDOJcIfk5PFPCOc70f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-17_06,2021-11-17_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111170081 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: , X-List-Received-Date: Wed, 17 Nov 2021 17:45:11 -0000 On Wed, Nov 17, 2021 at 11:00:07AM -0600, Bill Schmidt via Gcc-patches wrote: > On 11/17/21 10:54 AM, Paul A. Clarke wrote: > > On Tue, Nov 16, 2021 at 11:12:35AM -0600, Bill Schmidt via Gcc-patches wrote: > >> Hi! During a previous patch review, Segher asked that I provide better > >> messages when builtins are unavailable because they require both a minimum > >> CPU and the enablement of VSX instructions. This patch does just that. > > ... > >> gcc/ > >> * config/rs6000/rs6000-call.c (rs6000_invalid_new_builtin): Change > >> error messages for ENB_P8V and ENB_P9V. > >> --- > >> gcc/config/rs6000/rs6000-call.c | 6 ++++-- > >> 1 file changed, 4 insertions(+), 2 deletions(-) > >> > >> diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c > >> index 85fec80c6d7..035266eb001 100644 > >> --- a/gcc/config/rs6000/rs6000-call.c > >> +++ b/gcc/config/rs6000/rs6000-call.c > >> @@ -11943,7 +11943,8 @@ rs6000_invalid_new_builtin (enum rs6000_gen_builtins fncode) > >> error ("%qs requires the %qs option", name, "-mcpu=power8"); > >> break; > >> case ENB_P8V: > >> - error ("%qs requires the %qs option", name, "-mpower8-vector"); > >> + error ("%qs requires the %qs and %qs options", name, "-mcpu=power8", > >> + "-mvsx"); > > "-mcpu=power8" itself enables "-mvsx", doesn't it? > > Of course, but it can be disabled with -mno-vsx. Then you get this error. > You won't get it unless you deliberately did something strange with the > compile options. > > > > >> break; > >> case ENB_P9: > >> error ("%qs requires the %qs option", name, "-mcpu=power9"); > >> @@ -11953,7 +11954,8 @@ rs6000_invalid_new_builtin (enum rs6000_gen_builtins fncode) > >> name, "-mcpu=power9", "-m64", "-mpowerpc64"); > >> break; > >> case ENB_P9V: > >> - error ("%qs requires the %qs option", name, "-mpower9-vector"); > >> + error ("%qs requires the %qs and %qs options", name, "-mcpu=power9", > >> + "-mvsx"); > > Similarly, "-mcpu=power9" itself enables "-mvsx", doesn't it? > > > > Are you trying to also say "don't use -mno-vsx"? If so, maybe s/and/with/ > > would be slightly less confusing? This is going to be awkward unless it can > > be more precise, like two messages depending on actual context: > > - with "-mcpu=power8 -mno-vsx: "...requires -mvsx". > > - without "-mcpu=power8": "...requires -mcpu=power8". > > This seems like a YMMV situation...I don't see the confusion myself. I guess I'm being pedantic. "requires -mcpu=power8 and -mvsx" is not accurate from a user's point a view, as "-mcpu=power8" is sufficient, since "-mvsx" is enabled when "-mcpu=power8" is specified. The real "requires" is "-mcpu=power8" and no "-mno-vsx". (I'm just picturing myself fumbling around in a Makefile written by somebody else. ;-) It's not a strong objection, since specifying "-mno-vsx" should be uncommon. (Right?) And, specifying "-mcpu=power8 -mvsx" is harmless. PC