From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 5F22E385841E for ; Thu, 18 Apr 2024 12:01:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5F22E385841E 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 5F22E385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 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-x334.google.com with SMTP id 5b1f17b1804b1-41881bce4b5so8437085e9.2 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=HNj5G7x5kLd7mYz6xJ8OUUZc6Gw6U0xxUDD8XGod7Iv9fo5VaYGiuAVwMlJxHj8sfG sS8rbzZbmfURNLRggmWOwyC7yfMPk/DxNyOyI9ib1e6ZX2t2vV0KQGlE17F7S3eb9DLX 1e9WZMeA3WC0GXnWBhiwJz5+Q8nFEj7Sozmsgzq/gy619eZt86LCIeiQdHd4DNiwb+03 p+gjlSt6As91gouQ7IXFGSK4QPBejIoICIlNKIeayO6Obj8Sdu0dKNo7itab6n5QRSik SXfaMDXQ7j8r4ydE0Hj4DpM2L3JM6rMWwIadeu15QXr0o7XvWfjo2wEKxptlaGA+wms5 bEBA== X-Forwarded-Encrypted: i=1; AJvYcCXO1CricPn9B0bCqfYanzmDyODaLE1F5/v09WDRzxmx5TJN9nDFz3pzqPQYj9xmM5jJ3Zp298wpV/uCaTh248w9gJqOFdqEH14= X-Gm-Message-State: AOJu0Ywo/6ErO+U2mutjH2hFeORzvaO6URVsVT6YYIiqyHAj0LPEJs4i 9/3hR8lsYOhQ3kbRkuUSVMKcOpPaUvQjASYiTBLWypg0d8yz63E/KfNw0g0H5l8= 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-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,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 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