From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13071 invoked by alias); 30 Oct 2019 17:20:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10000 invoked by uid 89); 30 Oct 2019 17:20:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: EUR04-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr70050.outbound.protection.outlook.com (HELO EUR04-HE1-obe.outbound.protection.outlook.com) (40.107.7.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Oct 2019 17:20:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xhtbWW8T/N3WBTF6a4bYE7jPMzagT5vM7sNuGXl9a+c=; b=pciXIYJ33ufsP+y9IrRyfdN83uqET4j6XI/eItESFPauKtxaOV1a9fDIDy9fgexxoVOCO9S9OGalV7LWglHDs9+lUF2P4vEKUlkwxZ2IDxP/d62Kz7hneO9Q3SpOFgtzJcH2tJgQkXRm5FMke4cww5KJ0Gg0xvOdfsR9HDIpdvw= Received: from VI1PR08CA0258.eurprd08.prod.outlook.com (2603:10a6:803:dc::31) by VI1PR08MB3600.eurprd08.prod.outlook.com (2603:10a6:803:85::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.17; Wed, 30 Oct 2019 17:20:19 +0000 Received: from AM5EUR03FT035.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::201) by VI1PR08CA0258.outlook.office365.com (2603:10a6:803:dc::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2408.20 via Frontend Transport; Wed, 30 Oct 2019 17:20:19 +0000 Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT035.mail.protection.outlook.com (10.152.16.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2387.20 via Frontend Transport; Wed, 30 Oct 2019 17:20:19 +0000 Received: ("Tessian outbound 3fba803f6da3:v33"); Wed, 30 Oct 2019 17:20:18 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 250f73e8b6728184 X-CR-MTA-TID: 64aa7808 Received: from a4e75c51d775.2 (cr-mta-lb-1.cr-mta-net [104.47.13.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3F494EFD-7126-4DC8-991E-2C98CCAA86E9.1; Wed, 30 Oct 2019 17:20:13 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a4e75c51d775.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 30 Oct 2019 17:20:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R/OdRHfWaTEusq8zdWaEjl5Fwm5xcT0reUFi/4uu2eyfVRX6iUkLnlmC+kY2rrwos26nAlRkVuBk3ynNSiKWEuS63rhupKVcjT17G4liRefCQT8tJ3IU8QmExz6W7/qSZ7qgFFSjPMSag1E7X6WOEgYNDNYAIpxLEfIToJWQECYArHBfMA0STicluMoO3SpQ43gFQ6hcb29XIb6eCjVJJ4lnxUpcMJxmGB6M8SneA59Y1C64FdcJWgWkSlZSYrdnEnGOOh/aP9MLVDbPXL4hjCUV9I/WpxR7ekBzBF3SlGWRRJank1NxjjyBs5Za8MTRbgasSsJiGjkXAnVNqPyICA== 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-SenderADCheck; bh=xhtbWW8T/N3WBTF6a4bYE7jPMzagT5vM7sNuGXl9a+c=; b=OtGYKgNO5lVdrZXHb5SnZ/KVDoddmLc43NXO5rLHb8m3Z1fbc9xulvxqPWok0OBfQ4vyYvulmVgVSYelBs5mVFBKrnyxHfFfHj/l8mDoE9HwAtB9xBMCKgtcN9R1c2ZZlu8EaMjXa1GtqwK1zFKMolJ3ZR8Sxq4EYAPGAMQcgQNasJrKApvR08+UBHVu1tHFJtXVPz9USCbIVyeCRg3bD0TOnf+bNhDFyZ/W1lRieHxSBzCrCD7ZPCUDowEahjDMfxlOYlwUAuiuCGhjkCLsAGUH2hfILYOf/aSE6JxMOmyNQ5EgTSaJnVVbk25Ccv4HNM+Q7ayueB4S8d2ipSq5aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xhtbWW8T/N3WBTF6a4bYE7jPMzagT5vM7sNuGXl9a+c=; b=pciXIYJ33ufsP+y9IrRyfdN83uqET4j6XI/eItESFPauKtxaOV1a9fDIDy9fgexxoVOCO9S9OGalV7LWglHDs9+lUF2P4vEKUlkwxZ2IDxP/d62Kz7hneO9Q3SpOFgtzJcH2tJgQkXRm5FMke4cww5KJ0Gg0xvOdfsR9HDIpdvw= Received: from DB7PR08MB3292.eurprd08.prod.outlook.com (52.134.111.30) by DB7PR08MB3194.eurprd08.prod.outlook.com (52.135.130.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.28; Wed, 30 Oct 2019 17:20:11 +0000 Received: from DB7PR08MB3292.eurprd08.prod.outlook.com ([fe80::bc69:7a3a:d0f6:b45d]) by DB7PR08MB3292.eurprd08.prod.outlook.com ([fe80::bc69:7a3a:d0f6:b45d%7]) with mapi id 15.20.2387.028; Wed, 30 Oct 2019 17:20:11 +0000 From: Szabolcs Nagy To: Jakub Jelinek CC: nd , Richard Biener , Uros Bizjak , Tom de Vries , Martin Jambor , "gcc-patches@gcc.gnu.org" , Segher Boessenkool , Richard Earnshaw , Andreas Krebbel , Francesco Petrogalli , Richard Sandiford Subject: Re: [RFC PATCH] targetm.omp.device_kind_arch_isa and OpenMP declare variant kind/arch/isa handling Date: Wed, 30 Oct 2019 17:40:00 -0000 Message-ID: References: <20191029171531.GI4650@tucnak> <20191030144824.GY4650@tucnak> In-Reply-To: <20191030144824.GY4650@tucnak> user-agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; X-MS-Exchange-PUrlCount: 1 x-ms-exchange-transport-forked: True x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4636009)(376002)(346002)(396003)(39860400002)(136003)(366004)(189003)(199004)(51914003)(305945005)(2906002)(8936002)(561944003)(7736002)(66446008)(66556008)(58126008)(66946007)(316002)(66476007)(64756008)(8676002)(71200400001)(966005)(14454004)(71190400001)(54906003)(3846002)(478600001)(6116002)(36756003)(6916009)(81156014)(81166006)(476003)(6436002)(76176011)(31686004)(386003)(4326008)(229853002)(53546011)(6506007)(25786009)(26005)(2616005)(52116002)(86362001)(6246003)(65956001)(65806001)(66066001)(6306002)(6512007)(186003)(11346002)(486006)(44832011)(6486002)(14444005)(256004)(446003)(31696002)(99286004)(102836004)(5660300002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR08MB3194;H:DB7PR08MB3292.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: S8FGzAf6lkbGoQX7XJcm1t1l0KUl1GNZRaUIHK1JOlcFd9zbKkqJu6hawIi4IcmiDuKp+E3qBoz8aBx4EmPNpNDs0orT1/PCos5KoomuCjq+eQ7UKpWQsz6FozZpRJh+09I3gujRqGlV0RVeUKJYmx1MrCzu2mzOSpvI+4+Soz0fjfIlVcqx5ZUK5AAASpkQrkO6ENC9QGaasMtqbdcRvVe6c70eNj1U58pDy82inSXJNtFyNe0BoVpcHTcU7xh1TJC40tktlS8KaBgtUIhMfxNVToERoanemM7jrwp5lI9csQ6xrImizRys9DNUVAEgJQy7HqMfaYwBe/7oE03HRqsbOrYS5/smJQ266SKaM1NCMYuBGF8c1K2MthdD5XgJSzKioZT+tjXM0lhpA9tNniJfwWxoYYnk08muvVHm2lde0L4oXx9Sv/D1cf1LM8gDp9bBv+Q5NgF8bcdaI/8UvQ/7FCyV00aEZz3p+QhCqsI= Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Return-Path: Szabolcs.Nagy@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 87bd28ae-7918-4563-9166-08d75d5d6b36 X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg02164.txt.bz2 On 30/10/2019 14:48, Jakub Jelinek wrote: > ARM is an OpenMP member, so if you want, you can participate too. > https://github.com/OpenMP/spec/issues/2028 > is where I'm trying to track all the declare variant issues that need > clarification (plus in two examples tickets). it's unfortunate that neither the mailing list nor the github repo for the spec are public, i'll try to get access to them to see the discussions. thanks for the explanations. >> for simd variants it means i need to declare the function >> with the right simd types and attributes. >=20 > For simd it is actually not finished yet, what needs to be done is that > given the declare simd clauses used as properties of the simd selector > the FEs use some target hook that will guide it how to transform > the parameters like targetm.simd_clone.compute_vecsize_and_simdlen > does and for C tries to just match the types against it and determine > through that the ABI and perhaps missing simd clauses like > notinbranch/inbranch, simdlen etc., for C++ actually for each possibility > will try to construct a call with such arguments and then compare the typ= es. this omp declare variant mechanism seems fairly complicated. i need is a way to specify a simd variant unambiguously, which requires is_inbranch, simd_len and vector_call_abi setting as far as i can tell (potentially a symbol_name too if the vector abi mangled name is not good enough). i think i can extend the simd attribute to do this e.g. __attribute__((simd("notinbranch", 4, "sse2"))) float expf(float); would declare the _ZGVbN4v_expf simd variant of expf. (multiple attributes can be used to declare multiple variants.) or __attribute__((simd("notinbranch", 4, "sse2", "my_vexpf"))) float expf(float); or maybe typedef float vfloat __attribute__((vector_size(16))); vfloat my_vexpf(vfloat); __attribute__((simd("notinbranch", 4, "sse2", my_vexpf))) float expf(float); if we allow custom symbol name for the simd variant. here "sse2" is not specifying a gcc target nor instruction set, but the vector call convention, e.g. on x86_64 there could be "sse2", "avx", "avx2" and "avx512", on aarch64 "advsimd" and "sve". i thought this would match the omp isa, but based on your description omp isa will be something else. there is a further complication that vector length agnostic (scalable) sve calls need a special simd len value: i'd reserve 0 for it, but it seems internally that means 'simd len is unset' so that has to change. i will try to prepare an initial patch for such attribute to make the proposal more concrete, but if you have any concerns please let me know.