Debian Codegraph @

src/f32-vbinary/gen/f32-vrdivc-sse-u4.c

raw symbols SCIP
1 // Auto-generated file. Do not edit!
2 // Template: src/f32-vbinary/vopc-sse.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2019 Google LLC
6 //
7 // This source code is licensed under the BSD-style license found in the
8 // LICENSE file in the root directory of this source tree.
9
10 #include <assert.h>
11
12 #include <xmmintrin.h>
13
14 #include "xnnpack/common.h"
15 #include "xnnpack/intrinsics-polyfill.h"
16 #include "xnnpack/vbinary.h"
17
18
19 void xnn_f32_vrdivc_ukernel__sse_u4(
20 size_t batch,
21 const float* input_a,
22 const float* input_b,
23 float* output,
24 const struct xnn_f32_default_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS
25 {
26 assert(batch != 0);
27 assert(batch % sizeof(float) == 0);
28 assert(input_a != NULL);
29 assert(input_b != NULL);
30 assert(output != NULL);
31
32 const __m128 vb = _mm_load1_ps(input_b);
33
34 for (; batch >= 4 * sizeof(float); batch -= 4 * sizeof(float)) {
35 const __m128 va = _mm_loadu_ps(input_a);
36 input_a += 4;
37
38 __m128 vacc = _mm_div_ps(vb, va);
39
40 _mm_storeu_ps(output, vacc);
41 output += 4;
42 }
43 if XNN_UNLIKELY(batch != 0) {
44 const __m128 va = _mm_loadu_ps(input_a);
45
46 __m128 vacc = _mm_div_ps(vb, va);
47 if (batch & (2 * sizeof(float))) {
48 _mm_storel_pi((__m64*) output, vacc);
49 vacc = _mm_movehl_ps(vacc, vacc);
50 output += 2;
51 }
52 if (batch & (1 * sizeof(float))) {
53 _mm_store_ss(output, vacc);
54 }
55 }
56 }