diff --git a/Source/UnitTest/test_simd.cpp b/Source/UnitTest/test_simd.cpp index faaa39f9..25215b59 100644 --- a/Source/UnitTest/test_simd.cpp +++ b/Source/UnitTest/test_simd.cpp @@ -372,16 +372,6 @@ TEST(vfloat4, Loada) EXPECT_EQ(a.lane<3>(), 3.0f); } -/** @brief Test vfloat4 lane_id. */ -TEST(vfloat4, LaneID) -{ - vfloat4 a = vfloat4::lane_id(); - EXPECT_EQ(a.lane<0>(), 0.0f); - EXPECT_EQ(a.lane<1>(), 1.0f); - EXPECT_EQ(a.lane<2>(), 2.0f); - EXPECT_EQ(a.lane<3>(), 3.0f); -} - /** @brief Test vfloat4 swz to float4. */ TEST(vfloat4, swz4) { @@ -2138,24 +2128,6 @@ TEST(vfloat8, Loada) EXPECT_EQ(ra[7], 7.0f); } -/** @brief Test vfloat8 lane_id. */ -TEST(vfloat8, LaneID) -{ - vfloat8 a = vfloat8::lane_id(); - - alignas(32) float ra[8]; - storea(a, ra); - - EXPECT_EQ(ra[0], 0.0f); - EXPECT_EQ(ra[1], 1.0f); - EXPECT_EQ(ra[2], 2.0f); - EXPECT_EQ(ra[3], 3.0f); - EXPECT_EQ(ra[4], 4.0f); - EXPECT_EQ(ra[5], 5.0f); - EXPECT_EQ(ra[6], 6.0f); - EXPECT_EQ(ra[7], 7.0f); -} - /** @brief Test vfloat8 add. */ TEST(vfloat8, vadd) { diff --git a/Source/astcenc_vecmathlib_avx2_8.h b/Source/astcenc_vecmathlib_avx2_8.h index 422c3a14..ee38d363 100644 --- a/Source/astcenc_vecmathlib_avx2_8.h +++ b/Source/astcenc_vecmathlib_avx2_8.h @@ -118,14 +118,6 @@ struct vfloat8 return vfloat8(_mm256_load_ps(p)); } - /** - * @brief Factory that returns a vector containing the lane IDs. - */ - static ASTCENC_SIMD_INLINE vfloat8 lane_id() - { - return vfloat8(_mm256_set_ps(7, 6, 5, 4, 3, 2, 1, 0)); - } - /** * @brief The vector ... */ diff --git a/Source/astcenc_vecmathlib_neon_4.h b/Source/astcenc_vecmathlib_neon_4.h index 42545e75..787d8f61 100644 --- a/Source/astcenc_vecmathlib_neon_4.h +++ b/Source/astcenc_vecmathlib_neon_4.h @@ -134,15 +134,6 @@ struct vfloat4 return vfloat4(vld1q_f32(p)); } - /** - * @brief Factory that returns a vector containing the lane IDs. - */ - static ASTCENC_SIMD_INLINE vfloat4 lane_id() - { - alignas(16) float data[4] { 0.0f, 1.0f, 2.0f, 3.0f }; - return vfloat4(vld1q_f32(data)); - } - /** * @brief Return a swizzled float 2. */ diff --git a/Source/astcenc_vecmathlib_none_4.h b/Source/astcenc_vecmathlib_none_4.h index be7348ef..6d0fcf21 100644 --- a/Source/astcenc_vecmathlib_none_4.h +++ b/Source/astcenc_vecmathlib_none_4.h @@ -139,14 +139,6 @@ struct vfloat4 return vfloat4(p); } - /** - * @brief Factory that returns a vector containing the lane IDs. - */ - static ASTCENC_SIMD_INLINE vfloat4 lane_id() - { - return vfloat4(0.0f, 1.0f, 2.0f, 3.0f); - } - /** * @brief Return a swizzled float 2. */ diff --git a/Source/astcenc_vecmathlib_sse_4.h b/Source/astcenc_vecmathlib_sse_4.h index d5058377..d56511dc 100644 --- a/Source/astcenc_vecmathlib_sse_4.h +++ b/Source/astcenc_vecmathlib_sse_4.h @@ -142,14 +142,6 @@ struct vfloat4 return vfloat4(_mm_load_ps(p)); } - /** - * @brief Factory that returns a vector containing the lane IDs. - */ - static ASTCENC_SIMD_INLINE vfloat4 lane_id() - { - return vfloat4(_mm_set_ps(3, 2, 1, 0)); - } - /** * @brief Return a swizzled float 2. */ diff --git a/Source/astcenc_weight_align.cpp b/Source/astcenc_weight_align.cpp index 4e993e73..7233915a 100644 --- a/Source/astcenc_weight_align.cpp +++ b/Source/astcenc_weight_align.cpp @@ -164,7 +164,7 @@ static void compute_lowest_and_highest_weight( promise(weight_count > 0); promise(max_angular_steps > 0); - vfloat rcp_stepsize = vfloat::lane_id() + vfloat(1.0f); + vfloat rcp_stepsize = int_to_float(vint::lane_id()) + vfloat(1.0f); // Arrays are ANGULAR_STEPS long, so always safe to run full vectors for (unsigned int sp = 0; sp < max_angular_steps; sp += ASTCENC_SIMD_WIDTH)