From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 5885C4C54B for ; Sun, 25 May 2025 21:37:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 4CFEC68D555; Mon, 26 May 2025 00:37:17 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 2CA3D68D0A7 for ; Mon, 26 May 2025 00:37:10 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4219A42F79 for ; Sun, 25 May 2025 21:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1748209029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+dFKv4tiekD+kiSw74Nasxgrp8+QSIYezv1jCqk8wms=; b=EYx69gioz2a8oNmbXXOT1cWer2JN+yn+KfYqm7QEECRECortL9sqYYDt+ctO/T012jyt74 oGYQuVAMc/e/SQBcQCNqpTzu6k8LRgKgwur14MGoFKe2h7xSZ8vzTkg+/IL/nO1rla8LrY WTg3Qjdu/Gmg5O0zqD/t/qhoNqg0HsnO1MyNIrSaZFFTQLZFzUyoA1uwlAxNwaRfWLf/4S orkwJHAHNJ7FeW4JR4/I6Vym6VcD/zu0erMcm2i5VCokvmABGkHl6U8Lt5e2sZ5EObM9cA Xngq/l214V0wkbWJOgfyuh4ZFrBazULkcvlMZrrnV7br7MMsKdz/Oo5/cHNbqQ== Date: Sun, 25 May 2025 23:37:08 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250525213708.GO29660@pb2> References: <20250521061750.54882-1-jiawei@iscas.ac.cn> <49f0532f-444c-4881-982a-26ed53e5e4b0@frankplowman.com> <09d91570-6c20-49a7-aada-ceb18d77c6c3@iscas.ac.cn> <3356719.44csPzL39Z@basile.remlab.net> MIME-Version: 1.0 In-Reply-To: <3356719.44csPzL39Z@basile.remlab.net> X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdduheejvdculddtuddrgeefvddrtddtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepleekgefgffeiudefjeeuffejudehtddtudeltdehveevvedtieeulefhtdeutdeknecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] gcc: Remove auto-vectorization limitation. 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: multipart/mixed; boundary="===============9153166584753417329==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============9153166584753417329== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="q/E04pvXIjS/VngA" Content-Disposition: inline --q/E04pvXIjS/VngA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi R=C3=A9mi On Sat, May 24, 2025 at 07:10:57PM +0300, R=C3=A9mi Denis-Courmont wrote: > Le torstaina 22. toukokuuta 2025, 9.32.18 It=C3=A4-Euroopan kes=C3=A4aika= Jiawei a =C3=A9crit=20 > : > > > The RISC-V autovectorised output looks like it has a warning "Odd > > > rotation angle" which is not present in the non-autovectorised output. > >=20 > > I found this occured when using '-ffast-math' in RISC-V, also occur in > > -O3 -ffast-math -fno-tree-vectorize case(much slower due to the > > -ffast-math)=EF=BC=8Csupplementary more comparison results here: >=20 > Unfortunately, the FFmpeg code is written with x87 semantics in mind. I dont remember ever writing code intentionally with x87 semantics. And i have doubts other people did. What i did in soem rare places do, was depend on IEEE 754 semantics (that is when doing so lead to simpler and cleaner code) > For > instance, the FFmpeg math macros work nicely on x86, but they would work = much=20 > better with fabs/fmax/fmin/fabsf/fmaxf/fminf on other platforms. I tried = to fix=20 > that with copious amount of _Generic(), but that lead to ICE... ICE as the name says, is a internal compiler error and not the fault of the code passed to the compiler >=20 > So we are stuck between a rock and a hard place where we need fast math f= or=20 > good perfs, but we need to turn it off for correct results. --ffast-math is not one option, its many on the gcc here, it does this: + -fassociative-math [enabled] + -fcx-limited-range [enabled] + -ffinite-math-only [enabled] + -fmath-errno [disabled] + -freciprocal-math [enabled] + -fsigned-zeros [disabled] + -ftrapping-math [disabled] + -funsafe-math-optimizations [enabled] So maybe some of this can be globally enabled. But some things like fassociative-math are simply not "safe" on general nummeric code. It also violates ISO C according to the official gcc documentation thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Complexity theory is the science of finding the exact solution to an approximation. Benchmarking OTOH is finding an approximation of the exact --q/E04pvXIjS/VngA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaDONgAAKCRBhHseHBAsP q6olAJ94/0sEBlxaQgIKLFDL6tlqFRChdQCeI2T5l5OcysbMkJftyt0Xq5Ie8ao= =j02h -----END PGP SIGNATURE----- --q/E04pvXIjS/VngA-- --===============9153166584753417329== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============9153166584753417329==--