Re: [FFmpeg-devel] [PATCH] lavu/common: use fabs(f) for FFABS/FFNABS

2024-08-14 Thread Anton Khirnov
Quoting Rémi Denis-Courmont (2024-07-26 18:32:19) > The absolute value of a floating point value is easier to calculate than > that of an integer: it is obtained by either clearing the sign or xoring it > with itself. Accordingly, Arm, LoongArch, RISC-V have dedicated instructions > to manipulate f

[FFmpeg-devel] [PATCH] lavu/common: use fabs(f) for FFABS/FFNABS

2024-07-26 Thread Rémi Denis-Courmont
The absolute value of a floating point value is easier to calculate than that of an integer: it is obtained by either clearing the sign or xoring it with itself. Accordingly, Arm, LoongArch, RISC-V have dedicated instructions to manipulate float sign bits. x86-64 has ANDPS. As per C11 appendix F,