this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add simd directory

Thomas A 1b84088e 981b7a18

+138
+1
src/CMakeLists.txt
··· 91 91 ) 92 92 93 93 include_directories(AFTER 94 + ${CMAKE_CURRENT_SOURCE_DIR}/simd/include 94 95 ${CMAKE_CURRENT_SOURCE_DIR}/CoreAudio/include 95 96 ${CMAKE_CURRENT_SOURCE_DIR}/external/SmartCardServices/include 96 97 ${CMAKE_CURRENT_SOURCE_DIR}/external/IOKitUser/include
+26
src/simd/include/simd/simd.h
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #ifndef SIMD_H 21 + #define SIMD_H 22 + 23 + #include <simd/vector_make.h> 24 + #include <simd/vector_types.h> 25 + 26 + #endif
+33
src/simd/include/simd/vector_make.h
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #ifndef VECTOR_MAKE_H 21 + #define VECTOR_MAKE_H 22 + 23 + #include <simd/vector_types.h> 24 + 25 + inline simd_float3 simd_make_float3(float x, float y, float z) { 26 + return (simd_float3){x, y, z}; 27 + } 28 + 29 + inline simd_uint2 simd_make_uint2(unsigned int x, unsigned int y) { 30 + return (simd_uint2){x, y}; 31 + } 32 + 33 + #endif
+78
src/simd/include/simd/vector_types.h
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #ifndef VECTOR_TYPE_H 21 + #define VECTOR_TYPE_H 22 + 23 + // typedef __attribute__((ext_vector_type())) ; 24 + #define simd_struct(NAME_TYPE, A, B) \ 25 + typedef struct { \ 26 + simd_float##B columns[A]; \ 27 + } simd_##NAME_TYPE##A##x##B 28 + 29 + #define simd_type(TYPE, NAME_TYPE, SIZE) \ 30 + typedef TYPE __attribute__((ext_vector_type(SIZE))) simd_##NAME_TYPE##SIZE 31 + 32 + simd_type(int, int, 2); // simd_int2 33 + simd_type(int, int, 3); // simd_int3 34 + simd_type(int, int, 4); // simd_int4 35 + 36 + simd_type(unsigned int, uint, 2); // simd_uint2 37 + simd_type(unsigned int, uint, 3); // simd_uint3 38 + simd_type(unsigned int, uint, 4); // simd_uint4 39 + 40 + simd_type(float, float, 2); // simd_float2 41 + simd_type(float, float, 3); // simd_float3 42 + simd_type(float, float, 4); // simd_float4 43 + 44 + simd_type(double, double, 2); // simd_double2 45 + simd_type(double, double, 3); // simd_double3 46 + simd_type(double, double, 4); // simd_double4 47 + 48 + simd_struct(float, 2, 2); // simd_float2x2 49 + simd_struct(float, 3, 2); // simd_float3x2 50 + simd_struct(float, 4, 2); // simd_float4x2 51 + simd_struct(float, 2, 3); // simd_float2x3 52 + simd_struct(float, 3, 3); // simd_float3x3 53 + simd_struct(float, 4, 3); // simd_float4x3 54 + simd_struct(float, 2, 4); // simd_float2x4 55 + simd_struct(float, 3, 4); // simd_float3x4 56 + simd_struct(float, 4, 4); // simd_float4x4 57 + 58 + simd_struct(double, 2, 2); // simd_double2x2 59 + simd_struct(double, 3, 2); // simd_double3x2 60 + simd_struct(double, 4, 2); // simd_double4x2 61 + simd_struct(double, 2, 3); // simd_double2x3 62 + simd_struct(double, 3, 3); // simd_double3x3 63 + simd_struct(double, 4, 3); // simd_double4x3 64 + simd_struct(double, 2, 4); // simd_double2x4 65 + simd_struct(double, 3, 4); // simd_double3x4 66 + simd_struct(double, 4, 4); // simd_double4x4 67 + 68 + typedef struct { 69 + simd_double4 vector; 70 + } simd_quatd; 71 + 72 + typedef struct { 73 + simd_float4 vector; 74 + } simd_quatf; 75 + 76 + #undef simd_struct 77 + #undef simd_type 78 + #endif