From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by sourceware.org (Postfix) with ESMTPS id 416E83858D37 for ; Sat, 7 Oct 2023 10:17:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 416E83858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696673871; x=1728209871; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=8SCAJR5hGyasRXnbpqB22Zbc/9f6bNlmlvDNj7dPrjs=; b=eMBhIfUjzqlEAevOQ0XGKPWFJ89GF/ti4Ebws0cgXwiQB4L0WDvqsi3D NegRCw9euzEpbRLfthz+gdEPe4tcQX8TlkTGlrPvEZG29F372FBWZQ2B0 x9lEiTKkC5rWC7jFjigluSzJDPdBYTlGcX2mm2hC6lEPu0R9GWG1SIkMz thhipfCHEg8XGOMJ/ztcTdE9L2myTcnHVUiP1jD8R7Q3zo+36sOnepoNf XA2aCjIV+Wla08IHI4MfcVWMNRHJlKt6+J7YRK8mTymKgKPldtbpJ22d4 WyGbQ/CYUBSMU7s/D7YpXinxqySBoFbiB8CWrlXEFW3N7WRbwp1EP9D6t Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="364197734" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208,217";a="364197734" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2023 03:17:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="756167857" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208,217";a="756167857" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 07 Oct 2023 03:17:49 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sat, 7 Oct 2023 03:17:48 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Sat, 7 Oct 2023 03:17:48 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.45) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Sat, 7 Oct 2023 03:17:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A74oI2q3yRjAHv87KSTcMWIHDNpnjoTIrr3ZUr751NmAvQ2Me3yziw8y1iqZTsETJcKgsodd3tGdpwG+/RXQng34Uzm8gGSW9NSeKRnzao7B2OAHbatMv9DbeIX0fTOW79LWiGe5ZHo2yJM7nxuQr9MNguqiE1PhsPT5J0OLVmVV4C5ruZZ+a/c4x2C++2iPMfL6kZNM/j6D/CxwFfhmTqwHgEQQSH22OTeltEpWWBQ3rH8usOMKXhnm4d40R2CNb7JkGlyZiTQggYTS2nbg0n/Bf+785D8YoyyblGtvK4uxrvU4ym1GxBFF24rIazobSKR1AUSvKWhv1DXy0LPXzg== 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=LvVmNXKABfgyYCnmKGrG0Gi4sIJOr94vL3hRlYjNAn8=; b=PGimTX1hz00lAEOn5k0rIcZxFx+RrfYJR1UdvaPq6yOm0ABgcW8ZlHVo9RFEFq09bHwlLNgCR2jEXX1waG1XPFNEkshFZgOaz/0cFRI83V3xWFrIeRHkx8ArhHdus5v1+XBpVajK5GfiJnX7U87aFiO50VknGdYvYgyub11ddulXEGY/AKuTuU84+fgpsQt4kO0CdCtP24XQ4S68N+XXr5Pw/AMwEMKvCGG3B+/UdPsFV4DnokYFbRQjNNsjHCHSdXNwginz9MCtS2suKQnDt38wippetLuFj7RxLVG5oWD/ikBtrLhqSa8XTDHSEsdhTqkKsVi3DBEsPlEMeHtbsA== 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 IA0PR11MB7815.namprd11.prod.outlook.com (2603:10b6:208:404::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.42; Sat, 7 Oct 2023 10:17:44 +0000 Received: from MW5PR11MB5908.namprd11.prod.outlook.com ([fe80::e7c7:6f52:d067:cdf1]) by MW5PR11MB5908.namprd11.prod.outlook.com ([fe80::e7c7:6f52:d067:cdf1%6]) with mapi id 15.20.6838.033; Sat, 7 Oct 2023 10:17:44 +0000 From: "Li, Pan2" To: "juzhe.zhong@rivai.ai" , gcc-patches , "Li, Pan2" CC: "Wang, Yanzhang" , kito.cheng Subject: RE: Re: [PATCH v1] RISC-V: Add more run test for FP rounding autovec Thread-Topic: Re: [PATCH v1] RISC-V: Add more run test for FP rounding autovec Thread-Index: AQHZ+OcW7+Gx9GqQfEa68p283AgiIrA+GEsIgAAEmBA= Date: Sat, 7 Oct 2023 10:17:44 +0000 Message-ID: References: <20231007062530.20048-1-pan2.li@intel.com>, <202310071749154172509@rivai.ai> <7D2DF93E099595D8+2023100717592091909612@rivai.ai> In-Reply-To: <7D2DF93E099595D8+2023100717592091909612@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_|IA0PR11MB7815:EE_ x-ms-office365-filtering-correlation-id: a4c2fd70-6cc4-4f3e-3e88-08dbc71ea5a3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: l2YOVqTReeUDGTKkfa71+wjK0sD3BLTS9IXSi7bD8GnYO9S7Wfu6aeYsx834Rc2fPQ+JWJjdHbuyhNb+MUgTdIC7edwfN1FhxZxA7DfzP/Y+nD34I8lzE9LizfD7ianEsEXLGY+shlOmEe+8O4wb3v6sDP25SDrntWldcnM8BIvCyrEsszSjS4VzpWxpPqfKWm4+cty4iwCva5e98oDPgqzekw0LfO1/bkxSqFq83bZO5uglqb1NxzU5weY/3sZEkxnhriOm3nVkrkFNTAzNwV9m0EeYN5pMcM9uKKoK8fy9HJJPseWy6jJSBmjOal8WCrrI30YhL5iS8k945UXosGGFkxgOTV85fiCV/ohSVYkcRrAgD74YXKZcTZKbqtdaikOTLIc4b7d9C6BKVpZXRJwjgy9KY0gLS2YfIaVWlfzvR3zme3XDZ3ndbwudWrQhj+8IlnoplY0Wz+FP3Oy+OsR0A2xjVlEaUVFuIuk61A4lqN/RsDnppePvfRjnvdzhru0B0bi5+BRIxzQ+dx44F6S8cQ/CTOnjBjDwOFdrnDgf1XlcVht+CXkqbrhXY33Pv3r5fg1AWzknLPS8VHX8zZyI3/ebf3PFCsbS3U5zW6aZG+VR1dD011z1M4EaNtNWxKXzigfw/+kdHB+jLHjz4g== 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)(376002)(366004)(346002)(136003)(39860400002)(396003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(84970400001)(53546011)(9686003)(86362001)(55016003)(38100700002)(38070700005)(33656002)(166002)(82960400001)(122000001)(26005)(2906002)(30864003)(83380400001)(966005)(71200400001)(7696005)(478600001)(6506007)(8676002)(4326008)(8936002)(66476007)(52536014)(316002)(41300700001)(5660300002)(66946007)(54906003)(66556008)(66446008)(64756008)(76116006)(110136005)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7J345iMJrqyZbD0iJ50adgi41/7Je/bMExafgdiidfYhk8F5NOpocWpf1Ygy?= =?us-ascii?Q?2mwmmcYkn9KiljtkEZGDziFjDK14uqhtYbTTNjmLlQGC8VZISM7bKco9NxuA?= =?us-ascii?Q?bH6LuPq9HjpIAx0iwMUbJYI9uj4yf4a3FrEqdf4nSgOwF3kyxfFCm/TG6cd8?= =?us-ascii?Q?QO42xaHvDKbfocynUBAXcePClicw3dNUuGK6OwxOPAdo15XC+GLBQh2N91YI?= =?us-ascii?Q?J+g1VLcuNw5ZMnVX7LPAsa9tjSdzSMBXVSj6KMODUkoLV34X0mUtJZRdwWqA?= =?us-ascii?Q?l/1v5doF1q6dTFH4XS+JHWavxarZPr9C8wotQ3uDwt4yrMXUjE27iUT/1dbK?= =?us-ascii?Q?p0h3nIwxwYXQg0qt9Xye1kCR2a97aM0Mp3mVmXLlFrXbsJTODj9Y1qCogV05?= =?us-ascii?Q?yjxSpQF0jr3vy3JJLWliHoJTGXjhKaB4hyNnmH6K4tZ2OC7AJbYRtgOK4dJf?= =?us-ascii?Q?uBZkidydp9Rk2TC7OTGp3gr47oaizIk0CX6E11bCxj22mJIP0B9OiLShEiBO?= =?us-ascii?Q?Vm+2sM/29i8RTzUs3tKVjUBN9pyRfIJ+G2E0b0a4uMc/hnYDtwz4a7BeXV0f?= =?us-ascii?Q?Xnj7UWmwLawU5rdI6R8F49a4vlJ8RKEMXTDl0/0LLoCHGHvmKF6eOdPdijqi?= =?us-ascii?Q?a0WIP863X03ytNgCVODJsOTkC4kIbrVlWAEaxIKwlEw22eyALu0u7+woHSjT?= =?us-ascii?Q?XPnrvOq/drblL5oopDxaUkmFEC34n/bjhLeFLVDL4GRqz9c2EccEAW2PSssX?= =?us-ascii?Q?oW+LjXJh3+3JaV0J15IJRdpEA7s0s05Jna/V/Fq7WKLky4fdL77WMXK0g61P?= =?us-ascii?Q?wUrsK9/uY/EV9Ng4ujQKRi/wOiI7tEadRq3lJVVrPtx//8nopXi1fViqouxZ?= =?us-ascii?Q?gBVHn+vd9wBlcoOKNmUysEAFHoKfaHh/poZ6WtrX1gjw+LxtDNWoQ7WyEDsq?= =?us-ascii?Q?2HBJLTG72iUaDmINHxUUbO1OKAcQQeTfWnOHgTxUYZazvHDsg2ztCnFq5RdW?= =?us-ascii?Q?k4e0rWiI+MKnG/GnLAp1+aQOlJBW39rsPQDQ8rrS/b6sU9skCTU7Qgqile3T?= =?us-ascii?Q?GXvsLLoUBRPf2NWoUMa6+YNDk9JkqUXLAqL9+/4F4N0IQDJmoJrItDcL3tOf?= =?us-ascii?Q?2ps3GlgpXgvZkHpVr5Kf2pYJts84gKNjzgA7FqHkfQVuAmfaMWp9ya204OzX?= =?us-ascii?Q?OE1grjUC0cI9cArx11zMVN9McD731TtkJybU83YxDudtNg+gFBd3NDCDDJ8b?= =?us-ascii?Q?cjfMurT5ZazCQ8DK82PDxPmzBVmQQWOxlG4IqJpnJbAapoZ8JuoMLdd9YZK3?= =?us-ascii?Q?0P0F28vBzRrp3mDChhrM/c27jnFuHVEmKmLI7eqwqCDyp+i8KjEowjy2AJ9y?= =?us-ascii?Q?QHDugTK5ipFPHnxGY+HT6TiOc+5jHiFxA9V+Vdex8+YtK1X56WLaPwIefDIy?= =?us-ascii?Q?3HQZsxsSr9OD4dxUNZz8EfxxYwEWOZ5kWpa36ydgU2PK2GrVjljacDkqwfXY?= =?us-ascii?Q?pk69UwL0FucyFWTaDytv24CtKnzekK6gZfYjt/EP/1NA05C2uk2hXKbuDXQL?= =?us-ascii?Q?4MWEcCx93x/Ag6nqIzQ=3D?= Content-Type: multipart/alternative; boundary="_000_MW5PR11MB590861B871CBAB7AB2F0BE6DA9C8AMW5PR11MB5908namp_" 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: a4c2fd70-6cc4-4f3e-3e88-08dbc71ea5a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2023 10:17:44.4622 (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: BEh2sbrTnMQzW+ZSuuCdQGffWp8iBCORcWEF2TM+Gkd6xhH09DDDV9t0/FGcD4mvnmJLNv4yulreJ3qT4LO9Ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7815 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,KAM_SHORT,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_MW5PR11MB590861B871CBAB7AB2F0BE6DA9C8AMW5PR11MB5908namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sure and thanks Juzhe, will re-add these test cases when zfa check is ready. Pan From: juzhe.zhong@rivai.ai Sent: Saturday, October 7, 2023 5:59 PM To: Li, Pan2 ; gcc-patches Cc: Li, Pan2 ; Wang, Yanzhang ;= kito.cheng Subject: Re: Re: [PATCH v1] RISC-V: Add more run test for FP rounding autov= ec Also I have reverted your commit: https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommit;h=3D066a43ce72ab6559ba14af9= 628df19daa0b85cdf Plz test the patch and verify it doesn't cause any FAILs if the toolchain d= oesn't have "zvfh_zfh". ________________________________ juzhe.zhong@rivai.ai From: juzhe.zhong@rivai.ai Date: 2023-10-07 17:49 To: pan2.li; gcc-patches CC: pan2.li; yanzhang.wang; kito.cheng Subject: Re: [PATCH v1] RISC-V: Add more run test for FP rounding autovec These testcases cause multiple FAILs: I think you should /* { dg-do run { target { riscv_v && riscv_zvfh_hw && riscv_zfh_ok } } } */ ________________________________ juzhe.zhong@rivai.ai From: pan2.li Date: 2023-10-07 14:25 To: gcc-patches CC: juzhe.zhong; pan2.li; yanzhang.wang; kito.cheng Subject: [PATCH v1] RISC-V: Add more run test for FP rounding autovec From: Pan Li > For _Float16 types, add run test for: * ceil * floor * nearbyint * rint * round * roundeven * trunc For float and double, add run test for: * roundeven The zfa extension is required for these run test cases, the simulation target_board may look like below for rv64. target_board=3D"riscv-sim/-march=3Drv64gcv_zfa_zfh/-mabi=3Dlp64d/-mcmodel= =3Dmedlow" gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/rvv.exp: Add zfa for building. * gcc.target/riscv/rvv/autovec/unop/math-ceil-run-0.c: New test. * gcc.target/riscv/rvv/autovec/unop/math-floor-run-0.c: New test. * gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-0.c: New test. * gcc.target/riscv/rvv/autovec/unop/math-rint-run-0.c: New test. * gcc.target/riscv/rvv/autovec/unop/math-round-run-0.c: New test. * gcc.target/riscv/rvv/autovec/unop/math-roundeven-run-0.c: New test. * gcc.target/riscv/rvv/autovec/unop/math-roundeven-run-1.c: New test. * gcc.target/riscv/rvv/autovec/unop/math-roundeven-run-2.c: New test. * gcc.target/riscv/rvv/autovec/unop/math-trunc-run-0.c: New test. Signed-off-by: Pan Li > --- .../riscv/rvv/autovec/unop/math-ceil-run-0.c | 39 +++++++++++++++ .../riscv/rvv/autovec/unop/math-floor-run-0.c | 39 +++++++++++++++ .../rvv/autovec/unop/math-nearbyint-run-0.c | 48 +++++++++++++++++++ .../riscv/rvv/autovec/unop/math-rint-run-0.c | 48 +++++++++++++++++++ .../riscv/rvv/autovec/unop/math-round-run-0.c | 39 +++++++++++++++ .../rvv/autovec/unop/math-roundeven-run-0.c | 39 +++++++++++++++ .../rvv/autovec/unop/math-roundeven-run-1.c | 39 +++++++++++++++ .../rvv/autovec/unop/math-roundeven-run-2.c | 39 +++++++++++++++ .../riscv/rvv/autovec/unop/math-trunc-run-0.c | 39 +++++++++++++++ gcc/testsuite/gcc.target/riscv/rvv/rvv.exp | 4 +- 10 files changed, 371 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-cei= l-run-0.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-flo= or-run-0.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nea= rbyint-run-0.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rin= t-run-0.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rou= nd-run-0.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rou= ndeven-run-0.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rou= ndeven-run-1.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rou= ndeven-run-2.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-tru= nc-run-0.c diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-= 0.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-0.c new file mode 100644 index 00000000000..70cba3602bb --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-0.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +_Float16 in[ARRAY_SIZE]; +_Float16 out[ARRAY_SIZE]; +_Float16 ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (_Float16, __builtin_ceilf16) +TEST_ASSERT (_Float16) + +TEST_INIT (_Float16, 1.2, 2.0, 1) +TEST_INIT (_Float16, -1.2, -1.0, 2) +TEST_INIT (_Float16, 3.0, 3.0, 3) +TEST_INIT (_Float16, 1023.5, 1024.0, 4) +TEST_INIT (_Float16, 1024.0, 1024.0, 5) +TEST_INIT (_Float16, 0.0, 0.0, 6) +TEST_INIT (_Float16, -0.0, -0.0, 7) +TEST_INIT (_Float16, -1023.5, -1023.0, 8) +TEST_INIT (_Float16, -1024.0, -1024.0, 9) + +int +main () +{ + RUN_TEST (_Float16, 1, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 2, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 3, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 4, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 5, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 6, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 7, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 8, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 9, __builtin_ceilf16, in, out, ref, ARRAY_SIZE); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run= -0.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-0.c new file mode 100644 index 00000000000..c542278c1f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-0.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +_Float16 in[ARRAY_SIZE]; +_Float16 out[ARRAY_SIZE]; +_Float16 ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (_Float16, __builtin_floorf16) +TEST_ASSERT (_Float16) + +TEST_INIT (_Float16, 1.2, 1.0, 1) +TEST_INIT (_Float16, -1.2, -2.0, 2) +TEST_INIT (_Float16, 3.0, 3.0, 3) +TEST_INIT (_Float16, 1023.5, 1023.0, 4) +TEST_INIT (_Float16, 8388609.0, 8388609.0, 5) +TEST_INIT (_Float16, 0.0, 0.0, 6) +TEST_INIT (_Float16, -0.0, -0.0, 7) +TEST_INIT (_Float16, -1023.5, -1024.0, 8) +TEST_INIT (_Float16, -1024.0, -1024.0, 9) + +int +main () +{ + RUN_TEST (_Float16, 1, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 2, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 3, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 4, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 5, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 6, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 7, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 8, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 9, __builtin_floorf16, in, out, ref, ARRAY_SIZE); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint= -run-0.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-r= un-0.c new file mode 100644 index 00000000000..5339fb9c03b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-0.c @@ -0,0 +1,48 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +_Float16 in[ARRAY_SIZE]; +_Float16 out[ARRAY_SIZE]; +_Float16 ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (_Float16, __builtin_nearbyintf16) +TEST_ASSERT (_Float16) + +TEST_INIT (_Float16, 1.2, 1.0, 1) +TEST_INIT (_Float16, -1.2, -1.0, 2) +TEST_INIT (_Float16, 3.0, 3.0, 3) +TEST_INIT (_Float16, 1023.5, 1023.0, 4) +TEST_INIT (_Float16, 1024.0, 1024.0, 5) +TEST_INIT (_Float16, 0.0, 0.0, 6) +TEST_INIT (_Float16, -0.0, -0.0, 7) +TEST_INIT (_Float16, -1023.5, -1023.0, 8) +TEST_INIT (_Float16, -1024.0, -1024.0, 9) + +int +main () +{ + unsigned fflags_before =3D get_fflags (); + + set_rm (FRM_RTZ); + + RUN_TEST (_Float16, 1, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 2, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 3, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 4, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 5, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 6, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 7, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 8, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 9, __builtin_nearbyintf16, in, out, ref, ARRAY_SIZE); + + unsigned fflags_after =3D get_fflags (); + + if (fflags_before !=3D fflags_after) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-= 0.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-0.c new file mode 100644 index 00000000000..5667ee111d3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-0.c @@ -0,0 +1,48 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +_Float16 in[ARRAY_SIZE]; +_Float16 out[ARRAY_SIZE]; +_Float16 ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (_Float16, __builtin_rintf) +TEST_ASSERT (_Float16) + +TEST_INIT (_Float16, 1.2, 1.0, 1) +TEST_INIT (_Float16, -1.2, -1.0, 2) +TEST_INIT (_Float16, 3.0, 3.0, 3) +TEST_INIT (_Float16, 1023.5, 1023.0, 4) +TEST_INIT (_Float16, 1024.0, 1024.0, 5) +TEST_INIT (_Float16, 0.0, 0.0, 6) +TEST_INIT (_Float16, -0.0, -0.0, 7) +TEST_INIT (_Float16, -1023.5, -1023.0, 8) +TEST_INIT (_Float16, -1024.0, -1024.0, 9) + +int +main () +{ + unsigned fflags_before =3D get_fflags (); + + set_rm (FRM_RTZ); + + RUN_TEST (_Float16, 1, __builtin_rintf, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 2, __builtin_rintf, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 3, __builtin_rintf, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 4, __builtin_rintf, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 5, __builtin_rintf, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 6, __builtin_rintf, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 7, __builtin_rintf, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 8, __builtin_rintf, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 9, __builtin_rintf, in, out, ref, ARRAY_SIZE); + + unsigned fflags_after =3D get_fflags (); + + if (fflags_before =3D=3D fflags_after) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run= -0.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-0.c new file mode 100644 index 00000000000..f0fc51970be --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-0.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +_Float16 in[ARRAY_SIZE]; +_Float16 out[ARRAY_SIZE]; +_Float16 ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (_Float16, __builtin_roundf16) +TEST_ASSERT (_Float16) + +TEST_INIT (_Float16, 1.2, 1.0, 1) +TEST_INIT (_Float16, -1.6, -2.0, 2) +TEST_INIT (_Float16, 3.0, 3.0, 3) +TEST_INIT (_Float16, 1023.5, 1024.0, 4) +TEST_INIT (_Float16, 1024.0, 1024.0, 5) +TEST_INIT (_Float16, 0.0, 0.0, 6) +TEST_INIT (_Float16, -0.0, -0.0, 7) +TEST_INIT (_Float16, -1023.5, -1024.0, 8) +TEST_INIT (_Float16, -1024.0, -1024.0, 9) + +int +main () +{ + RUN_TEST (_Float16, 1, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 2, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 3, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 4, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 5, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 6, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 7, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 8, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 9, __builtin_roundf16, in, out, ref, ARRAY_SIZE); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven= -run-0.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven-r= un-0.c new file mode 100644 index 00000000000..9ef39993ca4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven-run-0.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +_Float16 in[ARRAY_SIZE]; +_Float16 out[ARRAY_SIZE]; +_Float16 ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (_Float16, __builtin_roundevenf16) +TEST_ASSERT (_Float16) + +TEST_INIT (_Float16, 1.2, 1.0, 1) +TEST_INIT (_Float16, -1.5, -2.0, 2) +TEST_INIT (_Float16, 3.0, 3.0, 3) +TEST_INIT (_Float16, 1023.5, 1024.0, 4) +TEST_INIT (_Float16, 1024.0, 1024.0, 5) +TEST_INIT (_Float16, 0.0, 0.0, 6) +TEST_INIT (_Float16, -0.0, -0.0, 7) +TEST_INIT (_Float16, -1023.5, -1024.0, 8) +TEST_INIT (_Float16, -1024.0, -1024.0, 9) + +int +main () +{ + RUN_TEST (_Float16, 1, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 2, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 3, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 4, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 5, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 6, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 7, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 8, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 9, __builtin_roundevenf16, in, out, ref, ARRAY_SIZE); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven= -run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven-r= un-1.c new file mode 100644 index 00000000000..b1918bad45e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven-run-1.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +float in[ARRAY_SIZE]; +float out[ARRAY_SIZE]; +float ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (float, __builtin_roundf) +TEST_ASSERT (float) + +TEST_INIT (float, 1.2, 1.0, 1) +TEST_INIT (float, -1.5, -2.0, 2) +TEST_INIT (float, 3.0, 3.0, 3) +TEST_INIT (float, 8388607.5, 8388608.0, 4) +TEST_INIT (float, 8388609.0, 8388609.0, 5) +TEST_INIT (float, 0.0, 0.0, 6) +TEST_INIT (float, -0.0, -0.0, 7) +TEST_INIT (float, -8388607.5, -8388608.0, 8) +TEST_INIT (float, -8388608.0, -8388608.0, 9) + +int +main () +{ + RUN_TEST (float, 1, __builtin_roundf, in, out, ref, ARRAY_SIZE); + RUN_TEST (float, 2, __builtin_roundf, in, out, ref, ARRAY_SIZE); + RUN_TEST (float, 3, __builtin_roundf, in, out, ref, ARRAY_SIZE); + RUN_TEST (float, 4, __builtin_roundf, in, out, ref, ARRAY_SIZE); + RUN_TEST (float, 5, __builtin_roundf, in, out, ref, ARRAY_SIZE); + RUN_TEST (float, 6, __builtin_roundf, in, out, ref, ARRAY_SIZE); + RUN_TEST (float, 7, __builtin_roundf, in, out, ref, ARRAY_SIZE); + RUN_TEST (float, 8, __builtin_roundf, in, out, ref, ARRAY_SIZE); + RUN_TEST (float, 9, __builtin_roundf, in, out, ref, ARRAY_SIZE); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven= -run-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven-r= un-2.c new file mode 100644 index 00000000000..9f037b4c908 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-roundeven-run-2.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +double in[ARRAY_SIZE]; +double out[ARRAY_SIZE]; +double ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (double, __builtin_round) +TEST_ASSERT (double) + +TEST_INIT (double, 1.2, 1.0, 1) +TEST_INIT (double, -1.5, -2.0, 2) +TEST_INIT (double, 3.0, 3.0, 3) +TEST_INIT (double, 4503599627370495.5, 4503599627370496.0, 4) +TEST_INIT (double, 4503599627370497.0, 4503599627370497.0, 5) +TEST_INIT (double, 0.0, 0.0, 6) +TEST_INIT (double, -0.0, -0.0, 7) +TEST_INIT (double, -4503599627370495.5, -4503599627370496.0, 8) +TEST_INIT (double, -4503599627370496.0, -4503599627370496.0, 9) + +int +main () +{ + RUN_TEST (double, 1, __builtin_round, in, out, ref, ARRAY_SIZE); + RUN_TEST (double, 2, __builtin_round, in, out, ref, ARRAY_SIZE); + RUN_TEST (double, 3, __builtin_round, in, out, ref, ARRAY_SIZE); + RUN_TEST (double, 4, __builtin_round, in, out, ref, ARRAY_SIZE); + RUN_TEST (double, 5, __builtin_round, in, out, ref, ARRAY_SIZE); + RUN_TEST (double, 6, __builtin_round, in, out, ref, ARRAY_SIZE); + RUN_TEST (double, 7, __builtin_round, in, out, ref, ARRAY_SIZE); + RUN_TEST (double, 8, __builtin_round, in, out, ref, ARRAY_SIZE); + RUN_TEST (double, 9, __builtin_round, in, out, ref, ARRAY_SIZE); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run= -0.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-0.c new file mode 100644 index 00000000000..340acb5994c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-0.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=3Dc99 -O3 -ftree-vectorize -fno-vect-cost= -model -ffast-math" } */ + +#include "test-math.h" + +#define ARRAY_SIZE 128 + +_Float16 in[ARRAY_SIZE]; +_Float16 out[ARRAY_SIZE]; +_Float16 ref[ARRAY_SIZE]; + +TEST_UNARY_CALL (_Float16, __builtin_truncf16) +TEST_ASSERT (_Float16) + +TEST_INIT (_Float16, 1.2, 1.0, 1) +TEST_INIT (_Float16, -1.2, -1.0, 2) +TEST_INIT (_Float16, 3.0, 3.0, 3) +TEST_INIT (_Float16, 1023.5, 1023.0, 4) +TEST_INIT (_Float16, 1024.0, 1024.0, 5) +TEST_INIT (_Float16, 0.0, 0.0, 6) +TEST_INIT (_Float16, -0.0, -0.0, 7) +TEST_INIT (_Float16, -1023.5, -1023.0, 8) +TEST_INIT (_Float16, -1024.0, -1024.0, 9) + +int +main () +{ + RUN_TEST (_Float16, 1, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 2, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 3, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 4, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 5, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 6, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 7, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 8, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + RUN_TEST (_Float16, 9, __builtin_truncf16, in, out, ref, ARRAY_SIZE); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/rvv.exp b/gcc/testsuite/gcc= .target/riscv/rvv/rvv.exp index ff76e17d0e6..87d3e8f9a06 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/rvv.exp +++ b/gcc/testsuite/gcc.target/riscv/rvv/rvv.exp @@ -30,10 +30,10 @@ if ![info exists DEFAULT_CFLAGS] then { set DEFAULT_CFLAGS " -ansi -pedantic-errors" } -set gcc_march "rv64gcv_zfh" +set gcc_march "rv64gcv_zfa_zfh" set gcc_mabi "lp64d" if [istarget riscv32-*-*] then { - set gcc_march "rv32gcv_zfh" + set gcc_march "rv32gcv_zfa_zfh" set gcc_mabi "ilp32d" } -- 2.34.1 --_000_MW5PR11MB590861B871CBAB7AB2F0BE6DA9C8AMW5PR11MB5908namp_--