Skip to content

Commit

Permalink
Do not force inlining of indirect functions
Browse files Browse the repository at this point in the history
* A function called indirectly cannot be decorated
  with `__attribute((always_inline))`, as this is
  guaranteed to only work with direct calls:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63220#c1

Bug: https://bugs.gentoo.org/798045
  • Loading branch information
SoapGentoo authored and mstorsjo committed Jul 15, 2021
1 parent c3cef6d commit 019fe95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libFDK/include/fft.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void ifft(int length, FIXP_DBL *pInput, INT *scalefactor);
* bit scale headroom. The values are interleaved, real/imag pairs.
*/
LNK_SECTION_CODE_L1
static FDK_FORCEINLINE void fft_4(FIXP_DBL *x) {
static inline void fft_4(FIXP_DBL *x) {
FIXP_DBL a00, a10, a20, a30, tmp0, tmp1;

a00 = (x[0] + x[4]) >> 1; /* Re A + Re B */
Expand Down Expand Up @@ -168,7 +168,7 @@ static FDK_FORCEINLINE void fft_4(FIXP_DBL *x) {

#ifndef FUNCTION_fft_8
LNK_SECTION_CODE_L1
static FDK_FORCEINLINE void fft_8(FIXP_DBL *x) {
static inline void fft_8(FIXP_DBL *x) {
FIXP_SPK w_PiFOURTH = {{FIXP_SGL(0x5A82), FIXP_SGL(0x5A82)}};

FIXP_DBL a00, a10, a20, a30;
Expand Down
6 changes: 3 additions & 3 deletions libFDK/src/fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ [email protected]

/* Performs the FFT of length 2. Input vector unscaled, output vector scaled
* with factor 0.5 */
static FDK_FORCEINLINE void fft2(FIXP_DBL *RESTRICT pDat) {
static inline void fft2(FIXP_DBL *RESTRICT pDat) {
FIXP_DBL r1, i1;
FIXP_DBL r2, i2;

Expand All @@ -196,7 +196,7 @@ static FDK_FORCEINLINE void fft2(FIXP_DBL *RESTRICT pDat) {

#ifndef FUNCTION_fft3
/* Performs the FFT of length 3 according to the algorithm after winograd. */
static FDK_FORCEINLINE void fft3(FIXP_DBL *RESTRICT pDat) {
static inline void fft3(FIXP_DBL *RESTRICT pDat) {
FIXP_DBL r1, r2;
FIXP_DBL s1, s2;
FIXP_DBL pD;
Expand Down Expand Up @@ -233,7 +233,7 @@ static FDK_FORCEINLINE void fft3(FIXP_DBL *RESTRICT pDat) {

/* performs the FFT of length 5 according to the algorithm after winograd */
/* This version works with a prescale of 2 instead of 3 */
static FDK_FORCEINLINE void fft5(FIXP_DBL *RESTRICT pDat) {
static inline void fft5(FIXP_DBL *RESTRICT pDat) {
FIXP_DBL r1, r2, r3, r4;
FIXP_DBL s1, s2, s3, s4;
FIXP_DBL t;
Expand Down

0 comments on commit 019fe95

Please sign in to comment.