Skip to content

Commit

Permalink
Support running SSE intrinsics on RISC-V platform (#1710)
Browse files Browse the repository at this point in the history
sse2rvv is a header file only translator which allows to run SSE on RISC-V machines
  • Loading branch information
howjmay authored Aug 25, 2024
1 parent 75e1928 commit 34f7e49
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@
[submodule "Externals/xrLuaFix"]
path = Externals/xrLuaFix
url = https://github.com/OpenXRay/xrLuaFix.git
[submodule "Externals/sse2rvv"]
path = Externals/sse2rvv
url = https://github.com/pattonkan/sse2rvv.git
3 changes: 3 additions & 0 deletions src/Common/Platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
#elif defined (_M_ARM64) || defined(__aarch64__)
# define XR_ARCHITECTURE_ARM64
# define _XRAY_ARCHITECTURE_MARKER "ARM 64-bit"
#elif defined(__riscv) || defined(__riscv__)
# define XR_ARCHITECTURE_RISCV
# define _XRAY_ARCHITECTURE_MARKER "RISC-V"
#elif defined(__powerpc64__) || defined(__ppc64__)
# define XR_ARCHITECTURE_PPC64
# define _XRAY_ARCHITECTURE_MARKER "PowerPC 64-bit"
Expand Down
2 changes: 2 additions & 0 deletions src/Layers/xrRender/DetailManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <xmmintrin.h>
#elif defined(XR_ARCHITECTURE_ARM) || defined(XR_ARCHITECTURE_ARM64)
#include "sse2neon/sse2neon.h"
#elif defined(XR_ARCHITECTURE_RISCV)
#include "sse2rvv/sse2rvv.h"
#else
#error Add your platform here
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/Layers/xrRender/ParticleEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <xmmintrin.h>
#elif defined(XR_ARCHITECTURE_ARM) || defined(XR_ARCHITECTURE_ARM64)
#include "sse2neon/sse2neon.h"
#elif defined(XR_ARCHITECTURE_RISCV)
#include "sse2rvv/sse2rvv.h"
#else
#error Add your platform here
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/xrCDB/ISpatial_q_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <xmmintrin.h>
#elif defined(XR_ARCHITECTURE_ARM) || defined(XR_ARCHITECTURE_ARM64)
#include "sse2neon/sse2neon.h"
#elif defined(XR_ARCHITECTURE_RISCV)
#include "sse2rvv/sse2rvv.h"
#else
#error Add your platform here
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/xrCDB/xrCDB_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <xmmintrin.h>
#elif defined(XR_ARCHITECTURE_ARM) || defined(XR_ARCHITECTURE_ARM64)
#include "sse2neon/sse2neon.h"
#elif defined(XR_ARCHITECTURE_RISCV)
#include "sse2rvv/sse2rvv.h"
#else
#error Add your platform here
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/xrCore/Threading/TaskManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <immintrin.h>
#elif defined(XR_ARCHITECTURE_ARM) || defined(XR_ARCHITECTURE_ARM64)
#include "sse2neon/sse2neon.h"
#elif defined(XR_ARCHITECTURE_RISCV)
#include "sse2rvv/sse2rvv.h"
#elif defined(XR_ARCHITECTURE_PPC64)
#include <xmmintrin.h>
#else
Expand Down
2 changes: 2 additions & 0 deletions src/xrParticles/noise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <xmmintrin.h>
#elif defined(XR_ARCHITECTURE_ARM) || defined(XR_ARCHITECTURE_ARM64)
#include "sse2neon/sse2neon.h"
#elif defined(XR_ARCHITECTURE_RISCV)
#include "sse2rvv/sse2rvv.h"
#else
#error Add your platform here
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/xrParticles/particle_actions_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,8 @@ extern void noise3Init();
#include <xmmintrin.h>
#elif defined(XR_ARCHITECTURE_ARM) || defined(XR_ARCHITECTURE_ARM64)
#include "sse2neon/sse2neon.h"
#elif defined(XR_ARCHITECTURE_RISCV)
#include "sse2rvv/sse2rvv.h"
#else
#error Add your platform here
#endif
Expand Down

0 comments on commit 34f7e49

Please sign in to comment.