Skip to content
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

Fix testbench xt build fail #8289

Merged
merged 2 commits into from
Oct 6, 2023
Merged
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
5 changes: 3 additions & 2 deletions src/arch/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ if (supports_implicit_fallthrough)
endif()

# C & ASM flags
target_compile_options(sof_options INTERFACE -g -O3 -fPIC -DPIC -Wall -Werror -Wmissing-prototypes
${implicit_fallthrough} -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wpointer-arith
target_compile_options(sof_options INTERFACE -g -O3 -fPIC -DPIC -std=c99 -std=gnu99 -fgnu89-inline
-Wall -Werror -Wmissing-prototypes ${implicit_fallthrough} -Wno-pointer-to-int-cast
-Wno-int-to-pointer-cast -Wpointer-arith
-DCONFIG_LIBRARY "-imacros${CONFIG_H_PATH}")

if(NOT BUILD_UNIT_TESTS_HOST)
Expand Down
6 changes: 3 additions & 3 deletions src/audio/mfcc/mfcc_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void mfcc_source_copy_s16(struct input_stream_buffer *bsource, struct mfcc_buffe
}
buf->s_avail += copied;
buf->s_free -= copied;
buf->w_ptr = out;
buf->w_ptr = (int16_t *)out;
}

void mfcc_fill_prev_samples(struct mfcc_buffer *buf, int16_t *prev_data,
Expand Down Expand Up @@ -121,7 +121,7 @@ void mfcc_fill_prev_samples(struct mfcc_buffer *buf, int16_t *prev_data,

buf->s_avail -= prev_data_length;
buf->s_free += prev_data_length;
buf->r_ptr = in;
buf->r_ptr = (void *)in; /* int16_t pointer but direct cast is not possible */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is in the wrong ptr type, do we need to look at other changes here ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's up to @andrula-song to confirm but in the patch she used ae_int32 type to load two ae_int16 types, that's in comments a few lines above this typecast. I was wondering too if this can be correct but it appears so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, intrinsic types are non portable. Lets revisist as we do need to support AVX here (and the API would need to become more generic).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@singalsu @lgirdwood , I used to use AE_LA16X4_XC to load a 16bit * 4 data, but I found the result is not right, I think it is a bug of xtensa. So I use AE_L32_XC to load a 32bit data(16bit * 2) to replace twice AE_L16_XC, and force the datatype to ae_int16 to copy the last 16 bit if the input data size is odd.

}

void mfcc_fill_fft_buffer(struct mfcc_state *state)
Expand Down Expand Up @@ -156,7 +156,7 @@ void mfcc_fill_fft_buffer(struct mfcc_state *state)

buf->s_avail -= fft->fft_hop_size;
buf->s_free += fft->fft_hop_size;
buf->r_ptr = in;
buf->r_ptr = (int16_t *)in;

/* Copy for next time data back to overlap buffer */
idx = fft->fft_fill_start_idx + fft->fft_hop_size;
Expand Down
Loading