From 83fff1652d2bd5367a3971b39cb06e52613e8fa8 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Sat, 17 Feb 2024 20:46:29 -0500 Subject: [PATCH] he's a beautuful lad though -michael --- include/blt/std/allocator.h | 2 +- include/blt/std/simd.h | 24 ++++++++++++++++++++++++ src/blt/parse/obj_loader.cpp | 2 +- src/blt/std/simd.cpp | 26 ++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 src/blt/std/simd.cpp diff --git a/include/blt/std/allocator.h b/include/blt/std/allocator.h index b5536bc..4609eac 100644 --- a/include/blt/std/allocator.h +++ b/include/blt/std/allocator.h @@ -352,7 +352,7 @@ namespace blt } }; - template + template class multi_type_area_allocator; template<> diff --git a/include/blt/std/simd.h b/include/blt/std/simd.h index f4fd4ba..4db4611 100644 --- a/include/blt/std/simd.h +++ b/include/blt/std/simd.h @@ -19,8 +19,32 @@ #ifndef BLT_SIMD_H #define BLT_SIMD_H +#if defined(__AVX__) || defined(__AVX2__) + + #include + +#else + #warning AVX is not available. +#endif + #include +namespace blt +{ + class simd + { + public: + using type = TYPE; + private: +#if defined(__AVX__) || defined(__AVX2__) + __m256d data; +#else +#endif + public: + + }; + +} #endif // BLT_SIMD_H diff --git a/src/blt/parse/obj_loader.cpp b/src/blt/parse/obj_loader.cpp index 6d85842..0a012e2 100644 --- a/src/blt/parse/obj_loader.cpp +++ b/src/blt/parse/obj_loader.cpp @@ -246,7 +246,7 @@ namespace blt::parse } else { BLT_TRACE("Using cached data; %d; map size: %d", loc->second, vertex_data.size()); - const auto& d = vertex_data[loc->second]; + //const auto& d = vertex_data[loc->second]; BLT_TRACE("Vertex: (%f, %f, %f), UV: (%f, %f), Normal: (%f, %f, %f)", d.vertex.x(), d.vertex.y(), d.vertex.z(), d.uv.x(), d.uv.y(), d.normal.x(), d.normal.y(), d.normal.z()); arr[pair.first] = loc->second; diff --git a/src/blt/std/simd.cpp b/src/blt/std/simd.cpp new file mode 100644 index 0000000..1c89acb --- /dev/null +++ b/src/blt/std/simd.cpp @@ -0,0 +1,26 @@ +/* + * + * Copyright (C) 2024 Brett Terpstra + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include + +namespace blt +{ + + + +} \ No newline at end of file