simd constexpr vec: small change and fix

This commit is contained in:
sharkautarch 2024-09-27 09:56:48 -04:00
parent 4620fae1d1
commit b21be860bf
No known key found for this signature in database
GPG Key ID: F270CA9462164405
2 changed files with 1 additions and 4 deletions

View File

@ -18,7 +18,7 @@
using G = typename vec<L, T, Q>::GccVec_t; \
G vin; std::memcpy(&vin, &data, std::min(sizeof(data), sizeof(vin))); \
GccVec<4, T, Q> vout; \
vout = __builtin_shufflevector(vin, vin, offsetof(E, A)/sizeof(A), offsetof(E, B)/sizeof(B), offsetof(E, C)/sizeof(C), offsetof(E, A)/sizeof(A)+1); \
vout = __builtin_shufflevector(vin, vin, offsetof(E, A)/sizeof(A), offsetof(E, B)/sizeof(B), offsetof(E, C)/sizeof(C), offsetof(E, A)/sizeof(A)); \
vec<3, T, Q> voutfin; std::memcpy(&voutfin, &vout, sizeof(voutfin)); \
return voutfin; \
}

View File

@ -772,9 +772,6 @@ namespace glm
template <length_t Lx>
friend inline GLM_CONSTEXPR vec<L, T, Q> operator/(vec<Lx, T, Q> v1, vec<L, T, Q> && __restrict__ v2) requires (!NotVec1<Lx> && NotVec1<L>)
{
if constexpr (L == 3 && !BIsAlignedQ<Q>())
return *(new (&v2) vec<L, T, Q>( v1.data / v2.x, v1.data/v2.y, v1.data/v2.z ));
else
return vec<L, T, Q>(v1.x) /= v2;
}