Skip to content

Commit a8e8c83

Browse files
committed
remove avx2 requirement
1 parent 790af4d commit a8e8c83

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ git submodule add https://github.com/TheNumbat/rpp
1717
Then add the following lines to your CMakeLists.txt:
1818

1919
```cmake
20-
add_subdirectory(rpp)
20+
add_subdirectory(rpp/rpp)
2121
target_link_libraries($your_target PRIVATE rpp)
2222
target_include_directories($your_target PRIVATE "rpp")
2323
```
@@ -60,10 +60,10 @@ For faster parallel builds, you can instead generate [ninja](https://ninja-build
6060

6161
Only the following configurations are supported:
6262

63-
| OS | Compiler | Arch |
64-
|---------|-------------|------|
65-
| Windows | MSVC 19.37+ | AVX2 |
66-
| Linux | Clang 17+ | AVX2 |
63+
| OS | Compiler | Arch |
64+
|---------|-------------|--------|
65+
| Windows | MSVC 19.37+ | x86_64 |
66+
| Linux | Clang 17+ | x86_64 |
6767

6868
Other configurations (macOS, aarch64, GCC, etc.) may be added in the future.
6969

rpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ if(MSVC)
8787
string(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
8888

8989
target_compile_definitions(rpp PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX _HAS_EXCEPTIONS=0)
90-
target_compile_options(rpp PRIVATE /arch:AVX2 /MP /W4 /GR- /GS- /EHa- /wd4201)
90+
target_compile_options(rpp PRIVATE /MP /W4 /GR- /GS- /EHa- /wd4201)
9191
elseif(CLANG)
9292
if(CLANG_VERSION_MAJOR LESS 17)
9393
message(FATAL_ERROR "Unsupported Clang version: only 17+ is supported.")
9494
endif()
9595

96-
target_compile_options(rpp PRIVATE -mavx2 -Wall -Wextra -fno-exceptions -fno-rtti)
96+
target_compile_options(rpp PRIVATE -Wall -Wextra -fno-exceptions -fno-rtti)
9797
else()
9898
message(FATAL_ERROR "Unsupported compiler: only MSVC and Clang are supported.")
9999
endif()

rpp/base.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@
5353
#error "Unsupported architecture: only x64 is supported."
5454
#endif
5555

56-
#ifdef __AVX2__
57-
#define RPP_ARCH_AVX2
58-
#else
59-
#error "Unsupported architecture: AVX2 is required."
60-
#endif
61-
6256
#define null nullptr
6357

6458
namespace rpp {

rpp/simd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace rpp::SIMD {
77

88
struct F32x4 {
9+
// Assumes SSE4.2 is supported.
10+
911
alignas(16) f32 data[4];
1012

1113
[[nodiscard]] static F32x4 set1(f32 v) noexcept;
@@ -27,6 +29,8 @@ struct F32x4 {
2729
};
2830

2931
struct F32x8 {
32+
// Assumes AVX2 is supported.
33+
3034
alignas(32) f32 data[8];
3135

3236
[[nodiscard]] static F32x8 set1(f32 v) noexcept;

0 commit comments

Comments
 (0)