From patchwork Mon Jun 13 16:31:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Greenhalgh X-Patchwork-Id: 69897 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1629754qgf; Mon, 13 Jun 2016 09:32:19 -0700 (PDT) X-Received: by 10.66.149.66 with SMTP id ty2mr22525689pab.153.1465835539465; Mon, 13 Jun 2016 09:32:19 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id t6si32949759pfb.72.2016.06.13.09.32.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jun 2016 09:32:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-429704-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-429704-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-429704-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=YvJBBPh6xN+1YgU6e5lg7WkyoLnjjBk036CNkQdIVPsZE8afTY TTxs93GAAY0crYGpaVLydsWI4EgLSQtv08bFwQS9GkiH8OhDhGrEB+RXcC7UuhMw eE8FZIcLu6o3+Y0JTDmopxWqgCLxX0nzVfwAAe2ZARG+6vo40DjM0t5Mk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=ykb0iG3Se4QgnFhYSdgXjeNsMUA=; b=j2n8I7qt75PUkztcgcyI VkLawMXG9GueqetruNWAAAeaACmx2ismnjBQ1ckfQGaoe3oSivYzPRR3VWp3/ivA t/Mn2/qltPiIUOxrbg6Rxm7x6QFroSgmHDsVwKo29jElBuhlyojYjZuJeY6AJN68 cQCo37n/3IHxcrJH6bh3QIs= Received: (qmail 47892 invoked by alias); 13 Jun 2016 16:32:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 47881 invoked by uid 89); 13 Jun 2016 16:32:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=1, 23, smoke X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Jun 2016 16:31:52 +0000 Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1lrp0016.outbound.protection.outlook.com [213.199.154.16]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-41-E8b4_aOGQUaYNQW_TGptKA-1; Mon, 13 Jun 2016 17:31:46 +0100 Received: from DB6PR0801CA0035.eurprd08.prod.outlook.com (10.165.173.173) by DB5PR0801MB1493.eurprd08.prod.outlook.com (10.167.229.139) with Microsoft SMTP Server (TLS) id 15.1.517.8; Mon, 13 Jun 2016 16:31:45 +0000 Received: from DB3FFO11FD040.protection.gbl (2a01:111:f400:7e04::185) by DB6PR0801CA0035.outlook.office365.com (2603:10a6:4:2::45) with Microsoft SMTP Server (TLS) id 15.1.517.8 via Frontend Transport; Mon, 13 Jun 2016 16:31:45 +0000 Received: from nebula.arm.com (217.140.96.140) by DB3FFO11FD040.mail.protection.outlook.com (10.47.217.71) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Mon, 13 Jun 2016 16:31:44 +0000 Received: from e107456-lin.cambridge.arm.com (10.1.2.79) by mail.arm.com (10.1.105.66) with Microsoft SMTP Server id 14.3.294.0; Mon, 13 Jun 2016 17:31:42 +0100 From: James Greenhalgh To: CC: , , Subject: [Patch AArch64] Add some more missing intrinsics Date: Mon, 13 Jun 2016 17:31:40 +0100 Message-ID: <1465835500-11451-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(377424004)(199003)(54534003)(5000100001)(36756003)(15975445007)(4610100001)(110136002)(2351001)(229853001)(246002)(512874002)(33646002)(450100001)(586003)(568964002)(189998001)(2476003)(6806005)(8676002)(356003)(77096005)(5890100001)(5008740100001)(2906002)(4326007)(104016004)(92566002)(8936002)(50226002)(106466001)(19580395003)(19580405001)(87936001)(50986999)(11100500001)(84326002)(86362001)(26826002)(5003600100002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR0801MB1493; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD040; 1:Tmv38AVoBAh8ZWbTt1IWswkig4ne//GuBg/5mm10zQCj4eLBSj+eKnexbpFnz7+fFWlfDkBVjCFa23VyeKxhWKndKeYgbOOfiKd6qxM69K1DGPm8tXLQicYp9cqXfawDhy0tSJnQncQgKQ7nO5/snXRQaOzEEcZOYTtJnqCC2fHSrmUcw0mqZN0NftjzMxs0Tgx/AhIoy3WHxbWdbCfy0M28tEsK1/+npC7vNBlY+T+shpTU/ePuJsnBzdop1So56bK/ixp/ngqHLkwc29o/ELdT8v0UQU/adjYejnNwfXX9dWFua+WgZeSyYN5oxKVQxD6rNuU2Dix/DFQ8kwYzQBas8mfWl8oJTJVnFpbsr7IQeE+MEMRkDN/VzqLVaSBqebHqEor4fDX5IfELV4a5eI3KDYGl+3Sm+ejL/18/bbSAg449hYY8qJhrvntIfBXZvx8+CRRxfkTmnBP29IHhBUEpP9bd/S6NUTQXcLV4YZroK9gITItFnN12VEIyo425 X-MS-Office365-Filtering-Correlation-Id: ba1e7675-23fe-4aea-319c-08d393a83578 X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1493; 2:ZcS+jng0Okh65Jws7JRy7h1DE9lI5Y5Nnc07LExXBaPddCuXCzzjX6CooqQ6Q4giEsf9GOTfRXe+255kba/VfhRlQ1asfErSaDxSfdu+UerHxa+zNJIxeJ9nNuysFTRcmMBz0WPJU9MlULpjji8sFdOeUBSex7qiZ/2qI94J1rYIbhMnIf+hQ1WwjSW7EDFQ; 3:zZQ4sJtFHNRFIa9AkTAQqZ5iJHnC//l6onPsnDKzDMT3oOp7NPHxjxH8bNcPEUGtSJNHoW44ifEl67Y+i2N3kPSOjag36tOgbkKPP9jqgI8gilYOR93Tnz+PMH16k6y3xqUjPC2rKeionw+A17u6Nm/hzjITPSezzbV2KU+VgBXPbeLs2121ZUWAmB412x2YGFIXoOvGXvWcouURnVXIfJZtl+wG6DpizU7OQew5/0SpYM7MKlNCdmnP7rRpUrVNpkp1WrR5lvC6GOLJpGUHsA== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB5PR0801MB1493; X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1493; 25:S9wQd3j/tq88AHID5Pfl6cLE0DlH3C+dCudNyROIVKwS/HiqeY6mYlLFJe3MddL4oMfLsAnDJVgipUH2GnMIrt/5I4cWaluuaIBVr0jM0U38fwJMGgWaeT3GNxY1kZcmC9XDHaqPc5sr08+gkKc0KFVfy1qR2ELnHDkjLhCYnXPlLc8B4//ZPzhfZNZyleHRPih3RpOjQPtRn0HDJOo930HvwYgBK+vlldm+tSajuUhEAsHlDCAu6hTEzvxoO9kNDg/ZjKxpeHd+8GzkBTzVigDQR6omHWQ7aiGdGagiNje1AbwUu7Lkcpm+qI9nZZyz8Q3KZKjmB97ZUOBt/nSSuKDZkpOxPJr3ApCmk9smZV5GlzGmsTcqBPh6ZYBbgd6eTWQReB5B9lWO4MDSx4/xPSToyUbhUsvYyB0SwOaKaGvfxGdCZtJjA9l+pFPfhysTmDGBh5oExcCrowsh8HqgklgKk+MUOYBtemvZLrz9JgO6ZpuUndF7+ZrJpQYtVTHH; 20:3qEWwhdCN/GXWD1fhwJ5lvaLP7c6x3mrTIPlOiSL3BuOQHJDrHqmGGChp28sA0q7KB2OaBXv6D0dsGnSEZpVkktpTjsyBAhsb6ogRgH+X+gaqy+CTgwuny8u8E+BM6kdcMUISvLNVTe6frMmuY2NxTdjjzp4t2Xv+Ijhb6N07VGERzejwSIZuYdH5QC0ZQbWb5+xofDkxi9UNZT2rt17N82bYL6fuQ2S2KkT8OYq/WD9GgGLHS7g1pS/+QDOzA2T NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(22074186197030)(183786458502308); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415321)(601004)(2401047)(13013025)(13023025)(13024025)(13020025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:DB5PR0801MB1493; BCL:0; PCL:0; RULEID:; SRVR:DB5PR0801MB1493; X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1493; 4:oo1q/FgvQn1eGndFUACOiOBoE1C5aE/z8n0fWahPWOLoXxLAP6yBq0/gfGOHNHzrrJjxkTZTUWRGeDPbfsAoMP3WrlRHJzP7OK/UQ+KDsqJ/Yb3WHjnes6qGWIqu4SQ3SBdmeSmN19zntaw+pZiGD8vfPhKq8FmCpX3ZffjpS6ITAfZQFdyjEDCFiVowYzJ6/hmI7XEKNStpOp9lVXvt7Olpsf+oC6w5LYcc+UhmPGaSbotw7zdPHSC048J39PnkIhkFz9apErRw5CfkFYA4qF0TQ9f7U0nV9TZ7QWEmEyfjcoUBikTE/acTMUPJ2WKb6bmaFReN+E+EkpNjsS8ZASGLI6g1Iw+pT4XVSWAdhArGvI+Z6T2Ux62rXPkujgx7+Mxr0mWbtv1NOAhrM6ESQQXlb1hQbG7COxXcljPqsx9mIA7763FxTPqT0LZvpuyblrQfKq2+ZeUaqLH9S0AKlLQOrQVRpZ1Mgv6/pLVRLYSeNoeyVxvtetMdJpne11xHGEz/ahybHVJGECJRNlSe9dsAuJs0ACU2RYJVC4ufqcI+yIj/TAGRc9cYi0I9AfS5NHZb7yEpyXT6LzbjhylOn3coQGdqWXMjHkgj58scySc= X-Forefront-PRVS: 0972DEC1D9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR0801MB1493; 23:A7WVn7luWgWrpj2VlijUn3K8XtHIx6o+tnnteV3?= =?us-ascii?Q?nQlpTfaRRPRTB9MHwIa1NUY8HJaRMhHtEpiBARfz5cKSpbnkwVoLNWc7cVWC?= =?us-ascii?Q?pOX5A70HEvlMAtPnPQGu5lpvRICA6aDrvwUSspcOZskMtF5OesgfXO7INf+o?= =?us-ascii?Q?4rVdhDfulQgEOEPVgIB7WnU6McXbVIfwNYogY1KYoiG6oE7+M6U2aikF00qB?= =?us-ascii?Q?zFztV6VsY7xHYlgJzbKrshUJlobRq08SMIPt2b3Lm2dL0YLchRRNlViSWVwE?= =?us-ascii?Q?WyWnuN0up1dg1MnUof6Krq4KdhYqm9b5DDrifQPnrXa74H0BFsTgJBywXmSt?= =?us-ascii?Q?NfRq1q/8ffrVJI5GvswLPTVxdabd/JOx1iuuL0mV7lcFyelLDe54A5/fglSQ?= =?us-ascii?Q?p0iZIzFo2Ft+H2n3LhZyzAo9cXkUNoBtoeQjwQcKA2SGVHHjgYHT6cXoAZ6z?= =?us-ascii?Q?q/aB5PAzNLKTGVC0ikpJ5XZ2hP+LxwuTASdrKMCegCBVHdX+Um+ys70F3kKQ?= =?us-ascii?Q?eQNwm5gG970YzlP860iSsUiuvZvgyGNJb3lJVeMRRoYhw8uv9vke9MseCmDh?= =?us-ascii?Q?j0yI2nqadpPa3U7xyQC94Njx2TfsOrsBZuqUGYHaddAfCjB4gytro7FLKE3J?= =?us-ascii?Q?kZq07MDrMaWTpsmz2lud1k5nBuY08sC1YtLXnzVYDeoHYuDQGCiVCqbrJRk1?= =?us-ascii?Q?6DhDQKaMZW2wYOeCccWlL0ec33aqSwzDiJtaJYpKJ5QHnjrItBAsdp/d8582?= =?us-ascii?Q?OBArTW+udMiqI8NbPuDiI9RQkbwcX10s0u6g2kkJXQJ2wnDiAwPkIlbHnrIb?= =?us-ascii?Q?8f2f0MG7e2aqvQRmZOxcEfVmSdZl70lG47chB5EqdEt70TZTK/IOpvUBCP8r?= =?us-ascii?Q?yRRnC3DmQmrDNnfFnLtKsk2EbTdy1SLAC5znnlmzj10v7Eq2yzpMWWIj9bLR?= =?us-ascii?Q?IE3uDn7zDjx+yAGiOH6SKnGhynjl2uqfhQXTqgC+ZEHKWmbevG1i52qIpbpk?= =?us-ascii?Q?AOM75a3dv8VDCR0BTU5fH1RA1u05cvZMv5Q81JyYdaXF9a0jIBP2CRaJwkvY?= =?us-ascii?Q?kvIblop8VNYwXiXYNNTEVTvzJvsEz1J6zWiYLfrO+8td3QkJm7XF592k90Pk?= =?us-ascii?Q?mdk8V2a478s1KSwr5rMhFCjC7RakmK7rwDPP2GCEBhGAFJ79fOqeaSg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1493; 6:5cFeYvl/2BPaeVTSfP51TkZPklJlhPxLquknosd+2ntbo2sE9Qm0LAiwvWBG7ItJPJg4cTHVPJvRk3RJg5lazSDUee6aqFvNdv0X/9kryeA2UWaiYxabew4mx7pH4qMuYge80mKrc/JtTGcPI6c5xDJ1lN7rZNfw/V0Hy0OGPEQMAwn0g8TZ85osII8xsUex8xUn4BDCLjLQ3eKUxGTimJp/eqEB6bBrtylZrCmxtDdtmmoN5olDiPKh6/EUxbBTyY/P1BHpLH3R92Zyxa0JR9lBQQIhGHwKj1w3CjWio6kudm8xZrazbYW2Mk12zQzKljIOQ/PRr+ybPdCYcmZmNg==; 5:YVK9qSPuS21QuSVVpxGn1qMJWmYceW41pUZa1kpiXZFKlYWstEW8oI8nUj1DIKfJvw9bXIK8M4WTXptEF/t9YgJ6NEBgTS/9giBa+XuIKgnQdIvskXSS9BTGuwYmnvJuRrMgB0NMgN5P9k/f0xy6gA==; 24:xvWOeNqjSy/rbGlY0vhte9ZGof5ll0Pgq4of/oQje4vbFch9gkbmaC8R/5UMSodCQUdFG3AVSFG31c+5NsQ9gAM4XEceJkanJ+7jTTh9LoY=; 7:QIGkZPcygH+/8aVZz62tFXnODLNJTS2IlI4kbYClZWGuFysc9BJesYAomVbTZtZtk6nd5hF5tTkEzqf//nYA4+8bu0UXoYdvutWxxfKa+AbDgJVHO4mEe4LT57jejdFhcB7dnnf8CSt3azFZhYQo0VmNqSWkLT1B9nymG1qsbvmQ0TWDXzcR3Bi2itc82cwIA0VmbpcLK0RbdLcwKqPYWICybNRB1FGCgi0yFpvt0cg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB5PR0801MB1493; 20:BGh5gVQl+ql9P16k82WXatEzkoFkBwxN2Rr8+TAKiFTiMfEbJZhSFfVen5dtnsaHoeLX0gSx8X3PuJef3RmfJgOt+tCYoSIIOT6zBjcSofPm2htfARQjFu5LdN0+knpSxq5pv/PTxpTFDsdLXt57gSW9rkzVGP8GqYt7G2+iIkI= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2016 16:31:44.7734 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0801MB1493 X-MC-Unique: E8b4_aOGQUaYNQW_TGptKA-1 X-IsSubscribed: yes Hi, Inspired by Jiong's recent work, here are some more missing intrinsics, and a smoke test for each of them. This patch covers: vcvt_n_f64_s64 vcvt_n_f64_u64 vcvt_n_s64_f64 vcvt_n_u64_f64 vcvt_f64_s64 vrecpe_f64 vcvt_f64_u64 vrecps_f64 Tested on aarch64-none-elf, and on an internal testsuite for Neon intrinsics. Note that the new tests will ICE without the fixups in https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00805.html OK? Thanks, James --- gcc/ChangeLog 2016-06-10 James Greenhalgh * config/aarch64/arm_neon.h (vcvt_n_f64_s64): New. (vcvt_n_f64_u64): Likewise. (vcvt_n_s64_f64): Likewise. (vcvt_n_u64_f64): Likewise. (vcvt_f64_s64): Likewise. (vrecpe_f64): Likewise. (vcvt_f64_u64): Likewise. (vrecps_f64): Likewise. gcc/testsuite/ChangeLog 2016-06-10 James Greenhalgh * gcc.target/aarch64/vcvt_f64_1.c: New. * gcc.target/aarch64/vcvt_n_f64_1.c: New. * gcc.target/aarch64/vrecp_f64_1.c: New. diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index f70b6d3..2f90938 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -12447,6 +12447,20 @@ vcvt_n_f32_u32 (uint32x2_t __a, const int __b) return __builtin_aarch64_ucvtfv2si_sus (__a, __b); } +__extension__ static __inline float64x1_t __attribute__ ((__always_inline__)) +vcvt_n_f64_s64 (int64x1_t __a, const int __b) +{ + return (float64x1_t) + { __builtin_aarch64_scvtfdi (vget_lane_s64 (__a, 0), __b) }; +} + +__extension__ static __inline float64x1_t __attribute__ ((__always_inline__)) +vcvt_n_f64_u64 (uint64x1_t __a, const int __b) +{ + return (float64x1_t) + { __builtin_aarch64_ucvtfdi_sus (vget_lane_u64 (__a, 0), __b) }; +} + __extension__ static __inline float32x4_t __attribute__ ((__always_inline__)) vcvtq_n_f32_s32 (int32x4_t __a, const int __b) { @@ -12509,6 +12523,20 @@ vcvt_n_u32_f32 (float32x2_t __a, const int __b) return __builtin_aarch64_fcvtzuv2sf_uss (__a, __b); } +__extension__ static __inline int64x1_t __attribute__ ((__always_inline__)) +vcvt_n_s64_f64 (float64x1_t __a, const int __b) +{ + return (int64x1_t) + { __builtin_aarch64_fcvtzsdf (vget_lane_f64 (__a, 0), __b) }; +} + +__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__)) +vcvt_n_u64_f64 (float64x1_t __a, const int __b) +{ + return (uint64x1_t) + { __builtin_aarch64_fcvtzudf_uss (vget_lane_f64 (__a, 0), __b) }; +} + __extension__ static __inline int32x4_t __attribute__ ((__always_inline__)) vcvtq_n_s32_f32 (float32x4_t __a, const int __b) { @@ -12571,6 +12599,18 @@ vcvt_f32_u32 (uint32x2_t __a) return __builtin_aarch64_floatunsv2siv2sf ((int32x2_t) __a); } +__extension__ static __inline float64x1_t __attribute__ ((__always_inline__)) +vcvt_f64_s64 (int64x1_t __a) +{ + return (float64x1_t) { vget_lane_s64 (__a, 0) }; +} + +__extension__ static __inline float64x1_t __attribute__ ((__always_inline__)) +vcvt_f64_u64 (uint64x1_t __a) +{ + return (float64x1_t) { vget_lane_u64 (__a, 0) }; +} + __extension__ static __inline float32x4_t __attribute__ ((__always_inline__)) vcvtq_f32_s32 (int32x4_t __a) { @@ -20659,6 +20699,12 @@ vrecpe_f32 (float32x2_t __a) return __builtin_aarch64_frecpev2sf (__a); } +__extension__ static __inline float64x1_t __attribute__ ((__always_inline__)) +vrecpe_f64 (float64x1_t __a) +{ + return (float64x1_t) { vrecped_f64 (vget_lane_f64 (__a, 0)) }; +} + __extension__ static __inline float32x4_t __attribute__ ((__always_inline__)) vrecpeq_f32 (float32x4_t __a) { @@ -20691,6 +20737,13 @@ vrecps_f32 (float32x2_t __a, float32x2_t __b) return __builtin_aarch64_frecpsv2sf (__a, __b); } +__extension__ static __inline float64x1_t __attribute__ ((__always_inline__)) +vrecps_f64 (float64x1_t __a, float64x1_t __b) +{ + return (float64x1_t) { vrecpsd_f64 (vget_lane_f64 (__a, 0), + vget_lane_f64 (__b, 0)) }; +} + __extension__ static __inline float32x4_t __attribute__ ((__always_inline__)) vrecpsq_f32 (float32x4_t __a, float32x4_t __b) { diff --git a/gcc/testsuite/gcc.target/aarch64/vcvt_f64_1.c b/gcc/testsuite/gcc.target/aarch64/vcvt_f64_1.c new file mode 100644 index 0000000..b7ee7af --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vcvt_f64_1.c @@ -0,0 +1,48 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include "arm_neon.h" + +/* For each of these intrinsics, we're mapping to a simple C cast. + While the compiler has some freedom in terms of choice of instruction, + we'd hope that for this simple case it would always pick the single + instruction form given in these tests. Anything else is likely a + regression, so check for an exact instruction pattern and + register allocation decision. */ + +/* Test that if we have a value already in Advanced-SIMD registers, we use + the scalar register forms. */ + +float64x1_t +test_vcvt_f64_s64_fpr (int64x1_t a) +{ + /* { dg-final { scan-assembler-times "scvtf\td0, d0" 1 } } */ + return vcvt_f64_s64 (a); +} + +float64x1_t +test_vcvt_f64_u64_fpr (uint64x1_t a) +{ + /* { dg-final { scan-assembler-times "ucvtf\td0, d0" 1 } } */ + return vcvt_f64_u64 (a); +} + +/* Test that if we have an integer constructor, we use the general-purpose + register forms for scvtf and ucvtf. */ + +float64x1_t +test_vcvt_f64_s64_gpr (int64_t a) +{ + /* { dg-final { scan-assembler-times "scvtf\td0, x0" 1 } } */ + int64x1_t b = (int64x1_t) { a }; + return vcvt_f64_s64 (b); +} + +float64x1_t +test_vcvt_f64_u64_gpr (uint64_t a) +{ + /* { dg-final { scan-assembler-times "ucvtf\td0, x0" 1 } } */ + uint64x1_t b = (uint64x1_t) { a }; + return vcvt_f64_u64 (b); +} + diff --git a/gcc/testsuite/gcc.target/aarch64/vcvt_n_f64_1.c b/gcc/testsuite/gcc.target/aarch64/vcvt_n_f64_1.c new file mode 100644 index 0000000..6fe16de --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vcvt_n_f64_1.c @@ -0,0 +1,80 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include "arm_neon.h" + +/* For each of these intrinsics, we map directly to an unspec in RTL. + We're just using the argument directly and returning the result, so we + can precisely specify the exact instruction pattern and register + allocations we expect. */ + +/* Test that if we have a value already in Advanced-SIMD registers, we use + the scalar register forms. */ + +float64x1_t +test_vcvt_n_f64_s64_fpr (int64x1_t a) +{ + /* { dg-final { scan-assembler-times "scvtf\td0, d0, #3" 1 } } */ + return vcvt_n_f64_s64 (a, 3); +} + +float64x1_t +test_vcvt_n_f64_u64_fpr (uint64x1_t a) +{ + /* { dg-final { scan-assembler-times "ucvtf\td0, d0, #3" 1 } } */ + return vcvt_n_f64_u64 (a, 3); +} + +/* Test that if we have an integer constructor, we use the general-purpose + register forms for scvtf and ucvtf. */ + +float64x1_t +test_vcvt_n_f64_s64_gpr (int64_t a) +{ + /* { dg-final { scan-assembler-times "scvtf\td0, x0, #3" 1 } } */ + int64x1_t b = (int64x1_t) { a }; + return vcvt_n_f64_s64 (b, 3); +} + +float64x1_t +test_vcvt_n_f64_u64_gpr (uint64_t a) +{ + /* { dg-final { scan-assembler-times "ucvtf\td0, x0, #3" 1 } } */ + uint64x1_t b = (uint64x1_t) { a }; + return vcvt_n_f64_u64 (b, 3); +} + +/* Test that a normal return through the Advanced-SIMD registers uses + the scalar register form. */ + +int64x1_t +test_vcvt_n_s64_f64_fpr (float64x1_t a) +{ + /* { dg-final { scan-assembler-times "fcvtzs\td0, d0, #3" 1 } } */ + return vcvt_n_s64_f64 (a, 3); +} + +uint64x1_t +test_vcvt_n_u64_f64_fpr (float64x1_t a) +{ + /* { dg-final { scan-assembler-times "fcvtzu\td0, d0, #3" 1 } } */ + return vcvt_n_u64_f64 (a, 3); +} + +/* Test that a lane extracted return as a plain [u]int64_t uses + the general-register forms of fcvtzs and fcvtzu. */ + +int64_t +test_vcvt_n_s64_f64_gpr (float64x1_t a) +{ + /* { dg-final { scan-assembler-times "fcvtzs\tx0, d0, #3" 1 } } */ + return vget_lane_s64 (vcvt_n_s64_f64 (a, 3), 0); +} + +uint64_t +test_vcvt_n_u64_f64_gpr (float64x1_t a) +{ + /* { dg-final { scan-assembler-times "fcvtzu\tx0, d0, #3" 1 } } */ + return vget_lane_u64 (vcvt_n_u64_f64 (a, 3), 0); +} + diff --git a/gcc/testsuite/gcc.target/aarch64/vrecp_f64_1.c b/gcc/testsuite/gcc.target/aarch64/vrecp_f64_1.c new file mode 100644 index 0000000..c61b2f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vrecp_f64_1.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include "arm_neon.h" + +/* For each of these intrinsics, we're mapping to an unspec in RTL. + We therefore know the expected instruction choice and register pattern, + so we can look for it exactly. */ + +float64x1_t +test_vrecpe_f64 (float64x1_t a) +{ + /* { dg-final { scan-assembler-times "frecpe\td0, d0" 1 } } */ + return vrecpe_f64 (a); +} + +float64x1_t +test_vrecps_f64 (float64x1_t a, float64x1_t b) +{ + /* { dg-final { scan-assembler-times "frecps\td0, d0, d1" 1 } } */ + return vrecps_f64 (a, b); +} +