From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1FE12445B2 for ; Sat, 19 Nov 2022 14:22:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 70377689993; Sat, 19 Nov 2022 16:22:36 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A977268A6CD for ; Sat, 19 Nov 2022 16:22:29 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 6A26F240499 for ; Sat, 19 Nov 2022 15:22:29 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id fuwerC89Qs-g for ; Sat, 19 Nov 2022 15:22:28 +0100 (CET) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id BDC0C2400F5 for ; Sat, 19 Nov 2022 15:22:28 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id A7B621601B2; Sat, 19 Nov 2022 15:22:28 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <20221117100942.6217-1-anton@khirnov.net> <20221117100942.6217-4-anton@khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Sat, 19 Nov 2022 15:22:28 +0100 Message-ID: <166886774865.20155.18056025533083936168@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 4/7] doc/developer.texi: document the use of other languages than C X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Lynne (2022-11-17 15:17:44) > Nov 17, 2022, 11:09 by anton@khirnov.net: > > > --- > > doc/developer.texi | 15 +++++++++++++-- > > 1 file changed, 13 insertions(+), 2 deletions(-) > > > > diff --git a/doc/developer.texi b/doc/developer.texi > > index 01735e07f5..44da6e41af 100644 > > --- a/doc/developer.texi > > +++ b/doc/developer.texi > > @@ -56,9 +56,9 @@ and should try to fix issues their commit causes. > > @anchor{Coding Rules} > > @chapter Coding Rules > > > > -@section C language features > > +@section Language > > > > -FFmpeg is programmed in the ISO C99 language, extended with: > > +FFmpeg is mainly programmed in the ISO C99 language, extended with: > > @itemize @bullet > > @item > > Atomic operations from C11 @file{stdatomic.h}. They are emulated on > > @@ -83,6 +83,17 @@ complex numbers; > > mixed statements and declarations. > > @end itemize > > > > +Other languages than C may be used in special cases: > > +@itemize @bullet > > +@item > > +NASM is preferred for x86 SIMD or other x86 assembly. Inline assembly and > > +intrinsics should be avoided, unless there is a strong reason to use them (e.g. > > +code that needs to be inlined). > > > > We don't accept x86 intrinsics, so should isn't really appropriate. > Also, a word for other architectures would do. > Something like this maybe: > > @item > NASM is required for x86 assembly. Inline assembly should be avoided, > unless there's a strong reason to use it (e.g. code that has to be inlined). > Intrinsics or other assembly flavours are not accepted for x86. > @item > For other architectures, GAS syntax should be used for assembly. > Inline assembly should be avoided, unless there's a good reason to use it. > Intrinsics are acceptable, but not recommended. > > Other architectures also have different assembly syntax versions, > but it's so niche, it's not really worth mentioning. My intent with this set is to make the document match the actual reality, not ideal aspirations. And the actual reality is - for x86, we have both intrinsics and inline asm. In my view (apparently shared by several other people) intrinsics are the lesser evil when nasm cannot be used. - intrinsics are commonly used for some other arches, like ppc or mips Also, the reason I didn's say anything about other platforms (most importantly ARM, but also GPU stuff etc.) is that I never wrote any code for them and don't really know the exact state. Patches welcome. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".