Open iuliana-prodan opened 2 months ago
I believe the problem is that, for bkfiraf_process_hifi4
at line 77 is defined XT_LSX2XC1
only for __LESSTHANLX8__
:
#if __LESSTHANLX8__
/* Circular load with using CBEGIN1/CEND1 */
#define XT_LSX2XC1(reg, addr, offs)\
{\
ae_int32x2 t;\
AE_L32X2_XC1(t, addr, offs);\
reg = XT_AE_MOVXTFLOATX2_FROMINT32X2(t);\
}
#endif
but later is used for both cases (w/ or w/o __LESSTHANLX8__
defined - see line 168)
#if __LESSTHANLX8__
XT_LSX2XC1(h01, castxcc(ae_int32x2,pH0), 4*sizeof(float32_t));
XT_LSX2XC1(h23, castxcc(ae_int32x2,pH1), 4*sizeof(float32_t));
#else
XT_LSX2XC1(h01, pH0, 4*sizeof(float32_t));
XT_LSX2XC1(h23, pH1, 4*sizeof(float32_t));
#endif
or at line 221
#if __LESSTHANLX8__
XT_LSX2XC1(h01, castxcc(ae_int32x2,pH0), 4*sizeof(float32_t));
XT_LSX2XC1(h23, castxcc(ae_int32x2,pH1), 4*sizeof(float32_t));
#else
XT_LSX2XC1(h01, pH0, 4*sizeof(float32_t));
XT_LSX2XC1(h23, pH1, 4*sizeof(float32_t));
#endif
or line 283:
#if __LESSTHANLX8__
XT_LSX2XC1(h01, castxcc(ae_int32x2,pH0), 4*sizeof(float32_t));
XT_LSX2XC1(h23, castxcc(ae_int32x2,pH1), 4*sizeof(float32_t));
#else
XT_LSX2XC1(h01, pH0, 4*sizeof(float32_t));
XT_LSX2XC1(h23, pH1, 4*sizeof(float32_t));
#endif
@cad-audio @cad-audioNDSP can you please let me know how can I overcome this? Thanks.
Hi Iulia Prodan,
Which toolchain are you using and what is the LX version of the core used?
If you are using a toolchain earlier than RJ2024.3 (i.e the core is pre LX8), then you need to enable the flag LESSTHANLX8
In /hifi4_library/include_private/common.h
Set #define LESSTHANLX8 1
This should solve the build issue.
Hi @cad-audioNDSP,
I'm using Xtensa Toolchain version RI-2023.11-linux, Xtensa Core = hifi4_mscale_v2_0_2_prod. The core is a HiFi4 core which is LX6.
When setting LESSTHANLX8=1 the compilation is ok, I get the library. But I would like to be able to compile the library without modifying the code - just take the code, unzip and compile.
Can we make LESSTHANLX8
a different variable that can be changed from command line, as argument to make
command?
Thanks, Iulia
@cad-audioNDSP can you please make the following changes:
in common.h
(from /NDSP_HiFi4_v430/library/include_private/common.h):
diff /ndsplib-hifi4/NDSP_HiFi4/NDSP_HiFi4_v430/library/include_private/common.h ndsplib-hifi4/NDSP_HiFi4/original/NDSP_HiFi4_v430/library/include_private/common.h
35d34
< #ifndef __LESSTHANLX8__
37d35
< #endif
in makefile
(from NDSP_HiFi4_v430/build/project/xtclang/library/):
diff makefile ../../../../../original/NDSP_HiFi4_v430/build/project/xtclang/library/
126,130d125
< __LESSTHANLX8__ ?= ""
< ifneq ($(__LESSTHANLX8__), "")
< CFLAGS += -D__LESSTHANLX8__=$(__LESSTHANLX8__)
< endif
<
With these 2 changes any user can take the code and compile the library for an LX8 or less than LX8 core with a make argument, no need to change the code.
With the above modifications, for an LX6 core I'm compiling the library with:
make -e XTENSA_SYSTEM= XTENSA_CORE=hifi4_mscale_v2_0_2_prod __LESSTHANLX8__=1
I can create a pull request for this, but I have access only to the archive. So, is it possible to make these changes?
Thank you!
When compiling the NatureDSP Lib from this github repo, for the HiFi4 DSP from i.MX8MP, I get the following error: