From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id C90B91F44D for ; Thu, 18 Apr 2024 12:02:20 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=OiSrJh+3; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 089963844054 for ; Thu, 18 Apr 2024 12:02:20 +0000 (GMT) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 5C6753858C35 for ; Thu, 18 Apr 2024 12:01:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C6753858C35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5C6753858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713441708; cv=none; b=Bu8p8lD9KVgVnvFrgBqJ7sc3rX2D3+PVkvUpyBqkxHq71cO99p2grTPB1sQdzQGkSVT2auW/1I1q/gw6e9C3lcg4pyzrFeQMdGeoCD1ARLalIMmq8Sx1lMTlf8uMxIjL2fRB9Mzvzzd53eIHIKejgSiEY3ffilJ3wvcgyksGOgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713441708; c=relaxed/simple; bh=/ESiY0tLPUkvn+qz3zNyKXJYJoRnovBOmLoHOQ3+5dc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=PBrmiWzsqSm071qUowBt+qyxLk8BqOjadn5ZXxN+0JhPUD+8y4uzRVNh9vI5hhfDYoUoXYzeayt36WycAqZlfO/h0R60gnebkAYgdTGJ213ouccvf4eLiAyz1e44I2ecwUscHDShjh6epOCOBIaXO5nS186idYv+YG4pWoAohjY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-417f5268b12so8502095e9.1 for ; Thu, 18 Apr 2024 05:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1713441696; x=1714046496; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JWWTq190BihVgPm03a2G0syOWpQfvtEAJrKkueZU0Yg=; b=OiSrJh+3JdHgwA/KK13GjeR4J4hse7d5PzCWBRV14LVmIanQxlJEa5Q0qBt1RJ1SuB BbY9JVgcK1ANfsT37X1wrzlu9bfjHXklRtvxrSnPhbH9OIt9CrRuHZQSsPWjLTzVFYaF 6l4EY2DKbTB4YJcL1O89QYUgoZ9YJCCA1g3a1A4XiGAEcOEOeY4E6bNP0moa7xGA9+b9 RJ/PHNqVnO/P3Vg/GP5hBytAxvnq+JNN8PGo1exUdIzfWtjG9hWCqPVyQ9GuCpAD1Vgt KaQqPcEebt5vw4PFIWz4PjRr0FXvsgW5stgYWzfUDshiqu/iY4tjOhBnRKe/nfH3QQ1K fj6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713441696; x=1714046496; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JWWTq190BihVgPm03a2G0syOWpQfvtEAJrKkueZU0Yg=; b=BGAB3EW3TfRq4RJjIosKUlWYrncYP8Ox1WWKDe5+H5QfZG+phnbSZAwi/UdRnByXTk R0Ix0+pY8SXz8xqFg/msWKfRvugRupgkNTkjaRVbJh+P+B8VnW9WIrLxh07LC4aEO9/W +MOYuVbVu9+g1Ivw1ijetvzuec0rNMz/0Bzpol+H2c/lPxTwJYp1qTXo1B9CdBUJf5j3 xcnOYwFUPh9xbvFXdevTtA8DAJ++O/6VrChs7TziYttNyNerZQwhTO8bz4mfg5hJegrz 8j/IBRD1c5Kgnnf+nBs6vYTQ1kIJg+q3wH0aHElIE4kc6q9EN2TaBSuyzLsH0hL7/5kP 549Q== X-Forwarded-Encrypted: i=1; AJvYcCU8XzyN9dtEPigM38kkLRtHpZ6YVasNFLF2KDv3yN7VpnByfcNdWP2Mbf+9mUbdFNM35TmyCu+lGIC9p3m6WD4FtpTvI2sR8UJU X-Gm-Message-State: AOJu0YxYIou5jrC0PDagXNF+yicni3MEVmVhOSl8SzApSf1nVHB+ZEri 9wVkZ0O2MDGV4mZY1qjaZiTAyecLk/h2Xvo91HXEmo2sjFH4MuMyn4zBz7AcK8k= X-Google-Smtp-Source: AGHT+IEFhhCPNosNamw2R24/i7QaSU1Rlj/Kv8Z3wE0JjW5UMKL7CVeGwOtWyMA2cbamEA3R/+6FpA== X-Received: by 2002:a05:600c:4fd3:b0:415:6728:a565 with SMTP id o19-20020a05600c4fd300b004156728a565mr2341167wmq.16.1713441695933; Thu, 18 Apr 2024 05:01:35 -0700 (PDT) Received: from ?IPV6:2001:16b8:3f2d:6500:cab2:a16e:9e9:ec5d? ([2001:16b8:3f2d:6500:cab2:a16e:9e9:ec5d]) by smtp.gmail.com with ESMTPSA id l9-20020a1c7909000000b004167b0819aasm7307741wme.0.2024.04.18.05.01.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Apr 2024 05:01:35 -0700 (PDT) Message-ID: <686fac37-698f-4373-9469-ccabe96e702a@baylibre.com> Date: Thu, 18 Apr 2024 14:01:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Generated files in libgfortran for Fortran intrinsic procedures (was: Updated Sourceware infrastructure plans) To: Janne Blomqvist , FX Coudert Cc: Thomas Koenig , Mark Wielaard , overseers@sourceware.org, gcc@gcc.gnu.org, binutils@sourceware.org, gdb@sourceware.org, libc-alpha@sourceware.org, "fortran@gcc.gnu.org" References: <20240417232725.GC25080@gnu.wildebeest.org> <5bde614c-224f-4ec6-8450-7c0911938cf9@netcologne.de> <4353C519-D023-45B0-A254-C7274B7CFC6F@gmail.com> Content-Language: en-US From: Tobias Burnus In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Hi Janne, Janne Blomqvist wrote: > back when I was active I did think about this > issue. IMHO the best of my ideas was to convert these into C++ > templates. I think this will work – but we have to be super careful: With C++, there is the problem that we definitely do not want to add dependency on libstdc++ nor to use some features which require special hardware support (like exceptions [always bad], symbol aliases, ...). — On some systems, a full C++ support might be not available, like embedded systems (including some odd embedded OS) or offloading devices. The libstdc++ dependency would be detected by linking as we currently do. For in-language features, we have to ensure the appropriate flags -fno-exceptions (and probably a few more). And it should be clear what language features to use. If we do, I think that would surely be an option. > What we're essentially doing with the M4 stuff and the > proposed in-house Python reimplementation is to make up for lack of > monomorphization in plain old C. Rather than doing some DIY templates, > switch the implementation language to something which has that feature > built-in, in this case C++. No need to convert the entire libgfortran > to C++ if you don't want to, just those objects that are generated > from the M4 templates. Something like > > template > void matmul(T* a, T* b, T* c, ...) > { > // actual matmul code here > } > > extern "C" { > // Instantiate template for every type and export the symbol > void matmul_r4(gfc_array_r4* a, gfc_array_r4* b, gfc_array_r4* c, ...) > { > matmul(a, b, c, ...); > } > // And so on for other types > } Cheers, Tobias