Skip to content

Disable sqrtf vectorization for GCC 15 #18975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/develop/openmp_maths.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ extern float fabsf(const float x);
DT_OMP_DECLARE_SIMD()
extern float powf(const float x, const float y);

#ifndef __GNUC__ // GCC 15 compiles but fails at runtime due to missing library function
DT_OMP_DECLARE_SIMD()
extern float sqrtf(const float x);
#endif

DT_OMP_DECLARE_SIMD()
extern float cbrtf(const float x);
Expand Down
4 changes: 2 additions & 2 deletions src/iop/rawdenoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static void wavelet_denoise(const float *const restrict in, float *const restric
const float *const restrict inp = in + (size_t)row * roi->width + offset;
const int senselwidth = (roi->width-offset+1)/2;
for(int col = 0; col < senselwidth; col++)
fimgp[col] = sqrtf(fmaxf(0.0f, inp[2*col]));
fimgp[col] = sqrtf(MAX(0.0f, inp[2*col]));
}

// perform the wavelet decomposition and denoising
Expand Down Expand Up @@ -298,7 +298,7 @@ static void wavelet_denoise(const float *const restrict in, float *const restric

static inline float vstransform(const float value)
{
return sqrtf(fmaxf(0.0f, value));
return sqrtf(MAX(0.0f, value));
}

static void wavelet_denoise_xtrans(const float *const restrict in, float *const restrict out,
Expand Down
Loading