From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by sourceware.org (Postfix) with ESMTPS id 14E4B3858CDB for ; Mon, 23 Oct 2023 01:57:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14E4B3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 14E4B3858CDB Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=134.134.136.100 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698026240; cv=pass; b=gvmxK2UN8i7Fe9yRx5Wc+dG7p7+RbivAk0M6f8afivWwE+Ui1KOAn+PSv8aV4bTtuXXd0UfeArJ8elUhJi1yu8GDI+Cvwo2Uhh3qoosrT+B+j8RlJejkBcJmoZE1h9+YZMRFZUuXzdzGIWSw8ltYD64WKtSwCFoRyjn9HkHJ+Ow= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698026240; c=relaxed/simple; bh=V0kB0i+wUAcwB80gOEBIIr956Ft/KvOth6qjmr+ge2k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=d7KoCmiBwljeA/ruftotNWwxZH8xivHHCQQ9wvQjeUfrjhZA9UaVPMBrc7P0ioxfFvxlBN5jjdDbzvjx5soBKULLvYnq4hRpKlyF28Lh8q8YQ/DkVPdMiREsWaa4en5puaafTei5Uv+V5t2U5C6566M2iLOAvj2FnI8irC+LWnE= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698026237; x=1729562237; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=V0kB0i+wUAcwB80gOEBIIr956Ft/KvOth6qjmr+ge2k=; b=h3QiLjYcZEMu193qI+M4QPoL7Tj38NPggiFOT/VTnJk49ynKWULKcvsm Ju3M4thR8DWjrBHvj2DdR6LdDZSDYY+KGl7oZtR8HA8r5FXuHjxj7yVhy y3HAsdMxxGE1l3O4KStA5i3KMVD6YPnf96joAtVsY7ja7MDCveOQWyneX MDY+lhwMmPsMMn1w71/HnsAtav5N29RYGzA3+D/AMR0M+4bI7uuRrtkD1 nLIbAFathf5lovuhSrpKtEGFQ+lT4oBqD5lUsN6FfSnkv0rL9NZVkHnTk NUiPflhz54L7kXlo1qnQQBhC/bOWIJAJ/xgjJClJ2uWLBME9nlOggaKic w==; X-IronPort-AV: E=McAfee;i="6600,9927,10871"; a="453220306" X-IronPort-AV: E=Sophos;i="6.03,244,1694761200"; d="scan'208,217";a="453220306" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2023 18:57:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10871"; a="881601006" X-IronPort-AV: E=Sophos;i="6.03,244,1694761200"; d="scan'208,217";a="881601006" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 22 Oct 2023 18:57:15 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sun, 22 Oct 2023 18:57:15 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sun, 22 Oct 2023 18:57:14 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Sun, 22 Oct 2023 18:57:14 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Sun, 22 Oct 2023 18:57:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QH0BAS6JuYkIzNPTAAMsdOtgatt/ZQYr1t4pKvA/ecA///IebcutZQaxDF/yLpGxKw8K3S+Rztwxr7xqA0Qmi++A/D1pfpV2dYiruwqZQUVdo0gnHkLYNr215riMJnfsVM5s3mL1/hkZxDUlp6ICLspwLL8YLVfORDSt0GLEqPzjK9znnd4O3LMMe+sXE65fQ49FgIiGs7v2WJVN00KwviavRTMbXdYkCiGknZvLbj9TbHIbofwyhkG1KZcyt1FpdqCT/8O+kV0yqWpZm8z+Y5y+bgto9p5iKRjRs+BL8NRV5Q9GjfKEe4ZOTZtCUMpANPAppQhy29QWB8cYhChsWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Of6Oas4BAF3K5Uzrg3lSjPFEyqR6Y6jeLCi64E8R9b4=; b=AtMljRGQpQUsuldHPpKYa9CoSy0EVVTxfYohmwQk8Pnu4MCLG+rJzQpe1U5Pw0MpbWfBVXjT+tReGKMlFozA2JKmkG9tdbmSsKzanrJNAN/ciwP3wFjG13NnewffAT0WKBnM8HAI3AQlisJzdyh/XzU09/cTOjApHRCp3RNxP03942rJZX7J018VJL2KrJJCwJ8+usKqBKpSuDVujnChugOlO2gmSnh6FK6FJDHQNzTbAbVBp5LuHzcZlIPyvRqXzGwiYusozcBg6fOGqyLTvlsrVsOT4yUrqcvT23a7MkzhFoCq5CkeTSy7HbWfVzHaqdz5CsdjlqR3YPvvOXTqmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW5PR11MB5908.namprd11.prod.outlook.com (2603:10b6:303:194::10) by DM4PR11MB6501.namprd11.prod.outlook.com (2603:10b6:8:88::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Mon, 23 Oct 2023 01:57:11 +0000 Received: from MW5PR11MB5908.namprd11.prod.outlook.com ([fe80::4317:53a0:2638:358c]) by MW5PR11MB5908.namprd11.prod.outlook.com ([fe80::4317:53a0:2638:358c%5]) with mapi id 15.20.6907.032; Mon, 23 Oct 2023 01:57:11 +0000 From: "Li, Pan2" To: "juzhe.zhong@rivai.ai" , gcc-patches CC: "Wang, Yanzhang" , kito.cheng Subject: RE: RE: [PATCH v1] RISC-V: Bugfix for merging undefined tmp register in math Thread-Topic: RE: [PATCH v1] RISC-V: Bugfix for merging undefined tmp register in math Thread-Index: AQHaBU/0T6Rcwl+g+U2wB3y9TY6+VbBWmAJvgAAAeOCAAATYE4AAAGbQ Date: Mon, 23 Oct 2023 01:57:10 +0000 Message-ID: References: <20231023012614.1420783-1-pan2.li@intel.com>, <793D907D52B988F6+202310230935099015460@rivai.ai>, <3237E8D30FBBE0C2+202310230944064675840@rivai.ai> In-Reply-To: <3237E8D30FBBE0C2+202310230944064675840@rivai.ai> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW5PR11MB5908:EE_|DM4PR11MB6501:EE_ x-ms-office365-filtering-correlation-id: b0640c28-fe0e-474b-450b-08dbd36b5eec x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rQgK/l1al0XyGolO/LPtgT4wnmlYwTJgl71C7Qh2vXlmDK/T2cNaqZNNpmCSaX/fqGLRig2goYc0uJdgckiXcQ8tLXZ2sSE2yhdwIuMhiNfw2kEoTN7TPbPq3kg2gQf5hBsbS0LA5l3Ck7bD0+znTQ4iws2uOLF5jwtZIFy1aeraRW2orP3gdStXHtQhtiUtvFQg7/WjWo1bIG5RV0KAXYaHITNBxrpSXJadADZwPEwIBRcApFgQ93WE0fTvabKfiJYHIVl1J22cNZvQUTkp9a5PqZdNs1GJ4EWFul01ch7rvHB/eUQxumj0gAFX/Xm05wMszHvA7WCanR6Fp1ztJiTLIky5gdw2MoiXyoeHpwU6gpz1RaFarh6MBoZfL+SWNqmuPmurou0/siIqDTKZOKu/RRbcVtOA6QaS+R31pabI/R1GXAIPriWclHRqf7uK4yiWtmKPYc1/Kqd0dQctwsZ1GjhU/CAroxksi4lAIoU6GAGP8dPk9R/njcmJJ+zbhqJqyrJzgwQbb+nVoWEgJWI68It0CU5TMuS/ycmsjlXawMZQpewi1+Kvh6YdMXKyX8BprRGK6f1Ie2QjY86NHtWAq0R0RZo0Ol4gfcZmr9U= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW5PR11MB5908.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(39860400002)(396003)(346002)(376002)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(38070700009)(7696005)(6506007)(9686003)(53546011)(38100700002)(122000001)(86362001)(82960400001)(33656002)(26005)(2906002)(4001150100001)(71200400001)(478600001)(55016003)(83380400001)(41300700001)(8936002)(8676002)(4326008)(52536014)(5660300002)(66556008)(110136005)(64756008)(66476007)(76116006)(66446008)(66946007)(54906003)(316002)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?ZHh1dXhpZENXaVhqcmlpczJETU1GdUoxbFdGb0llYVMzK1pITVVCQnBP?= =?iso-2022-jp?B?c3g2b3Q0bUZEb3pmKzJBZllTNDNVMUhhRzY0WVpjd0xoS1JTNlRITjNZ?= =?iso-2022-jp?B?UElYZzdBRmlVMld1UDlweDd5QS9GRkZFY3RqZnNFV2dqSytpczRWbUJu?= =?iso-2022-jp?B?M0pwRWFWM0hjZUpTbEFyYkJDQWp5WFozQTdFTStEVHFJOVZEbm9UNnhK?= =?iso-2022-jp?B?MllzaHJ2Z3BTeXVrYUZob1Y0YzJnNlI4dmRkMEMxZkpNUjZnQ2xQdVJk?= =?iso-2022-jp?B?RlY2RzYvUWVOWktSTVFEblc1OU9zejBtUEJkOUExd0ZuMVVadDRkTk9x?= =?iso-2022-jp?B?QXBUQTRsanlaRzdvREhHZmRJTy93MC8yMUxzbG5tYy82NEwzUnRVbWN3?= =?iso-2022-jp?B?b0lHczNsWnlHdUs3NTdFN0ZRbC8rdmowMDNHUkZwWTZFV2NSa3hPdk5a?= =?iso-2022-jp?B?VGUyVXlLZFl2N0JOcFZkOU9VN1d3UDJZamdudk1Dd3JkejJSOG9FUWVi?= =?iso-2022-jp?B?S1dSM3lER0pZWXhteEJMTHNSUlRjWGFLQWNzaHVRb3FESjN4Z2NZMytN?= =?iso-2022-jp?B?RHFPSldEM2lNc09HUGFjck9aL1kzNWdDa1g5NXBhTVE3M0ZxUVA5NVdN?= =?iso-2022-jp?B?TkdScG9CUW1vVjBzWHNneThJbG9Ud1gxVWFJTG44MERsd3JhSW05RVVV?= =?iso-2022-jp?B?OHFEZytZUEJDeHlWaTZDZlA5YjZkL3JjSkxUYUVMS1NsQVBHMDFnOE56?= =?iso-2022-jp?B?UlA1VkJpc3BwRUNUMFNkRklma2hSdkYwSFlWMjZCNmoyRTR3WnJ6OUVR?= =?iso-2022-jp?B?WmF4SzRTNC9wZEV6Y0tXRUplSHF3UURiaVk0WTFKS2M5ZmpXSWlpRzNi?= =?iso-2022-jp?B?eExDUG1HaE0zWllHNUdTT3ZlVjlXcjQvc3R4MXArRlpCNE1hTFpNK3dD?= =?iso-2022-jp?B?SEwvQ3o4ZERjVXZxZHMyKzZwSmVHOUt3R1lGbnhodnlKdmpUNys5RXVa?= =?iso-2022-jp?B?eldITTRXckUvZjVBR2JFeEFYOXRrUXV1b0YrK3padEdjT1JuYzJjRVU2?= =?iso-2022-jp?B?ekV0dDZlVVlUbElKaTBDbm5YRGd2NU9tZmJIaHBuajZiMTZJckJGNTE0?= =?iso-2022-jp?B?VmNsZW1hWW8vbjVLUnp2dWduRXhMRXorbjJUb1E2clZvbmdvTFMyR3p0?= =?iso-2022-jp?B?ZHB1TVVmZnVkTlpJTTBTU0RwS0FET0d4dGxUUUdPRUkvUVh3aDR4dFFh?= =?iso-2022-jp?B?V1VNU2NhMUtWYnZ0MWU5R21HZC82RUdoMFBlUlhzM1AxYjhQdzluWVF5?= =?iso-2022-jp?B?aUUxYU5UZEtoaWtkSlRHNHZkNEJlMnR6WVAzRGNEZUxaejlEbkNHTm9m?= =?iso-2022-jp?B?Z1lsV2IxaEZNbFlndnBrM2kxSmdJNE9ES2tzTStIUlNCRkZGTUwrS1lV?= =?iso-2022-jp?B?ck9FclBJN1RsMENmREVXSVN1KzBCb3ZXTG1oeWhWV0Q1QVhvQUVkU1g5?= =?iso-2022-jp?B?UG9VK2hhQnNjZHMwWkJaNTJmaHlpeklqZEJCMll5RlVtdTJpN3NiQ2Vh?= =?iso-2022-jp?B?amVmSVpoRTBVVjNvQk45ZTlBelJUZXlVcWIwZW1Wbk00aXlDYTh3WXNX?= =?iso-2022-jp?B?YzQzTG9PVkxSc0FxSUd1d2xZUnVuRm5UeUcyZzI0RHRqU2RzMnNuK0ZC?= =?iso-2022-jp?B?dVlnMHN5VTlxam5ZSFo3MWpaVGgxdGhPK2FZUTBidkRJQUdndUxoeSt3?= =?iso-2022-jp?B?YytjNm5JRHg1VzU0RE5oU2ovNzVsVFZ2ZTlLclVDeW41QTBaaGkxTTVK?= =?iso-2022-jp?B?ckNhVFgxTUNENDRmbU5ueWhxUllmQjhqbXBCU1RURTZKeDlLbnBaRjhs?= =?iso-2022-jp?B?OHByM1d1Sm9sOWhaK3dlN2lRN0dhRldDQytKQ0w5Z1h2bXpiOUZpNG9D?= =?iso-2022-jp?B?NHNhVWNCY3AySXRzcFRiaHRBSk5uSXRwLzBqQ0RhMEVmSDlLT2VWMzA0?= =?iso-2022-jp?B?cUtyR1p3aVdWeFU5UkZtSzA2TzB6SkFxWXZtZUJHalRJWlFuZGtXRHdX?= =?iso-2022-jp?B?ZVdjSTd3RStmdHlGcXhQQWdWbmVKZUtKbGtoYjYvN2d2Q2V6Z2ZPb2Zs?= =?iso-2022-jp?B?L0duaXNpUXQreFFQT2VZTXNTNW1UWmV5K2lxUDdiOGpBZEk5RVBXOFlP?= =?iso-2022-jp?B?YWRXTzJrRDNaZk4wSS9STDhJMUZEYU9kbXoyR0JZTHkvaDV6djl0dU9m?= =?iso-2022-jp?B?REFFRXVwSTdrcGM3Y3BDc2hieEdiZ2tEbz0=?= Content-Type: multipart/alternative; boundary="_000_MW5PR11MB5908F422E68370407DC0A2F2A9D8AMW5PR11MB5908namp_" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5908.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0640c28-fe0e-474b-450b-08dbd36b5eec X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2023 01:57:11.0027 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kEsFkwaLmH8ukPcYS8H57rAguwu40m2d/v/bDhEqijx4BCkndkAytL5obGAjlT4f1/akYZmhGyNS5Sxt7piNNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6501 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,SPF_HELO_NONE,SPF_NONE,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 List-Id: --_000_MW5PR11MB5908F422E68370407DC0A2F2A9D8AMW5PR11MB5908namp_ Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Committed, thanks Juzhe. Pan From: juzhe.zhong@rivai.ai Sent: Monday, October 23, 2023 9:44 AM To: Li, Pan2 ; gcc-patches Cc: Wang, Yanzhang ; kito.cheng Subject: Re: RE: [PATCH v1] RISC-V: Bugfix for merging undefined tmp regist= er in math OK=1B$B!#=1B(B LGTM=1B$B!#=1B(B ________________________________ juzhe.zhong@rivai.ai From: Li, Pan2 Date: 2023-10-23 09:42 To: juzhe.zhong@rivai.ai; gcc-patches CC: Wang, Yanzhang; kito.cheng Subject: RE: [PATCH v1] RISC-V: Bugfix for merging undefined tmp register i= n math Yes, it is required by the second cvt. The unmasked elements keep the origi= nal values. Pan From: juzhe.zhong@rivai.ai > Sent: Monday, October 23, 2023 9:35 AM To: Li, Pan2 >; gcc-patches > Cc: Li, Pan2 >; Wang, Yanzhang = >; kito.cheng > Subject: Re: [PATCH v1] RISC-V: Bugfix for merging undefined tmp register i= n math UNARY_OP_TAMU_FRM_DYN =3D UNARY_OP_TAMU | FRM_DYN_P, UNARY_OP_TAMU_FRM_RUP =3D UNARY_OP_TAMU | FRM_RUP_P, UNARY_OP_TAMU_FRM_RDN =3D UNARY_OP_TAMU | FRM_RDN_P, Are they still necessary ? ________________________________ juzhe.zhong@rivai.ai From: pan2.li Date: 2023-10-23 09:26 To: gcc-patches CC: juzhe.zhong; pan2.li; yanzhang.wang; kito.cheng Subject: [PATCH v1] RISC-V: Bugfix for merging undefined tmp register in ma= th From: Pan Li > For math function autovec, there will be one step like rtx tmp =3D gen_reg_rtx (vec_int_mode); emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMU_FRM_DYN, vec_fp_mode); The MU will leave the tmp (aka dest register) register unmasked elements unchanged and it is undefined here. This patch would like to adjust the MU to MA. gcc/ChangeLog: * config/riscv/riscv-protos.h (enum insn_type): Add new type values. * config/riscv/riscv-v.cc (emit_vec_cvt_x_f): Add undef merge operand handling. (expand_vec_ceil): Take MA instead of MU for tmp register. (expand_vec_floor): Ditto. (expand_vec_nearbyint): Ditto. (expand_vec_rint): Ditto. (expand_vec_round): Ditto. (expand_vec_roundeven): Ditto. Signed-off-by: Pan Li > --- gcc/config/riscv/riscv-protos.h | 5 +++++ gcc/config/riscv/riscv-v.cc | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-proto= s.h index f7a9a02f1f9..5dc97c2adc0 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -306,6 +306,11 @@ enum insn_type : unsigned int UNARY_OP_FRM_RMM =3D UNARY_OP | FRM_RMM_P, UNARY_OP_FRM_RUP =3D UNARY_OP | FRM_RUP_P, UNARY_OP_FRM_RDN =3D UNARY_OP | FRM_RDN_P, + UNARY_OP_TAMA_FRM_DYN =3D UNARY_OP_TAMA | FRM_DYN_P, + UNARY_OP_TAMA_FRM_RUP =3D UNARY_OP_TAMA | FRM_RUP_P, + UNARY_OP_TAMA_FRM_RDN =3D UNARY_OP_TAMA | FRM_RDN_P, + UNARY_OP_TAMA_FRM_RMM =3D UNARY_OP_TAMA | FRM_RMM_P, + UNARY_OP_TAMA_FRM_RNE =3D UNARY_OP_TAMA | FRM_RNE_P, UNARY_OP_TAMU_FRM_DYN =3D UNARY_OP_TAMU | FRM_DYN_P, UNARY_OP_TAMU_FRM_RUP =3D UNARY_OP_TAMU | FRM_RUP_P, UNARY_OP_TAMU_FRM_RDN =3D UNARY_OP_TAMU | FRM_RDN_P, diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc index 383af55fe3a..91ad6a61fa8 100644 --- a/gcc/config/riscv/riscv-v.cc +++ b/gcc/config/riscv/riscv-v.cc @@ -4108,10 +4108,18 @@ static void emit_vec_cvt_x_f (rtx op_dest, rtx op_src, rtx mask, insn_type type, machine_mode vec_mode) { - rtx cvt_x_ops[] =3D {op_dest, mask, op_dest, op_src}; insn_code icode =3D code_for_pred_fcvt_x_f (UNSPEC_VFCVT, vec_mode); - emit_vlmax_insn (icode, type, cvt_x_ops); + if (type & USE_VUNDEF_MERGE_P) + { + rtx cvt_x_ops[] =3D {op_dest, mask, op_src}; + emit_vlmax_insn (icode, type, cvt_x_ops); + } + else + { + rtx cvt_x_ops[] =3D {op_dest, mask, op_dest, op_src}; + emit_vlmax_insn (icode, type, cvt_x_ops); + } } static void @@ -4157,7 +4165,7 @@ expand_vec_ceil (rtx op_0, rtx op_1, machine_mode vec= _fp_mode, /* Step-3: Convert to integer on mask, with rounding up (aka ceil). */ rtx tmp =3D gen_reg_rtx (vec_int_mode); - emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMU_FRM_RUP, vec_fp_mode); + emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMA_FRM_RUP, vec_fp_mode); /* Step-4: Convert to floating-point on mask for the final result. To avoid unnecessary frm register access, we use RUP here and it will @@ -4182,7 +4190,7 @@ expand_vec_floor (rtx op_0, rtx op_1, machine_mode ve= c_fp_mode, /* Step-3: Convert to integer on mask, with rounding down (aka floor). = */ rtx tmp =3D gen_reg_rtx (vec_int_mode); - emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMU_FRM_RDN, vec_fp_mode); + emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMA_FRM_RDN, vec_fp_mode); /* Step-4: Convert to floating-point on mask for the floor result. */ emit_vec_cvt_f_x (op_0, tmp, mask, UNARY_OP_TAMU_FRM_RDN, vec_fp_mode); @@ -4208,7 +4216,7 @@ expand_vec_nearbyint (rtx op_0, rtx op_1, machine_mod= e vec_fp_mode, /* Step-4: Convert to integer on mask, with rounding down (aka nearbyint= ). */ rtx tmp =3D gen_reg_rtx (vec_int_mode); - emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMU_FRM_DYN, vec_fp_mode); + emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMA_FRM_DYN, vec_fp_mode); /* Step-5: Convert to floating-point on mask for the nearbyint result. = */ emit_vec_cvt_f_x (op_0, tmp, mask, UNARY_OP_TAMU_FRM_DYN, vec_fp_mode); @@ -4233,7 +4241,7 @@ expand_vec_rint (rtx op_0, rtx op_1, machine_mode vec= _fp_mode, /* Step-3: Convert to integer on mask, with dyn rounding (aka rint). */ rtx tmp =3D gen_reg_rtx (vec_int_mode); - emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMU_FRM_DYN, vec_fp_mode); + emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMA_FRM_DYN, vec_fp_mode); /* Step-4: Convert to floating-point on mask for the rint result. */ emit_vec_cvt_f_x (op_0, tmp, mask, UNARY_OP_TAMU_FRM_DYN, vec_fp_mode); @@ -4255,7 +4263,7 @@ expand_vec_round (rtx op_0, rtx op_1, machine_mode ve= c_fp_mode, /* Step-3: Convert to integer on mask, rounding to nearest (aka round). = */ rtx tmp =3D gen_reg_rtx (vec_int_mode); - emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMU_FRM_RMM, vec_fp_mode); + emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMA_FRM_RMM, vec_fp_mode); /* Step-4: Convert to floating-point on mask for the round result. */ emit_vec_cvt_f_x (op_0, tmp, mask, UNARY_OP_TAMU_FRM_RMM, vec_fp_mode); @@ -4299,7 +4307,7 @@ expand_vec_roundeven (rtx op_0, rtx op_1, machine_mod= e vec_fp_mode, /* Step-3: Convert to integer on mask, rounding to nearest, ties to even= . */ rtx tmp =3D gen_reg_rtx (vec_int_mode); - emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMU_FRM_RNE, vec_fp_mode); + emit_vec_cvt_x_f (tmp, op_1, mask, UNARY_OP_TAMA_FRM_RNE, vec_fp_mode); /* Step-4: Convert to floating-point on mask for the rint result. */ emit_vec_cvt_f_x (op_0, tmp, mask, UNARY_OP_TAMU_FRM_RNE, vec_fp_mode); -- 2.34.1 --_000_MW5PR11MB5908F422E68370407DC0A2F2A9D8AMW5PR11MB5908namp_--