From 69db9a8d7975b118a94e9d09780f1db3b4dc8e0a Mon Sep 17 00:00:00 2001 From: "Werner, Stefan" Date: Tue, 26 May 2026 12:09:52 +0200 Subject: [PATCH 01/15] Added Windows on ARM CI workflow --- .github/workflows/public.continuous.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index 3e87839644..a9c1c660ea 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -113,4 +113,23 @@ jobs: cmake -D BUILD_TBB_FROM_SOURCE=ON -D EMBREE_EXTRA_OPTIONS="-DBUILD_TESTING=ON -DEMBREE_TUTORIALS=ON -DEMBREE_ISPC_SUPPORT=ON -DEMBREE_TESTING_INTENSITY=3" ../superbuild cmake --build . cd embree/build - ctest \ No newline at end of file + ctest + + windows-11-arm: + runs-on: windows-11-arm + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Build and Run + shell: pwsh + run: | + $opts = "-DBUILD_TESTING=ON" + $opts += " -DEMBREE_TUTORIALS=OFF" + $opts += " -DEMBREE_ISPC_SUPPORT=OFF" + $opts += " -DEMBREE_TESTING_INTENSITY=2" + $opts += " -DCMAKE_BUILD_TYPE=Release" + + cmake -S superbuild -B build -D BUILD_TBB_FROM_SOURCE=ON -D EMBREE_EXTRA_OPTIONS="$opts" + cmake --build build --config Release + ctest --test-dir build/embree/build -C Release --output-on-failure \ No newline at end of file From 738773d00a5870302211a862f5af9067fa5e2969 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 10:16:55 +0000 Subject: [PATCH 02/15] Fix windows-11-arm CI by raising superbuild CMake minimum Agent-Logs-Url: https://github.com/RenderKit/embree/sessions/ead49f65-088a-401f-b6ff-a821bf4b5b25 Co-authored-by: stefanatwork <93931354+stefanatwork@users.noreply.github.com> --- superbuild/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superbuild/CMakeLists.txt b/superbuild/CMakeLists.txt index 70e1a02774..e315ec9366 100644 --- a/superbuild/CMakeLists.txt +++ b/superbuild/CMakeLists.txt @@ -3,7 +3,7 @@ ## Global settings ## -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} From aae45d3ca35e6385796bdb6f5e62779c6c037ac0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 10:37:17 +0000 Subject: [PATCH 03/15] Fix ARM64 macro detection for Windows on ARM builds Agent-Logs-Url: https://github.com/RenderKit/embree/sessions/71a93d2a-2cfa-4e53-ad36-40765438ddee Co-authored-by: stefanatwork <93931354+stefanatwork@users.noreply.github.com> --- common/sys/intrinsics.h | 2 +- common/sys/platform.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/sys/intrinsics.h b/common/sys/intrinsics.h index f5074bb29d..c0d0fbe5c9 100644 --- a/common/sys/intrinsics.h +++ b/common/sys/intrinsics.h @@ -9,7 +9,7 @@ #include #endif -#if defined(__ARM_NEON) +#if defined(__ARM_NEON) || defined(__aarch64__) #include "../simd/arm/emulation.h" #else #include diff --git a/common/sys/platform.h b/common/sys/platform.h index 6dc0cf3318..1a840938bb 100644 --- a/common/sys/platform.h +++ b/common/sys/platform.h @@ -57,6 +57,11 @@ #define __X86_ASM__ #endif +/* normalize ARM64 platform macro */ +#if defined(_M_ARM64) || defined(_M_ARM64EC) +#define __aarch64__ +#endif + /* detect 64 bit platform */ #if defined(__X86_64__) || defined(__aarch64__) #define __64BIT__ From b1797442917ba0f1726d096b083712b0e305056c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 09:55:18 +0000 Subject: [PATCH 04/15] Fix windows-11-arm CI failures on MSVC and test config --- .github/workflows/public.continuous.yml | 2 +- common/simd/arm/sse2neon.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index a9c1c660ea..d698e4289b 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -125,7 +125,7 @@ jobs: shell: pwsh run: | $opts = "-DBUILD_TESTING=ON" - $opts += " -DEMBREE_TUTORIALS=OFF" + $opts += " -DEMBREE_TUTORIALS=ON" $opts += " -DEMBREE_ISPC_SUPPORT=OFF" $opts += " -DEMBREE_TESTING_INTENSITY=2" $opts += " -DCMAKE_BUILD_TYPE=Release" diff --git a/common/simd/arm/sse2neon.h b/common/simd/arm/sse2neon.h index 35e50a6e3e..f56efe1d6b 100644 --- a/common/simd/arm/sse2neon.h +++ b/common/simd/arm/sse2neon.h @@ -81,7 +81,11 @@ #define _sse2neon_likely(x) __builtin_expect(!!(x), 1) #define _sse2neon_unlikely(x) __builtin_expect(!!(x), 0) #else /* non-GNU / non-clang compilers */ +#if defined(_MSC_VER) +#pragma message("Macro name collisions may happen with unsupported compiler.") +#else #warning "Macro name collisions may happen with unsupported compiler." +#endif #ifndef FORCE_INLINE #define FORCE_INLINE static inline #endif From 3fe1c28d7f383b27827d7868b186ca264e423cf3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 10:05:23 +0000 Subject: [PATCH 05/15] Re-trigger CI From 7a1e725b3eba57deb9f654b4a8b31097172a50c2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 10:55:01 +0000 Subject: [PATCH 06/15] Force multi-config generator for windows-11-arm CI job --- .github/workflows/public.continuous.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index d698e4289b..f520fd7f05 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -130,6 +130,6 @@ jobs: $opts += " -DEMBREE_TESTING_INTENSITY=2" $opts += " -DCMAKE_BUILD_TYPE=Release" - cmake -S superbuild -B build -D BUILD_TBB_FROM_SOURCE=ON -D EMBREE_EXTRA_OPTIONS="$opts" + cmake -S superbuild -B build -G "Ninja Multi-Config" -D BUILD_TBB_FROM_SOURCE=ON -D EMBREE_EXTRA_OPTIONS="$opts" cmake --build build --config Release ctest --test-dir build/embree/build -C Release --output-on-failure \ No newline at end of file From 7a9d06f7c1703fcfa6b99b0ab514310006374e66 Mon Sep 17 00:00:00 2001 From: Stefan Werner Date: Wed, 27 May 2026 17:25:14 +0200 Subject: [PATCH 07/15] turned off TBB fo rWindows on Arm builds --- .github/workflows/public.continuous.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index f520fd7f05..70d4f8482f 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -127,6 +127,7 @@ jobs: $opts = "-DBUILD_TESTING=ON" $opts += " -DEMBREE_TUTORIALS=ON" $opts += " -DEMBREE_ISPC_SUPPORT=OFF" + $opts += " -DEMBREE_TASKING_SYSTEM=INTERNAL" $opts += " -DEMBREE_TESTING_INTENSITY=2" $opts += " -DCMAKE_BUILD_TYPE=Release" From be8a10218e7a2c1c9cc02568cb079cadfc7f3979 Mon Sep 17 00:00:00 2001 From: Stefan Werner Date: Wed, 27 May 2026 17:25:19 +0200 Subject: [PATCH 08/15] turned off TBB fo rWindows on Arm builds From 6a53e667696520cbff541e239786423422d99844 Mon Sep 17 00:00:00 2001 From: "Werner, Stefan" Date: Wed, 27 May 2026 17:31:01 +0200 Subject: [PATCH 09/15] disabling dependencies in arm ci build --- .github/workflows/public.continuous.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index 70d4f8482f..c8e1af35ef 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -131,6 +131,6 @@ jobs: $opts += " -DEMBREE_TESTING_INTENSITY=2" $opts += " -DCMAKE_BUILD_TYPE=Release" - cmake -S superbuild -B build -G "Ninja Multi-Config" -D BUILD_TBB_FROM_SOURCE=ON -D EMBREE_EXTRA_OPTIONS="$opts" + cmake -B build -G "Ninja" -D EMBREE_EXTRA_OPTIONS="$opts" . cmake --build build --config Release ctest --test-dir build/embree/build -C Release --output-on-failure \ No newline at end of file From a11df23f8b95fdef9afe99f553411f3ac7beda96 Mon Sep 17 00:00:00 2001 From: "Werner, Stefan" Date: Wed, 27 May 2026 17:58:55 +0200 Subject: [PATCH 10/15] more CI fixes --- .github/workflows/public.continuous.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index c8e1af35ef..7270d95a8b 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -131,6 +131,6 @@ jobs: $opts += " -DEMBREE_TESTING_INTENSITY=2" $opts += " -DCMAKE_BUILD_TYPE=Release" - cmake -B build -G "Ninja" -D EMBREE_EXTRA_OPTIONS="$opts" . + cmake -B build -G "Ninja" $opts.Split(" ") . cmake --build build --config Release - ctest --test-dir build/embree/build -C Release --output-on-failure \ No newline at end of file + ctest --test-dir build -C Release --output-on-failure \ No newline at end of file From d281db16c74439f9d7fd01a153d45e4518511130 Mon Sep 17 00:00:00 2001 From: "Werner, Stefan" Date: Wed, 27 May 2026 18:27:02 +0200 Subject: [PATCH 11/15] Switching to MSBuild --- .github/workflows/public.continuous.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index 7270d95a8b..4b3110dbdf 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -129,8 +129,7 @@ jobs: $opts += " -DEMBREE_ISPC_SUPPORT=OFF" $opts += " -DEMBREE_TASKING_SYSTEM=INTERNAL" $opts += " -DEMBREE_TESTING_INTENSITY=2" - $opts += " -DCMAKE_BUILD_TYPE=Release" - cmake -B build -G "Ninja" $opts.Split(" ") . + cmake -B build -G "Visual Studio 17 2022" -A ARM64 $opts.Split(" ") . cmake --build build --config Release ctest --test-dir build -C Release --output-on-failure \ No newline at end of file From b7f4dbb74442e7ae2c6dba42fdc1b7d554015f6c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 16:36:53 +0000 Subject: [PATCH 12/15] Use ClangCL toolchain for windows-11-arm CI build --- .github/workflows/public.continuous.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index 4b3110dbdf..468ac917b1 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -130,6 +130,6 @@ jobs: $opts += " -DEMBREE_TASKING_SYSTEM=INTERNAL" $opts += " -DEMBREE_TESTING_INTENSITY=2" - cmake -B build -G "Visual Studio 17 2022" -A ARM64 $opts.Split(" ") . + cmake -B build -G "Visual Studio 17 2022" -A ARM64 -T ClangCL $opts.Split(" ") . cmake --build build --config Release ctest --test-dir build -C Release --output-on-failure \ No newline at end of file From 58ea87be65b6cf4631238a43a09ded958f1057ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 16:47:29 +0000 Subject: [PATCH 13/15] Revert ClangCL toolset for windows-11-arm CI --- .github/workflows/public.continuous.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index 468ac917b1..766dd15243 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -130,6 +130,6 @@ jobs: $opts += " -DEMBREE_TASKING_SYSTEM=INTERNAL" $opts += " -DEMBREE_TESTING_INTENSITY=2" - cmake -B build -G "Visual Studio 17 2022" -A ARM64 -T ClangCL $opts.Split(" ") . + cmake -B build -G "Visual Studio 17 2022" -A ARM64 $opts.Split(" ") . cmake --build build --config Release - ctest --test-dir build -C Release --output-on-failure \ No newline at end of file + ctest --test-dir build -C Release --output-on-failure From ae4c1857bb92f650e00e886a94aa16346994b4d3 Mon Sep 17 00:00:00 2001 From: "Werner, Stefan" Date: Thu, 28 May 2026 08:16:00 +0200 Subject: [PATCH 14/15] Added regular windows to CI --- .github/workflows/public.continuous.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/public.continuous.yml b/.github/workflows/public.continuous.yml index 766dd15243..57def63cb7 100644 --- a/.github/workflows/public.continuous.yml +++ b/.github/workflows/public.continuous.yml @@ -133,3 +133,22 @@ jobs: cmake -B build -G "Visual Studio 17 2022" -A ARM64 $opts.Split(" ") . cmake --build build --config Release ctest --test-dir build -C Release --output-on-failure + + windows-11: + runs-on: windows-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Build and Run + shell: pwsh + run: | + $opts = "-DBUILD_TESTING=ON" + $opts += " -DEMBREE_TUTORIALS=ON" + $opts += " -DEMBREE_ISPC_SUPPORT=OFF" + $opts += " -DEMBREE_TASKING_SYSTEM=INTERNAL" + $opts += " -DEMBREE_TESTING_INTENSITY=2" + + cmake -B build -G "Visual Studio 17 2022" $opts.Split(" ") . + cmake --build build --config Release + ctest --test-dir build -C Release --output-on-failure From 5e4356534525054c10dd007edb6066798ba1cc5b Mon Sep 17 00:00:00 2001 From: "Werner, Stefan" Date: Tue, 23 Jun 2026 11:47:54 +0200 Subject: [PATCH 15/15] ARM64 MSVC: Use wrapper types to resolve type aliasing in implicit conversion operators On ARM64 MSVC, the arm_neon.h header from the compiler aliases __m128 and __m128i to the same underlying type (__n128), causing C++ overload ambiguity when both implicit conversion operators are defined. This is a less invasive solution than removing all implicit operators and requiring explicit casts throughout the codebase. Solution: - Create wrapper types (__m128_wrapper, __m128i_wrapper, __m128d_wrapper) for ARM64 MSVC - On other platforms, use identity wrappers that compile away to nothing - Update vector types (vfloat4, vint4, vuint4, vboolf4) to use these wrappers - Implicit conversion operators remain unchanged at call sites - No performance overhead when inlined This approach keeps the implicit operator API intact while disambiguating the underlying types for ARM64 MSVC, requiring changes only to vector type declarations rather than hundreds of call sites throughout the codebase. Files modified: - common/simd/arm/simd_wrapper_types.h (new file) - common/simd/vfloat4_sse2.h - common/simd/vint4_sse2.h - common/simd/vuint4_sse2.h - common/simd/vboolf4_sse2.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- common/simd/arm/simd_wrapper_types.h | 53 ++++++++++++++++++++++++++++ common/simd/vboolf4_sse2.h | 16 +++++---- common/simd/vfloat4_sse2.h | 10 +++--- common/simd/vint4_sse2.h | 9 ++--- common/simd/vuint4_sse2.h | 7 ++-- 5 files changed, 77 insertions(+), 18 deletions(-) create mode 100644 common/simd/arm/simd_wrapper_types.h diff --git a/common/simd/arm/simd_wrapper_types.h b/common/simd/arm/simd_wrapper_types.h new file mode 100644 index 0000000000..8d638b4767 --- /dev/null +++ b/common/simd/arm/simd_wrapper_types.h @@ -0,0 +1,53 @@ +// Copyright 2009-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 + +#pragma once + +#include +#include "../../sys/platform.h" + +namespace embree +{ +#if defined(_MSC_VER) && defined(_ARM64_) + // On ARM64 MSVC, __m128 and __m128i are both aliased to __n128 in arm_neon.h, + // causing C++ overload ambiguity. We wrap them in unique types to disambiguate. + + struct __m128_wrapper { + __m128 data; + __forceinline __m128_wrapper() {} + __forceinline __m128_wrapper(__m128 v) : data(v) {} + __forceinline operator __m128() const { return data; } + __forceinline operator __m128&() { return data; } + }; + + struct __m128i_wrapper { + __m128i data; + __forceinline __m128i_wrapper() {} + __forceinline __m128i_wrapper(__m128i v) : data(v) {} + __forceinline operator __m128i() const { return data; } + __forceinline operator __m128i&() { return data; } + }; + + struct __m128d_wrapper { + __m128d data; + __forceinline __m128d_wrapper() {} + __forceinline __m128d_wrapper(__m128d v) : data(v) {} + __forceinline operator __m128d() const { return data; } + __forceinline operator __m128d&() { return data; } + }; + +#else + // On other platforms, use identity "wrappers" that compile away to nothing + template struct identity_wrapper { + T data; + __forceinline identity_wrapper() {} + __forceinline identity_wrapper(T v) : data(v) {} + __forceinline operator T() const { return data; } + __forceinline operator T&() { return data; } + }; + + using __m128_wrapper = identity_wrapper<__m128>; + using __m128i_wrapper = identity_wrapper<__m128i>; + using __m128d_wrapper = identity_wrapper<__m128d>; +#endif +} diff --git a/common/simd/vboolf4_sse2.h b/common/simd/vboolf4_sse2.h index e96525c9a7..cb178c44ca 100644 --- a/common/simd/vboolf4_sse2.h +++ b/common/simd/vboolf4_sse2.h @@ -3,6 +3,8 @@ #pragma once +#include "arm/simd_wrapper_types.h" + #define vboolf vboolf_impl #define vboold vboold_impl #define vint vint_impl @@ -23,8 +25,8 @@ namespace embree typedef vint4 Int; typedef vfloat4 Float; - enum { size = 4 }; // number of SIMD elements - union { __m128 v; int i[4]; }; // data + enum { size = 4 }; // number of SIMD elements + union { __m128_wrapper v; int i[4]; }; // data //////////////////////////////////////////////////////////////////////////////// /// Constructors, Assignment & Cast Operators @@ -35,10 +37,10 @@ namespace embree __forceinline vboolf4& operator =(const vboolf4& other) { v = other.v; return *this; } __forceinline vboolf(__m128 input) : v(input) {} - __forceinline operator const __m128&() const { return v; } + __forceinline operator const __m128&() const { return v.data; } #if !defined(__EMSCRIPTEN__) - __forceinline operator const __m128i() const { return _mm_castps_si128(v); } - __forceinline operator const __m128d() const { return _mm_castps_pd(v); } + __forceinline operator const __m128i() const { return _mm_castps_si128(v.data); } + __forceinline operator const __m128d() const { return _mm_castps_pd(v.data); } #endif __forceinline vboolf(bool a) @@ -52,7 +54,7 @@ namespace embree /* return int32 mask */ __forceinline __m128i mask32() const { - return _mm_castps_si128(v); + return _mm_castps_si128(v.data); } //////////////////////////////////////////////////////////////////////////////// @@ -66,7 +68,7 @@ namespace embree /// Array Access //////////////////////////////////////////////////////////////////////////////// - __forceinline bool operator [](size_t index) const { assert(index < 4); return (_mm_movemask_ps(v) >> index) & 1; } + __forceinline bool operator [](size_t index) const { assert(index < 4); return (_mm_movemask_ps(v.data) >> index) & 1; } __forceinline int& operator [](size_t index) { assert(index < 4); return i[index]; } }; diff --git a/common/simd/vfloat4_sse2.h b/common/simd/vfloat4_sse2.h index fccf11fe0c..8d43009bfa 100644 --- a/common/simd/vfloat4_sse2.h +++ b/common/simd/vfloat4_sse2.h @@ -3,6 +3,8 @@ #pragma once +#include "arm/simd_wrapper_types.h" + #define vboolf vboolf_impl #define vboold vboold_impl #define vint vint_impl @@ -23,8 +25,8 @@ namespace embree typedef vint4 Int; typedef vfloat4 Float; - enum { size = 4 }; // number of SIMD elements - union { __m128 v; float f[4]; int i[4]; }; // data + enum { size = 4 }; // number of SIMD elements + union { __m128_wrapper v; float f[4]; int i[4]; }; // data //////////////////////////////////////////////////////////////////////////////// /// Constructors, Assignment & Cast Operators @@ -37,8 +39,8 @@ namespace embree __forceinline vfloat4& operator =(const vfloat4& other) { v = other.v; return *this; } __forceinline vfloat(__m128 a) : v(a) {} - __forceinline operator const __m128&() const { return v; } - __forceinline operator __m128&() { return v; } + __forceinline operator const __m128&() const { return v.data; } + __forceinline operator __m128&() { return v.data; } __forceinline vfloat(float a) : v(_mm_set1_ps(a)) {} __forceinline vfloat(float a, float b, float c, float d) : v(_mm_set_ps(d, c, b, a)) {} diff --git a/common/simd/vint4_sse2.h b/common/simd/vint4_sse2.h index e9e4a5a2c2..a85dd868ed 100644 --- a/common/simd/vint4_sse2.h +++ b/common/simd/vint4_sse2.h @@ -3,6 +3,7 @@ #pragma once +#include "arm/simd_wrapper_types.h" #include "../math/emath.h" #define vboolf vboolf_impl @@ -25,8 +26,8 @@ namespace embree typedef vint4 Int; typedef vfloat4 Float; - enum { size = 4 }; // number of SIMD elements - union { __m128i v; int i[4]; }; // data + enum { size = 4 }; // number of SIMD elements + union { __m128i_wrapper v; int i[4]; }; // data //////////////////////////////////////////////////////////////////////////////// /// Constructors, Assignment & Cast Operators @@ -37,8 +38,8 @@ namespace embree __forceinline vint4& operator =(const vint4& a) { v = a.v; return *this; } __forceinline vint(__m128i a) : v(a) {} - __forceinline operator const __m128i&() const { return v; } - __forceinline operator __m128i&() { return v; } + __forceinline operator const __m128i&() const { return v.data; } + __forceinline operator __m128i&() { return v.data; } __forceinline vint(int a) : v(_mm_set1_epi32(a)) {} __forceinline vint(int a, int b, int c, int d) : v(_mm_set_epi32(d, c, b, a)) {} diff --git a/common/simd/vuint4_sse2.h b/common/simd/vuint4_sse2.h index c2e86c6633..8b38b12c69 100644 --- a/common/simd/vuint4_sse2.h +++ b/common/simd/vuint4_sse2.h @@ -3,6 +3,7 @@ #pragma once +#include "arm/simd_wrapper_types.h" #include "../math/emath.h" #define vboolf vboolf_impl @@ -26,7 +27,7 @@ namespace embree typedef vfloat4 Float; enum { size = 4 }; // number of SIMD elements - union { __m128i v; unsigned int i[4]; }; // data + union { __m128i_wrapper v; unsigned int i[4]; }; // data //////////////////////////////////////////////////////////////////////////////// /// Constructors, Assignment & Cast Operators @@ -37,8 +38,8 @@ namespace embree __forceinline vuint4& operator =(const vuint4& a) { v = a.v; return *this; } __forceinline vuint(const __m128i a) : v(a) {} - __forceinline operator const __m128i&() const { return v; } - __forceinline operator __m128i&() { return v; } + __forceinline operator const __m128i&() const { return v.data; } + __forceinline operator __m128i&() { return v.data; } __forceinline vuint(unsigned int a) : v(_mm_set1_epi32(a)) {}