MCPcopy Create free account
hub / github.com/ValveSoftware/steam-audio / add

Method add

core/src/core/array_math.cpp:26–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace ipl {
25
26void ArrayMath::add(int size,
27 const float* in1,
28 const float* in2,
29 float* out)
30{
31 auto simdSize = size & ~3;
32
33 if (float4::isAligned(in1) && float4::isAligned(in2) && float4::isAligned(out))
34 {
35 for (auto i = 0; i < simdSize; i += 4)
36 {
37 float4::store(&out[i], float4::add(float4::load(&in1[i]), float4::load(&in2[i])));
38 }
39 }
40 else
41 {
42 for (auto i = 0; i < simdSize; i += 4)
43 {
44 float4::storeu(&out[i], float4::add(float4::loadu(&in1[i]), float4::loadu(&in2[i])));
45 }
46 }
47
48 for (auto i = simdSize; i < size; ++i)
49 {
50 out[i] = in1[i] + in2[i];
51 }
52}
53
54void ArrayMath::add(int size,
55 const complex_t* in1,

Callers

nothing calls this directly

Calls 6

isAlignedFunction · 0.70
storeFunction · 0.70
addFunction · 0.70
loadFunction · 0.70
storeuFunction · 0.70
loaduFunction · 0.70

Tested by

no test coverage detected