Skip to content

Commit

Permalink
SSE RSUM/RDSUM use correct headers for SSE2, SSSE3 and SSE4
Browse files Browse the repository at this point in the history
- Replace python floor with // and remove math header

PiperOrigin-RevId: 676263295
  • Loading branch information
fbarchard authored and xnnpack-bot committed Sep 19, 2024
1 parent 424d318 commit 619b3fc
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 35 deletions.
3 changes: 1 addition & 2 deletions src/qs8-rdsum/gen/qs8-rdsum-7p7x-minmax-fp32-sse41-c16.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>
#include <math.h>

#include <immintrin.h>
#include <smmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/intrinsics-polyfill.h"
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rdsum/gen/qs8-rdsum-7p7x-minmax-fp32-sse41-c32.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>
#include <math.h>

#include <immintrin.h>
#include <smmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/intrinsics-polyfill.h"
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rdsum/gen/qs8-rdsum-7p7x-minmax-fp32-sse41-c64.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>
#include <math.h>

#include <immintrin.h>
#include <smmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/intrinsics-polyfill.h"
Expand Down
6 changes: 2 additions & 4 deletions src/qs8-rdsum/sse41.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

$import math
#include <assert.h>
#include <math.h>

#include <immintrin.h>
#include <smmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/intrinsics-polyfill.h"
Expand Down Expand Up @@ -47,7 +45,7 @@ void xnn_qs8_rdsum_ukernel_${ACCUMULATORS}p${ACCUMULATORS}x__sse41_c${CHANNELS}(
// 256 int8s may be summed into an int16 before overflowing
// To prevent handling the tails of the inner 256 loop, we round 256 down to
// the nearest integer multiple of ACCUMULATORS.
$OVERFLOW = math.floor(256 / ACCUMULATORS) * ACCUMULATORS
$OVERFLOW = (256 // ACCUMULATORS) * ACCUMULATORS
int r = rows;
while (r > 0) {
$for C in range(0, CHANNELS, 8):
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rsum/gen/qs8-rsum-ssse3-u16.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rsum/gen/qs8-rsum-ssse3-u32-acc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rsum/gen/qs8-rsum-ssse3-u32.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rsum/gen/qs8-rsum-ssse3-u64-acc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rsum/gen/qs8-rsum-ssse3-u64-acc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rsum/gen/qs8-rsum-ssse3-u64.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#include <assert.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
3 changes: 1 addition & 2 deletions src/qs8-rsum/ssse3.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ $assert CHANNEL_TILE % 16 == 0
$assert CHANNEL_TILE >= 16
$SIMD_TILE = CHANNEL_TILE // 16
$assert ACCUMULATORS <= SIMD_TILE

#include <assert.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rdsum/gen/qu8-rdsum-7p7x-ssse3-c16.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <assert.h>
#include <math.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/intrinsics-polyfill.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rdsum/gen/qu8-rdsum-7p7x-ssse3-c32.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <assert.h>
#include <math.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/intrinsics-polyfill.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rdsum/gen/qu8-rdsum-7p7x-ssse3-c64.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <assert.h>
#include <math.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/intrinsics-polyfill.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rdsum/ssse3.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $import math
#include <assert.h>
#include <math.h>

#include <immintrin.h>
#include <tmmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/intrinsics-polyfill.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rsum/gen/qu8-rsum-sse2-u16.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// LICENSE file in the root directory of this source tree.
#include <assert.h>

#include <immintrin.h>
#include <emmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rsum/gen/qu8-rsum-sse2-u32-acc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// LICENSE file in the root directory of this source tree.
#include <assert.h>

#include <immintrin.h>
#include <emmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rsum/gen/qu8-rsum-sse2-u32.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// LICENSE file in the root directory of this source tree.
#include <assert.h>

#include <immintrin.h>
#include <emmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rsum/gen/qu8-rsum-sse2-u64-acc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// LICENSE file in the root directory of this source tree.
#include <assert.h>

#include <immintrin.h>
#include <emmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rsum/gen/qu8-rsum-sse2-u64-acc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// LICENSE file in the root directory of this source tree.
#include <assert.h>

#include <immintrin.h>
#include <emmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rsum/gen/qu8-rsum-sse2-u64.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// LICENSE file in the root directory of this source tree.
#include <assert.h>

#include <immintrin.h>
#include <emmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qu8-rsum/sse2.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $SIMD_TILE = CHANNEL_TILE // 16
$assert ACCUMULATORS <= SIMD_TILE
#include <assert.h>

#include <immintrin.h>
#include <emmintrin.h>

#include "xnnpack/common.h"
#include "xnnpack/reduce.h"
Expand Down

0 comments on commit 619b3fc

Please sign in to comment.