Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion doc/rst/src/reference/notes.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2024 XMOS LIMITED.
// Copyright 2021-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

// This file exists as a compatibility work-around between vanilla Doxygen and
Expand Down
2 changes: 1 addition & 1 deletion examples/app_bfp_demo/src/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.


Expand Down
2 changes: 1 addition & 1 deletion examples/app_fft_demo/src/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.


Expand Down
2 changes: 1 addition & 1 deletion examples/app_filter_demo/src/filter_16bit_fir.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.


Expand Down
2 changes: 1 addition & 1 deletion examples/app_filter_demo/src/filter_32bit_biquad.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.


Expand Down
2 changes: 1 addition & 1 deletion examples/app_filter_demo/src/filter_32bit_fir.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.


Expand Down
2 changes: 1 addition & 1 deletion examples/app_filter_demo/src/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/app_vect_demo/src/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/app_vect_demo/src/vect_complex_s16_example.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.


Expand Down
2 changes: 1 addition & 1 deletion examples/app_vect_demo/src/vect_s32_example.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.


Expand Down
6 changes: 4 additions & 2 deletions lib_xcore_math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ file( GLOB_RECURSE SOURCES_C "src/vect/*.c"
"src/filter/*.c"
"src/scalar/*.c" )
file( GLOB_RECURSE SOURCES_CPP "src/*.cpp" )
file( GLOB_RECURSE SOURCES_ASM "src/*.S" )
file( GLOB_RECURSE SOURCES_ASM_XS3 "src/arch/xs3/*.S" )
file( GLOB_RECURSE SOURCES_ASM_VX4B "src/arch/vx4b/*.S" )
file( GLOB_RECURSE SOURCES_REF "src/arch/ref/*.c" )

add_library( ${LIB_NAME} STATIC )
Expand All @@ -24,7 +25,8 @@ target_sources( ${LIB_NAME}
PRIVATE
${SOURCES_C}
${SOURCES_CPP}
$<$<PLATFORM_ID:XCORE_XS3A>:${SOURCES_ASM}>
$<$<PLATFORM_ID:XCORE_XS3A>:${SOURCES_ASM_XS3}>
$<$<PLATFORM_ID:XCORE_VX4B>:${SOURCES_ASM_VX4B}>
$<$<PLATFORM_ID:Linux>:${SOURCES_REF}>
$<$<PLATFORM_ID:Darwin>:${SOURCES_REF}>
$<$<PLATFORM_ID:Windows>:${SOURCES_REF}>
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xcore_math.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 XMOS LIMITED.
// Copyright 2024-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#ifndef _XCORE_MATH_H_
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/_support/dct_impl.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/_support/fft_impl.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/api.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2022 XMOS LIMITED.
// Copyright 2021-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/bfp/bfp.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/bfp/bfp_complex_s16.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/bfp/bfp_complex_s32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/bfp/bfp_misc.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2022 XMOS LIMITED.
// Copyright 2021-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/bfp/bfp_s16.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/bfp/bfp_s32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/dct.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/fft.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/filter.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/q_format.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 XMOS LIMITED.
// Copyright 2022-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/scalar/f32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/scalar/float_complex_s16.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/scalar/float_complex_s32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/scalar/float_s32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/scalar/s16.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/scalar/s32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/scalar/scalar.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/scalar/scalar_misc.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/types.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
8 changes: 6 additions & 2 deletions lib_xcore_math/api/xmath/util.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down Expand Up @@ -238,12 +238,16 @@ void xs3_memcpy(
static inline unsigned cls(
const int32_t a)
{
#ifdef __XS3A__
#if defined(__XS3A__)

unsigned res;
asm( "cls %0, %1" : "=r"(res) : "r"(a) );
return res;
#elif defined(__VX4B__)

unsigned res;
asm( "xm.cls %0, %1" : "=r"(res) : "r"(a) );
return res;
#else

if(a == 0 || a == -1)
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/chunk_s32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_complex_s16.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_complex_s16_prepare.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_complex_s32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_complex_s32_prepare.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_f32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_mixed.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_s16.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_s16_prepare.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_s32.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_s32_prepare.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2022 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/vect/vect_s8.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/xmath.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion lib_xcore_math/api/xmath/xmath_conf.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down
20 changes: 18 additions & 2 deletions lib_xcore_math/api/xmath/xs3/vpu_info.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2024 XMOS LIMITED.
// Copyright 2020-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#pragma once
Expand Down Expand Up @@ -72,7 +72,11 @@ enum {
*
* @ingroup xs3_vpu_info
*/
#define VPU_INT8_MIN ( -0x7F )
#if defined(__VX4B__)
#define VPU_INT8_MIN ( INT8_MIN)
#else
#define VPU_INT8_MIN ( -0x7F )
#endif
/** The upper saturation bound for 16-bit elements
*
* @ingroup xs3_vpu_info
Expand All @@ -82,7 +86,11 @@ enum {
*
* @ingroup xs3_vpu_info
*/
#if defined(__VX4B__)
#define VPU_INT16_MIN ( INT16_MIN)
#else
#define VPU_INT16_MIN ( -0x7FFF )
#endif
/** The upper saturation bound for 32-bit elements and 32-bit accumulators
*
* @ingroup xs3_vpu_info
Expand All @@ -92,7 +100,11 @@ enum {
*
* @ingroup xs3_vpu_info
*/
#if defined(__VX4B__)
#define VPU_INT32_MIN ( INT32_MIN)
#else
#define VPU_INT32_MIN ( -0x7FFFFFFF )
#endif
/** The upper saturation bound for 40-bit accumulators
*
* @ingroup xs3_vpu_info
Expand All @@ -102,7 +114,11 @@ enum {
*
* @ingroup xs3_vpu_info
*/
#if defined(__VX4B__)
#define VPU_INT40_MIN ( -0x8000000000LL)
#else
#define VPU_INT40_MIN ( -0x7FFFFFFFFFLL )
#endif

/**
* Number of accumulator bits in each operating mode.
Expand Down
Loading