Skip to content

Commit

Permalink
Remove vfloat*::lane_id() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
solidpixel committed Jul 1, 2024
1 parent eb21c08 commit 2758f64
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 62 deletions.
28 changes: 0 additions & 28 deletions Source/UnitTest/test_simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
8 changes: 0 additions & 8 deletions Source/astcenc_vecmathlib_avx2_8.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
*/
Expand Down
9 changes: 0 additions & 9 deletions Source/astcenc_vecmathlib_neon_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
8 changes: 0 additions & 8 deletions Source/astcenc_vecmathlib_none_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
8 changes: 0 additions & 8 deletions Source/astcenc_vecmathlib_sse_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion Source/astcenc_weight_align.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2758f64

Please sign in to comment.