forked from pool/nodejs-electron
28 lines
1023 B
Diff
28 lines
1023 B
Diff
|
|
--- src/third_party/blink/renderer/platform/audio/cpu/x86/vector_math_impl.h.old 2022-10-20 19:00:30.057387900 +0200
|
||
|
|
+++ src/third_party/blink/renderer/platform/audio/cpu/x86/vector_math_impl.h 2022-10-29 23:03:21.785150600 +0200
|
||
|
|
@@ -13,6 +13,7 @@
|
||
|
|
|
||
|
|
#include <algorithm>
|
||
|
|
#include <cmath>
|
||
|
|
+#include <cstring>
|
||
|
|
|
||
|
|
#include "base/check_op.h"
|
||
|
|
#include "third_party/blink/renderer/platform/audio/audio_array.h"
|
||
|
|
@@ -208,13 +209,14 @@
|
||
|
|
// source_max = max(abs(source[k])) for all k
|
||
|
|
void Vmaxmgv(const float* source_p, float* max_p, uint32_t frames_to_process) {
|
||
|
|
constexpr uint32_t kMask = 0x7FFFFFFFu;
|
||
|
|
-
|
||
|
|
+ float kMask_float;
|
||
|
|
+ std::memcpy(&kMask_float, &kMask, 4);
|
||
|
|
const float* const source_end_p = source_p + frames_to_process;
|
||
|
|
|
||
|
|
DCHECK(IsAligned(source_p));
|
||
|
|
DCHECK_EQ(0u, frames_to_process % kPackedFloatsPerRegister);
|
||
|
|
|
||
|
|
- MType m_mask = MM_PS(set1)(*reinterpret_cast<const float*>(&kMask));
|
||
|
|
+ MType m_mask = MM_PS(set1)(kMask_float);
|
||
|
|
MType m_max = MM_PS(setzero)();
|
||
|
|
|
||
|
|
while (source_p < source_end_p) {
|