Skip to content

Commit a6f91e4

Browse files
committed
Release 1.0.15
* Several functions optimized for AVX-512 support. * Fixed several issues reported by PVS Studio static analyzer. * Fixed syntax error in C interface, covered with tests. * Bugfix in horizontal summing functions (invalid register clobber list). * Some AMD-related optimizations. * Updated module versions in dependencies.
2 parents 65b5724 + 478e851 commit a6f91e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+4127
-690
lines changed

.cproject

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
</option>
3131
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.368930916" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
3232
<listOptionValue builtIn="false" value="LSP_TESTING"/>
33+
<listOptionValue builtIn="false" value="LSP_IDE_DEBUG"/>
3334
</option>
3435
<option id="gnu.cpp.compiler.option.dialect.std.380024909" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++11" valueType="enumerated"/>
3536
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.424525884" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
@@ -44,6 +45,7 @@
4445
</option>
4546
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1421051177" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
4647
<listOptionValue builtIn="false" value="LSP_TESTING"/>
48+
<listOptionValue builtIn="false" value="LSP_IDE_DEBUG"/>
4749
</option>
4850
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2008435369" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
4951
</tool>
@@ -85,6 +87,18 @@
8587
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.218466097" name="Resource Custom Build Step Output Type"/>
8688
</tool>
8789
</fileInfo>
90+
<fileInfo id="cdt.managedbuild.config.gnu.exe.debug.1330341797.281573242" name="avx512.cpp" rcbsApplicability="disable" resourcePath="src/main/x86/avx512.cpp" toolsToInvoke="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1715496680.752248820">
91+
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1715496680.752248820" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1715496680">
92+
<option id="gnu.cpp.compiler.option.other.other.2124416907" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -mavx512f -mavx512vl" valueType="string"/>
93+
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1847585465" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
94+
</tool>
95+
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.874817721" name="Resource Custom Build Step">
96+
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.22498286" name="Resource Custom Build Step Input Type">
97+
<additionalInput kind="additionalinputdependency" paths=""/>
98+
</inputType>
99+
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.1153584601" name="Resource Custom Build Step Output Type"/>
100+
</tool>
101+
</fileInfo>
88102
<fileInfo id="cdt.managedbuild.config.gnu.exe.debug.1330341797.356003736" name="sse4.cpp" rcbsApplicability="disable" resourcePath="src/main/x86/sse4.cpp" toolsToInvoke="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1715496680.73118722">
89103
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1715496680.73118722" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1715496680">
90104
<option id="gnu.cpp.compiler.option.other.other.824484852" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -msse4 -msse4a" valueType="string"/>
@@ -220,6 +234,7 @@
220234
</option>
221235
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.397756050" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
222236
<listOptionValue builtIn="false" value="LSP_TESTING"/>
237+
<listOptionValue builtIn="false" value="LSP_IDE_DEBUG"/>
223238
</option>
224239
<option id="gnu.cpp.compiler.option.dialect.std.2124347448" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++11" valueType="enumerated"/>
225240
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1646920213" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
@@ -234,6 +249,7 @@
234249
</option>
235250
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.392178909" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
236251
<listOptionValue builtIn="false" value="LSP_TESTING"/>
252+
<listOptionValue builtIn="false" value="LSP_IDE_DEBUG"/>
237253
</option>
238254
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1546071444" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
239255
</tool>
@@ -353,8 +369,10 @@
353369
</storageModule>
354370
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
355371
<storageModule moduleId="refreshScope" versionNumber="2">
372+
<configuration configurationName="DebugLinux"/>
356373
<configuration configurationName="Debug Linux"/>
357374
<configuration configurationName="Debug Win"/>
375+
<configuration configurationName="DebugWin"/>
358376
<configuration configurationName="Release">
359377
<resource resourceType="PROJECT" workspacePath="/lsp-dsp-lib"/>
360378
</configuration>
@@ -364,4 +382,4 @@
364382
</storageModule>
365383
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
366384
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
367-
</cproject>
385+
</cproject>

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
* RECENT CHANGES
33
*******************************************************************************
44

5+
=== 1.0.15 ===
6+
* Several functions optimized for AVX-512 support.
7+
* Fixed several issues reported by PVS Studio static analyzer.
8+
* Fixed syntax error in C interface, covered with tests.
9+
* Bugfix in horizontal summing functions (invalid register clobber list).
10+
* Some AMD-related optimizations.
11+
* Updated module versions in dependencies.
12+
513
=== 1.0.14 ===
614
* Implemented pcomplex_r2c instruction set.
715
* Updated build scripts.

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This library provides set of functions that perform SIMD-optimized
66
computing on several hardware architectures.
77

88
Currently supported set of SIMD extensions:
9-
* i586 architecture (32-bit): SSE, SSE2, SSE3, AVX, AVX2 and FMA3;
10-
* x86_64 architecture (64-bit): SSE, SSE2, SSE3, AVX, AVX2 and FMA3;
9+
* i586 architecture (32-bit): SSE, SSE2, SSE3, AVX, AVX2, FMA3 and AVX512;
10+
* x86_64 architecture (64-bit): SSE, SSE2, SSE3, AVX, AVX2, FMA3 and AVX512;
1111
* armv7 architecture (32-bit): NEON;
1212
* AArch64 architecture (64-bit): ASIMD.
1313

@@ -32,8 +32,7 @@ Current set of functions provided:
3232
* Interpolation functions;
3333
* Some set of function to work with 3D mathematics.
3434

35-
Supported platforms
36-
======
35+
## Supported platforms
3736

3837
The build and correct unit test execution has been confirmed for following platforms:
3938
* FreeBSD
@@ -42,29 +41,26 @@ The build and correct unit test execution has been confirmed for following platf
4241
* Windows 32-bit
4342
* Windows 64-bit
4443

45-
Supported architectures
46-
======
44+
## Supported architectures
4745

4846
The support of following list of hardware architectures has been implemented:
49-
* i386 (32-bit) - full support.
50-
* x86_64 (64-bit) - full support.
47+
* i386 (32-bit) - full support (AVX-512 on the way).
48+
* x86_64 (64-bit) - full support (AVX-512 on the way).
5149
* ARMv6A - full support.
5250
* ARMv7A - full support.
53-
* AArch64 - most functions.
51+
* AArch64 - full support.
5452

5553
For all other architectures the generic implementation of algorithms is used, without any
5654
architecture-specific optimizations.
5755

58-
Requirements
59-
======
56+
## Requirements
6057

6158
The following packages need to be installed for building:
6259

6360
* gcc >= 4.9
6461
* make >= 4.0
6562

66-
Building
67-
======
63+
## Building
6864

6965
To build the library, perform the following commands:
7066

@@ -112,8 +108,8 @@ To build source code archive with all possible dependencies, run:
112108
make distsrc
113109
```
114110

115-
Usage
116-
======
111+
## Usage
112+
117113

118114
Here's the code snippet of how the library can be initialized and used in C++:
119115

@@ -203,4 +199,6 @@ int main(int argc, const char **argv)
203199
204200
```
205201

202+
## SAST Tools
206203

204+
* [PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.

include/lsp-plug.in/dsp/common/3dmath/types.h

Lines changed: 82 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -29,96 +29,88 @@
2929
#define DSP_3D_MAXVALUE 1e+20f
3030
#define DSP_3D_MAXISECT 8
3131

32-
#ifdef __cplusplus
33-
namespace lsp
32+
LSP_DSP_LIB_BEGIN_NAMESPACE
33+
34+
#pragma pack(push, 1)
35+
typedef struct LSP_DSP_LIB_TYPE(point3d_t)
36+
{
37+
float x, y, z, w;
38+
} LSP_DSP_LIB_TYPE(point3d_t);
39+
40+
typedef struct LSP_DSP_LIB_TYPE(vector3d_t)
41+
{
42+
float dx, dy, dz, dw;
43+
} LSP_DSP_LIB_TYPE(vector3d_t);
44+
45+
typedef struct LSP_DSP_LIB_TYPE(color3d_t)
46+
{
47+
float r, g, b, a;
48+
} LSP_DSP_LIB_TYPE(color3d_t);
49+
50+
typedef struct LSP_DSP_LIB_TYPE(ray3d_t)
51+
{
52+
LSP_DSP_LIB_TYPE(point3d_t) z; // The start point: x, y, z = point coordinates
53+
LSP_DSP_LIB_TYPE(vector3d_t) v; // The spread vector: dx, dy, dz = direction
54+
} LSP_DSP_LIB_TYPE(ray3d_t);
55+
56+
typedef struct LSP_DSP_LIB_TYPE(bound_box3d_t)
57+
{
58+
LSP_DSP_LIB_TYPE(point3d_t) p[8]; // Bounding-box contains 8 points
59+
} LSP_DSP_LIB_TYPE(bound_box3d_t);
60+
61+
typedef struct LSP_DSP_LIB_TYPE(segment3d_t)
62+
{
63+
LSP_DSP_LIB_TYPE(point3d_t) p[2];
64+
} LSP_DSP_LIB_TYPE(segment3d_t);
65+
66+
typedef struct LSP_DSP_LIB_TYPE(triangle3d_t)
67+
{
68+
LSP_DSP_LIB_TYPE(point3d_t) p[3]; // Vertexes: x, y, z = vertex coordinates, w = length of the corresponding edge
69+
LSP_DSP_LIB_TYPE(vector3d_t) n; // Normal: dx, dy, dz = normal coordinates, dw = plane equation coefficient
70+
} LSP_DSP_LIB_TYPE(triangle3d_t);
71+
72+
typedef struct LSP_DSP_LIB_TYPE(matrix3d_t)
73+
{
74+
float m[16]; // Matrix data
75+
} LSP_DSP_LIB_TYPE(matrix3d_t);
76+
77+
typedef struct LSP_DSP_LIB_TYPE(raw_triangle_t)
78+
{
79+
LSP_DSP_LIB_TYPE(point3d_t) v[3];
80+
} LSP_DSP_LIB_TYPE(raw_triangle_t);
81+
82+
#pragma pack(pop)
83+
84+
typedef enum LSP_DSP_LIB_TYPE(axis_orientation_t)
3485
{
35-
namespace dsp
36-
{
37-
#endif /* __cplusplus */
38-
39-
#pragma pack(push, 1)
40-
typedef struct LSP_DSP_LIB_TYPE(point3d_t)
41-
{
42-
float x, y, z, w;
43-
} LSP_DSP_LIB_TYPE(point3d_t);
44-
45-
typedef struct LSP_DSP_LIB_TYPE(vector3d_t)
46-
{
47-
float dx, dy, dz, dw;
48-
} LSP_DSP_LIB_TYPE(vector3d_t);
49-
50-
typedef struct LSP_DSP_LIB_TYPE(color3d_t)
51-
{
52-
float r, g, b, a;
53-
} LSP_DSP_LIB_TYPE(color3d_t);
54-
55-
typedef struct LSP_DSP_LIB_TYPE(ray3d_t)
56-
{
57-
LSP_DSP_LIB_TYPE(point3d_t) z; // The start point: x, y, z = point coordinates
58-
LSP_DSP_LIB_TYPE(vector3d_t) v; // The spread vector: dx, dy, dz = direction
59-
} LSP_DSP_LIB_TYPE(ray3d_t);
60-
61-
typedef struct LSP_DSP_LIB_TYPE(bound_box3d_t)
62-
{
63-
LSP_DSP_LIB_TYPE(point3d_t) p[8]; // Bounding-box contains 8 points
64-
} LSP_DSP_LIB_TYPE(bound_box3d_t);
65-
66-
typedef struct LSP_DSP_LIB_TYPE(segment3d_t)
67-
{
68-
LSP_DSP_LIB_TYPE(point3d_t) p[2];
69-
} LSP_DSP_LIB_TYPE(segment3d_t);
70-
71-
typedef struct LSP_DSP_LIB_TYPE(triangle3d_t)
72-
{
73-
LSP_DSP_LIB_TYPE(point3d_t) p[3]; // Vertexes: x, y, z = vertex coordinates, w = length of the corresponding edge
74-
LSP_DSP_LIB_TYPE(vector3d_t) n; // Normal: dx, dy, dz = normal coordinates, dw = plane equation coefficient
75-
} LSP_DSP_LIB_TYPE(triangle3d_t);
76-
77-
typedef struct LSP_DSP_LIB_TYPE(matrix3d_t)
78-
{
79-
float m[16]; // Matrix data
80-
} LSP_DSP_LIB_TYPE(matrix3d_t);
81-
82-
typedef struct LSP_DSP_LIB_TYPE(raw_triangle_t)
83-
{
84-
LSP_DSP_LIB_TYPE(point3d_t) v[3];
85-
} LSP_DSP_LIB_TYPE(raw_triangle_t);
86-
87-
#pragma pack(pop)
88-
89-
typedef enum LSP_DSP_LIB_TYPE(axis_orientation_t)
90-
{
91-
AO3D_POS_X_FWD_POS_Y_UP,
92-
AO3D_POS_X_FWD_POS_Z_UP,
93-
AO3D_POS_X_FWD_NEG_Y_UP,
94-
AO3D_POS_X_FWD_NE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,
100+
AO3D_NEG_Y_FWD_POS_Z_UP,
101+
AO3D_NEG_Y_FWD_NEG_X_UP,
102+
AO3D_NEG_Y_FWD_NEG_Z_UP,
103+
104+
AO3D_POS_Z_FWD_POS_X_UP,
105+
AO3D_POS_Z_FWD_POS_Y_UP,
106+
AO3D_POS_Z_FWD_NEG_X_UP,
107+
AO3D_POS_Z_FWD_NEG_Y_UP,
108+
AO3D_NEG_Z_FWD_POS_X_UP,
109+
AO3D_NEG_Z_FWD_POS_Y_UP,
110+
AO3D_NEG_Z_FWD_NEG_X_UP,
111+
AO3D_NEG_Z_FWD_NEG_Y_UP
112+
} LSP_DSP_LIB_TYPE(axis_orientation_t);
113+
114+
LSP_DSP_LIB_END_NAMESPACE
123115

124116
#endif /* LSP_PLUG_IN_DSP_COMMON_3DMATH_TYPES_H_ */

include/lsp-plug.in/dsp/common/bitmap.h

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,24 @@
2424

2525
#include <lsp-plug.in/dsp/common/types.h>
2626

27-
#ifdef __cplusplus
28-
namespace lsp
27+
LSP_DSP_LIB_BEGIN_NAMESPACE
28+
29+
typedef struct LSP_DSP_LIB_TYPE(bitmap_t)
2930
{
30-
namespace dsp
31-
{
32-
#endif /* __cplusplus */
33-
34-
typedef struct LSP_DSP_LIB_TYPE(bitmap_t)
35-
{
36-
int32_t width;
37-
int32_t height;
38-
int32_t stride;
39-
uint8_t *data;
40-
} LSP_DSP_LIB_TYPE(bitmap_t);
41-
42-
43-
typedef void (* LSP_DSP_LIB_TYPE(bitmap_render_func_t))(
44-
LSP_DSP_LIB_TYPE(bitmap_t) *dst,
45-
const LSP_DSP_LIB_TYPE(bitmap_t) *src,
46-
ssize_t x,
47-
ssize_t y);
48-
#ifdef __cplusplus
49-
} /* namespace dsp */
50-
} /* namespace lsp */
51-
#endif /* __cplusplus */
31+
int32_t width;
32+
int32_t height;
33+
int32_t stride;
34+
uint8_t *data;
35+
} LSP_DSP_LIB_TYPE(bitmap_t);
36+
37+
38+
typedef void (* LSP_DSP_LIB_TYPE(bitmap_render_func_t))(
39+
LSP_DSP_LIB_TYPE(bitmap_t) *dst,
40+
const LSP_DSP_LIB_TYPE(bitmap_t) *src,
41+
ssize_t x,
42+
ssize_t y);
43+
44+
LSP_DSP_LIB_END_NAMESPACE
5245

5346
#include <lsp-plug.in/dsp/common/bitmap/b1b8.h>
5447
#include <lsp-plug.in/dsp/common/bitmap/b2b8.h>

include/lsp-plug.in/dsp/common/bitmap/b1b8.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* Put the source 1-bit bitmap to destination 8-bit bitmap,
2929
* the result pixel value will be computed as: result[i] = src[i]
3030
*/
31-
LSP_DSP_LIB_SYMBOL(void, bitmap_put_b1b8, LSP_DSP_LIB_TYPE(LSP_DSP_LIB_TYPE(bitmap_t)) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y);
31+
LSP_DSP_LIB_SYMBOL(void, bitmap_put_b1b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y);
3232

3333
/**
3434
* Put the source 1-bit bitmap to destination 8-bit bitmap,

0 commit comments

Comments
 (0)