From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mxout.security-mail.net (mxout.security-mail.net [85.31.212.42]) by sourceware.org (Postfix) with ESMTPS id 38EC33858CDA for ; Mon, 25 Sep 2023 15:16:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 38EC33858CDA Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kalrayinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kalrayinc.com Received: from localhost (localhost [127.0.0.1]) by fx302.security-mail.net (Postfix) with ESMTP id 4B33281D509 for ; Mon, 25 Sep 2023 17:16:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalrayinc.com; s=sec-sig-email; t=1695654960; bh=btcrMbLXRq77PBdC9T2b+SJH6dzUdGsvJQuXJaHiODE=; h=Date:To:Cc:From:Subject; b=QqqDJRKlN52F5vo+VwmGRTno8AYfN2JohYFnwh0pYUiMaXJqNUScDR3W+4/+aG8EV +FkOlc7qWD7SSx757gyknSGJVB0McaOwqT0Lpn4HutU0IQZGQgCYVVFoLskEzey+3U oGrL9UDAua8uYNpEz6PBY1EhDHoQpKC/i/a7zFRA= Received: from fx302 (localhost [127.0.0.1]) by fx302.security-mail.net (Postfix) with ESMTP id 2C1EF81D222; Mon, 25 Sep 2023 17:16:00 +0200 (CEST) Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-pr2fra01on0108.outbound.protection.outlook.com [104.47.24.108]) by fx302.security-mail.net (Postfix) with ESMTPS id 6FD8281CBFB; Mon, 25 Sep 2023 17:15:59 +0200 (CEST) Received: from PR1P264MB3448.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:184::6) by MR1P264MB2337.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:32::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 15:15:58 +0000 Received: from PR1P264MB3448.FRAP264.PROD.OUTLOOK.COM ([fe80::ad9:f173:8a66:3461]) by PR1P264MB3448.FRAP264.PROD.OUTLOOK.COM ([fe80::ad9:f173:8a66:3461%7]) with mapi id 15.20.6813.027; Mon, 25 Sep 2023 15:15:58 +0000 X-Virus-Scanned: E-securemail Secumail-id: <12fe2.6511a42f.6f58c.0> ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ETqlO5UYfMmSpJv2kBL8SsFRgmSnaevgny23XlxzV+mQeB7oAYDTsWJLrABiWnv3I1FpZlX+f8ebyUqGNm/nbmnqVsc6oYgwum/RhTDbmzHCpBlmLgrtWbJkqVKTB+pIC7BSrFrflM0kYog0rMHZA/xh+hsZuN9LZrp9y+mSzYqCetf0N+xFAxrLMqrnEYG4+kjpjQQsMmSRBBzfkBcgoDZItwHa8eemTwOCpKl0NFJMfNQnKHgddsDbnKZjpB2hLy12RByICmNFNR5umNptUWKHPuwZ6T1R714hPFv4u6k1WKAORIuffiCoLgt3vRsjKC854aBJdb1J/rj3ujxmOw== 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=WEy1yIxaq731cSQEDZs9tFgKlmlVw4gGWh7wJ097bNI=; b=deGF+JPn0Sko4J/rACXYPkshT+r6O7GX6LrbSKNljdVTJ91BOVm//fsIEX6+r1QfhSM2fR12+nXCv+q9i9r37wKMpLvZLY/wTRvHzsXMA+o0Pu6pe/WTWzf18lscnEQcf2eS+VAKtjtoFzASd9PNACSuW18MR1/8i3vmsv4mpMVgzUf+vyrw5pC7h1szKwyXn/wo+C1glEvuYx3QyKD6o4mB+pObiOn3mHyEXlfPCKHANj8kC2VNbbT1Ep3zts+19oS/zMhFcBD+e1xHr8HQZi8gnoTYt0Z/2IspCIj+lELtyQxYsgmvRqsfY4ctRLac2jxtHSckDyQJeS08OeX4Pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kalrayinc.com; dmarc=pass action=none header.from=kalrayinc.com; dkim=pass header.d=kalrayinc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalrayinc.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WEy1yIxaq731cSQEDZs9tFgKlmlVw4gGWh7wJ097bNI=; b=OJ/F/pyZSQkm+4Gsy4Xh58+XZwdZ04rjv5SOAEIkgpXCHgiJrLY0Ij2dEFhMGV+6M+CNnKCNaJE9ocPy/INOmxr+ai0xKp7f5lC0B0wqQn8gzqd3qPziTxWH0srGcvHMjYltmX0lmVI1Ii9Xaz0bJp4eighy4tC+BRzu0H43co/dqgPFjr19QLNwX97RT/Drba2KcRRrKpaCLGiz7DMhCfpHXR2IIZHxmXiQC59qtfnclLlowjRZZzj/Hit+uXwyDD5YAsCBSsyQpv9g0HFbdXiOJ2SpO1zKQ838F3EGRcNTLgv4IJUoWEkxzeDx9uB0YNnLhPHFXKKHEWj/C61RXw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kalrayinc.com; Message-ID: Date: Mon, 25 Sep 2023 17:15:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-us To: gcc@gcc.gnu.org Cc: sylvain.noiry@hotmail.fr From: Sylvain Noiry Subject: Complex numbers support: discussions summary Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0385.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18f::12) To PR1P264MB3448.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:184::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PR1P264MB3448:EE_|MR1P264MB2337:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f93e212-8c26-4f85-0422-08dbbdda5211 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jFLI/7gIIrES6/yu+F3XLG2UzQjlagODqOLHmUij4uo3mjGoMHcSIVoqOznrZjtjMrxP/QkCF8+H31usQIOfy117zRAY1NK1t9TOdz9ROfetgIMMtlNh8ZdgxR3bdKuUyrYUB4DdDQULFxTxJ/cpUIRDLvC8J4iPtdBfX5oMawcZYgrvCCu3YFO/cP/xx5qiOdKgZtEU/uXo+5eWBU5RYndXlHv1bIGwbWPUx8cz2wHekJBkA2K19pucaQpkn160nc5NwP8aHLyQkBmcb/oxiQjpR3VjXC0CeDWMXiW8pTD1d79ASXfoWWdlwnBhThZfftBZ/NHZQWWk5Ul1hvuxHwqNXu+X1WSqb9PTC86DyQUQ74/FJM/OOvVVlXGakbr8y/W/YfdtCiB9pR+s7+Jx9HJgI7tDMnnNX9qQFpj8D+03sdDeA6q9jyrJOy1xcFmP49XYIujomxB/nMINNdcP5jYb02Ft0bK/IuIo9NLAcQ3YHhoFUMclq/lqC7zfFXM0wr7l+9A4WRlwQIlbP39Rp8VIqJx6N9aR+8C0XXVNxS4cIUrtmUrkXccmiHgvV/UzcEsIpGT5jICm/SE9sgCS2Hcztvr8pX1Qnxt9y8Rau82U9TSQnpV/d5jtoCDcGL/F X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PR1P264MB3448.FRAP264.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(39850400004)(136003)(346002)(396003)(366004)(376002)(230922051799003)(1800799009)(186009)(451199024)(66899024)(8936002)(26005)(36756003)(2616005)(6506007)(6512007)(8676002)(4326008)(66476007)(5660300002)(66946007)(41300700001)(66556008)(316002)(2906002)(6916009)(86362001)(31696002)(38100700002)(6486002)(478600001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lguGpyacXWIVDclTzFZxYkoo5TbuDzhl/XOZrSqGu1XtXrdCL+CLMIpG5mNX6a2gF56wEuBSB4Dat4i+/nmtFyVIS19FEKDSu6TElfUV25oooYdNPal5aNqxzmgUXb/aSE2zOtV1nVZhzF88NtIQ5NJ23lAVBwfANjHQAXWNqujE4rVSeu7gmW2bn1gvP9tLyAE4cBTXD1Bx2W59iiV+GNUQTFQ1Nxt7a92DkpcDNPUE/28IF1Vx5Ltue3qUBga88vTk8R9vT4m/FLN1DtVu5dhhnO200eD1RxXGXsjzeGgfgaH8wZDV4on9G4sQMffELSoBH0NIekO987is+mlSNSJDaBh1fUApoJT6zN+A3jIBj8kWOKKOtsIMjozj4ZuLaNvUxjIThoghJg9zem7wQdOE+jKDQA4ZDnyFZunX6PezNHoGQodaBzaeMAVUBNkhCS2YRlU9bBiPoPrjVf9itBh3zlx+G8vXRiJOj64G1gx7xrYVYf66SebWCwLqLFWM125HDhV9ExBK7fIu0Bcf4iYBp3UiF8gI4geJPbVabkYcKbW966Pb2wWFTVBVonawLP/SHyeIsEHPepL6W2mtHUA1GpyX/js+bZhkDNl8uRSFKy/p63N8WDc0QOFKVxdMzi8HKa+KptXSVl144xaKfTZhpYQH9k9Mwg8AAQvCetjvJ3qrykDmv08CwXTsC1I5YbUz0vv4HX3ap/zh+cP/X1TRMKs3BtpNCEB4Iype31+WBnJGYkweiccgt7dShmvIFxszxC7RDdgO+EyE2pJy1UTqXoAyVIrx8hHVrrVSBAUgklMbWsXd1y5aLbQOoGWc0fYKGz6a3At37asw2DM2irPUvmfCabbSHRDt4eEHQcSJjPj5eOddXii8ImlCuTeNG+NIWwFTiloc/EzhjetputECWp/hlSNi4BbjGDFYgxUFqNjDf6qjAziAt28u495d Hop6cE1DVBV51mxQcE8USMGXCcX9XYVhmouFIPCsU4Wjv0IAJqbwq7Mm7lq345l3eiOoqdAphyxN1G7AIhZJO9k8m+enDNV1B31sx01TX27fy0PBZ5nQEhyGxbFIqUjwdb/ZQ/w5wf2mDp4Pn6ftUWQo5nSY0PhaqzxUV5PKTWf0LCzfNoIUsF26sUu/nStSzevBXl4xlibLX1w2RS02VgVYf6NIY/yb66/a/Edjd0HKO9kDkmkNLKykZ5aacv83EcY8LUcj59uZvyB2Uu2dhgiz+45Ux8rDF1faOCo3vfEsbJmE2MnrcBN2s0N1K+EExJH3jyG73lZEWZXC1kcwUWD0rj1zNxtGXGbvd8EpoEuDBIlA+lKAYTnGOvn0tvwQm9p5t87g4Rn65TtXR/6LLlKTilFRdQhLRIv8kmeAkaXrsWxh85yrpvS5SbLrxML826yz0gWjo5SC+CHScmnl/PBl6G6T5q2bo0jp6OBdl3ncS+cYjiyHINiPNObP299/ITikm7tW7TX8uKXSBbSWR4xzonUMI6JVC7LdtYPg/V1o7c2NPKrxC97tVq9DTcN1ER9s+bvv+eEiKXBISb599Wxw2ZQabUoMXMxksRX0q80TtjWFAqUhiYUxj90JVpg9 X-OriginatorOrg: kalrayinc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f93e212-8c26-4f85-0422-08dbbdda5211 X-MS-Exchange-CrossTenant-AuthSource: PR1P264MB3448.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 15:15:58.1423 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8931925d-7620-4a64-b7fe-20afd86363d3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /h2rX8JjS3nHxKgA1SUgUewiP0+hNmeS8hdfev0jdldw2+3Q9aaXhUpnULBpCbime93id7Udf2K3l0gwzrMxgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR1P264MB2337 X-ALTERMIMEV2_out: done X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,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: Hi, We had very interesting discussions during our presentation with Paul on the support of complex numbers in gcc at the Cauldron. Thank you all for your participation ! Here is a small summary from our viewpoint: - Replace CONCAT with a backend defined internal representation in RTL --> No particular problems - Allow backend to write patterns for operation on complex modes --> No particular problems - Conditional lowering depending on whether a pattern exists or not --> Concerns when the vectorization of split complex operations performs better    than not vectorized unified complex operations - Centralize complex lowering in cplxlower --> No particular problems if it doesn't prevent IEEE compliance and    optimizations (like const folding) - Vectorization of complex operations --> 2 representations (interleaved and separated real/imag): cannot impose one    if some machines prefer the other --> Complex are composite modes, the vectorizer assumes that the inner mode is    scalar to do some optimizations (which ones ?) --> Mixed split/unified complex operations cannot be vectorized easely --> Assuming that the inner representation of complex vectors is let to target    backends, the vectorizer doesn't know it, which prevent some optimizations    (which ones ?) - Explicit vectors of complex --> Cplxlower cannot lower it, and moving veclower before cplxlower is a bad    idea as it prevents some optimizations --> Teaching cplxlower how to deal with vectors of complex seems to be a    reasonable alternative --> Concerns about ABI or indexing if the internal representation is let to the    backend and differs from the representation in memory - Impact of the current SLP pattern matching of complex operations --> Only with -ffast-math --> It can match user defined operations (not C99) that can be simplified with a    complex instruction --> Dedicated opcode and real vector type choosen VS standard opcode and complex    mode in our implementation --> Need to preserve SLP pattern matching as too many applications redefines    complex and bypass C99 standard. --> So need to harmonize with our implementation - Support of the pure imaginary type (_Imaginary) --> Still not supported by gcc (and llvm), neither in our implementation --> Issues comes from the fact that an imaginary is not a complex with real part    set to 0 --> The same issue with complex multiplication by a real (which is split in the    frontend, and our implementation hasn't changed it yet) --> Idea: Add an attribute to the Tree complex type which specify pure real / pure    imaginary / full complex ? - Fast pattern for IEEE compliant emulated operations --> Not enough time to discuss about it Don't hesitate to add something or bring more precision if you want. As I said at the end of the presentation, we have written a paper which explains our implementation in details. You can find it on the wiki page of the Cauldron (https://gcc.gnu.org/wiki/cauldron2023talks?action=AttachFile&do=view&target=Exposing+Complex+Numbers+to+Target+Back-ends+%28paper%29.pdf). Sylvain