Skip to content

Commit 6dc719e

Browse files
authored
Remove vint4 hadd_s() (#527)
1 parent d8cda55 commit 6dc719e

File tree

4 files changed

+0
-45
lines changed

4 files changed

+0
-45
lines changed

Source/UnitTest/test_simd.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,18 +1651,6 @@ TEST(vint4, hmax)
16511651
EXPECT_EQ(r2.lane<3>(), 5);
16521652
}
16531653

1654-
/** @brief Test vint4 hadd_s. */
1655-
TEST(vint4, hadd_s)
1656-
{
1657-
vint4 a1(1, 3, 5, 7);
1658-
int r1 = hadd_s(a1);
1659-
EXPECT_EQ(r1, 16);
1660-
1661-
vint4 a2(1, 2, -1, 5);
1662-
int r2 = hadd_s(a2);
1663-
EXPECT_EQ(r2, 7);
1664-
}
1665-
16661654
/** @brief Test vint4 hadd_rgb_s. */
16671655
TEST(vint4, hadd_rgb_s)
16681656
{

Source/astcenc_vecmathlib_neon_4.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -582,15 +582,6 @@ ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
582582
return vint4(vmaxvq_s32(a.m));
583583
}
584584

585-
/**
586-
* @brief Return the horizontal sum of a vector.
587-
*/
588-
ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
589-
{
590-
int32x2_t t = vadd_s32(vget_high_s32(a.m), vget_low_s32(a.m));
591-
return vget_lane_s32(vpadd_s32(t, t), 0);
592-
}
593-
594585
/**
595586
* @brief Store a vector to a 16B aligned memory address.
596587
*/

Source/astcenc_vecmathlib_none_4.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -646,14 +646,6 @@ ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
646646
return vint4(std::max(b, c));
647647
}
648648

649-
/**
650-
* @brief Return the horizontal sum of vector lanes as a scalar.
651-
*/
652-
ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
653-
{
654-
return a.m[0] + a.m[1] + a.m[2] + a.m[3];
655-
}
656-
657649
/**
658650
* @brief Store a vector to an aligned memory address.
659651
*/

Source/astcenc_vecmathlib_sse_4.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -621,22 +621,6 @@ ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
621621
return a;
622622
}
623623

624-
/**
625-
* @brief Return the horizontal sum of a vector as a scalar.
626-
*/
627-
ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
628-
{
629-
// Add top and bottom halves, lane 1/0
630-
__m128i fold = _mm_castps_si128(_mm_movehl_ps(_mm_castsi128_ps(a.m),
631-
_mm_castsi128_ps(a.m)));
632-
__m128i t = _mm_add_epi32(a.m, fold);
633-
634-
// Add top and bottom halves, lane 0 (_mm_hadd_ps exists but slow)
635-
t = _mm_add_epi32(t, _mm_shuffle_epi32(t, 0x55));
636-
637-
return _mm_cvtsi128_si32(t);
638-
}
639-
640624
/**
641625
* @brief Store a vector to a 16B aligned memory address.
642626
*/

0 commit comments

Comments
 (0)