Bibliothèque mathématique sur les vecteurs et formules trigonométriques optimisées en assembleur SSE et AVX

Présentation
Bonjour à tous !

Il s'agit d'une bibliothèque de gestion et calcul des vecteurs 2D, 3D et 4D. Elle prend aussi en charge les matrices, quaternions, plans homogènes, "BoundingBox", etc. Elle comprend également une unité pour le calcul rapide par approximation des sinus, cosinus, arcos, atan2, etc.

Cette bibliothèque est compatible avec les environnements Linux, Windows 32 et 64 bits.

Le projet principal à compiler est fondé sur les classes "FPCUnit" de FPC et Lazarus pour des tests unitaires, ce qui nous permet de vérifier nos fonctions, mais aussi de faire des tests de performances pour différents formats de fichiers (csv, bbcode, html, markdown).

À l'heure actuelle, seules les versions SSE sont mises à jour. Les versions AVX le seront après nos tests définitifs (par défaut, le projet est configuré pour utiliser le jeu d'instructions SSE version 3).

Pour activer les fonctions trigonométriques "rapides", if faut ajouter dans les options personnalisées du projet la commande -dUSE_FASTMATH.

Si vous avez des questions, des problèmes, ou si le projet vous intéresse, alors n'hésitez pas à me joindre !
Téléchargement
Compatibilité
Linux Windows
1  0 
Téléchargé 28 fois Voir le commentaire
Détails
Avatar de Jérôme D
Membre chevronné
Voir tous les téléchargements de l'auteur
Licence : Autre
Date de mise en ligne : 21 janvier 2018




Avatar de JP CASSOU JP CASSOU - Membre habitué https://www.developpez.com
le 19/06/2018 à 16:56
Bjr à vous,

Ne compile pas chez moi (Win7 64, Lazarus 32 bits, FPC 3.0.4)

procedure TGLZVector4f.pAdd(constref A: TGLZVector4f); assembler; nostackframe; register;

Hint: (11030) Start of reading config file C:\lazarus\fpc\3.0.4\bin\i386-win32\fpc.cfg
Hint: (11031) End of reading config file C:\lazarus\fpc\3.0.4\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 3.0.4 [2017/12/03] for i386
Copyright (c) 1993-2017 by Florian Klaempfl and others
Note: (11020) Switching assembler to default source writing assembler
(1002) Target OS: Win32 for i386
(3104) Compiling VectorClassesTimingTest32.lpr
(3104) Compiling Vector2fFunctionalTest.pas
(3104) Compiling BaseTestCase.pas
(3104) Compiling native.pas
(3104) Compiling C:\lazarus\components\VectorMath\VectorClasses\GLZVectorMath.pas
(3104) Compiling C:\lazarus\components\VectorMath\VectorClasses\GLZMath.pas
(3104) Compiling C:\lazarus\components\VectorMath\VectorClasses\GLZFastMath.pas
C:\lazarus\components\VectorMath\VectorClasses\fastmath_native_imp.inc(613,21) Hint: (4035) Mixing signed expressions and longwords gives a 64bit result
(9009) Assembling glzfastmath
C:\lazarus\components\VectorMath\VectorClasses\GLZMath.pas(958,5) Note: (5025) Local variable "i" not used
C:\lazarus\components\VectorMath\VectorClasses\GLZMath.pas(1432,5) Note: (5025) Local variable "s" not used
(9009) Assembling glzmath
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector2f_intel32_sse_imp.inc(164,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector2f_intel32_sse_imp.inc(173,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector2f_intel32_sse_imp.inc(184,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector2f_intel32_sse_imp.inc(194,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(208,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(242,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(279,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(306,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(334,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(403,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(416,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(611,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(747,27) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(770,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(771,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(791,25) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(792,25) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(793,25) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(831,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(839,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(847,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(855,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(863,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(863,28) Error: (5002) Duplicate identifier "pAdd"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(863,28) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 831
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(872,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(872,28) Error: (5002) Duplicate identifier "pSub"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(872,28) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 839
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(881,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(881,28) Error: (5002) Duplicate identifier "pMul"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(881,28) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 847
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(890,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(890,28) Error: (5002) Duplicate identifier "pDiv"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(890,28) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 855
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(899,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(907,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(914,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(921,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(929,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(961,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(994,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1002,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1002,28) Error: (5002) Duplicate identifier "pMin"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1002,28) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 994
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1011,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1019,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1019,28) Error: (5002) Duplicate identifier "pMax"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1019,28) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 1011
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1028,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1038,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1038,30) Error: (5002) Duplicate identifier "pClamp"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1038,30) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 1028
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1050,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4f_intel32_sse_imp.inc(1060,24) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4i_intel32_sse_imp.inc(332,18) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4i_intel32_sse_imp.inc(333,18) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vector4i_intel32_sse_imp.inc(334,18) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_vectorhelper_intel32_sse_imp.inc(16,20) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_hmgplane_intel32_sse_imp.inc(137,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_hmgplane_intel32_sse_imp.inc(152,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_matrix4f_intel32_sse_imp.inc(457,23) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_native_imp.inc(209,9) Warning: (5036) Local variable "q" does not seem to be initialized
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(3,31) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(3,31) Error: (4003) Type identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(11,31) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(11,32) Error: (5002) Duplicate identifier "$plus"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(11,32) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 3
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(11,31) Error: (4003) Type identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(20,31) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(20,31) Error: (4003) Type identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(28,31) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(28,32) Error: (5002) Duplicate identifier "$minus"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(28,32) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 20
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(28,31) Error: (4003) Type identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(37,31) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(37,32) Error: (5002) Duplicate identifier "$minus"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(37,32) Hint: (5003) Identifier already defined in unit GLZVECTORMATH at line 20
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(37,31) Error: (4003) Type identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(101,31) Error: (3048) function header doesn't match any method of this class "operator *(constref TGLZQuaternion;constref Single):<record type>; Register;"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(46,31) Error: (5088) Found declaration: operator *(constref TGLZQuaternion;constref TGLZQuaternion):<record type>;
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(110,31) Error: (3047) method identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(110,31) Error: (4003) Type identifier expected
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(161,24) Warning: (7121) Check size of memory operand "movss: memory-operand-size is 32 bits, but expected [128 bits]"
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(165,25) Error: (3048) function header doesn't match any method of this class "Normalize:<record type>;"
C:\lazarus\components\VectorMath\VectorClasses\GLZVectorMath.pas(2491,15) Error: (5088) Found declaration: Normalize;
C:\lazarus\components\VectorMath\VectorClasses\vectormath_quaternion_intel32_sse_imp.inc(369,11) Error: (4103) Invalid assignment, procedures return no value
C:\lazarus\components\VectorMath\VectorClasses\GLZVectorMath.pas(3412,57) Hint: (4035) Mixing signed expressions and longwords gives a 64bit result
GLZVectorMath.pas(3448) Fatal: (10026) There were 49 errors compiling module, stopping
Fatal: (1018) Compilation aborted
An unhandled exception occurred at $00000000:
EAccessViolation: Access violation
$00000000

Error: C:\lazarus\fpc\3.0.4\bin\i386-win32\ppc386.exe returned an error exitcode

 
Developpez.com décline toute responsabilité quant à l'utilisation des différents éléments téléchargés.
Responsables bénévoles de la rubrique Pascal : Gilles Vasseur - Alcatîz -