public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Than Ngo <than@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/chromium] epel10: Update ppc64le audio vector patch from Timothy Pearson <tpearson@raptorengineering.com>
Date: Thu, 22 Oct 2026 08:33:27 GMT	[thread overview]
Message-ID: <179265800729.1.17943252596153100581.rpms-chromium-e402dd33400b@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/chromium
Branch : epel10
Commit : e402dd33400be892fc94d8c1f2fab15c9dc81c9b
Author : Than Ngo <than@redhat.com>
Date   : 2026-10-21T21:21:27+02:00
Stats  : +14/-72 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/chromium/c/e402dd33400be892fc94d8c1f2fab15c9dc81c9b?branch=epel10

Log:
Update ppc64le audio vector patch from Timothy Pearson <tpearson@raptorengineering.com>

---
diff --git a/0005-blink-add-audio-vector-support.patch b/0005-blink-add-audio-vector-support.patch
index 5509792..a69aefa 100644
--- a/0005-blink-add-audio-vector-support.patch
+++ b/0005-blink-add-audio-vector-support.patch
@@ -2,7 +2,7 @@ Index: chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/cpu/ppc6
 ===================================================================
 --- /dev/null
 +++ chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/cpu/ppc64/delay_altivec.cc
-@@ -0,0 +1,183 @@
+@@ -0,0 +1,153 @@
 +// Copyright 2016 The Chromium Authors
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -17,7 +17,10 @@ Index: chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/cpu/ppc6
 +
 +#include <array>
 +
++#include "base/bit_cast.h"
 +#include "base/compiler_specific.h"
++#include "base/numerics/safe_conversions.h"
++#include "third_party/blink/renderer/platform/audio/delay.h"
 +
 +namespace blink {
 +
@@ -75,7 +78,8 @@ Index: chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/cpu/ppc6
 +  // The buffer length as a float and as an int so we don't need to constant
 +  // convert from one to the other.
 +  const __m128 v_buffer_length_float = _mm_set1_ps(buffer_length);
-+  const __m128i v_buffer_length_int = _mm_set1_epi32(buffer_length);
++  const __m128i v_buffer_length_int =
++      _mm_set1_epi32(base::checked_cast<int>(buffer_length));
 +
 +  // How much to increment the write index each time through the loop.
 +  const __m128i v_incr = _mm_set1_epi32(4);
@@ -85,8 +89,9 @@ Index: chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/cpu/ppc6
 +  std::array<float, 4> sample2 __attribute((aligned(16)));
 +
 +  // Initialize the write index vector, and  wrap the values if needed.
++  int w_index_3 = base::CheckAdd(w_index, 3u).ValueOrDie<int>();
 +  __m128i v_write_index =
-+      _mm_set_epi32(w_index + 3, w_index + 2, w_index + 1, w_index + 0);
++      _mm_set_epi32(w_index_3, w_index_3 - 1, w_index_3 - 2, w_index_3 - 3);
 +  v_write_index = WrapIndexVector(v_write_index, v_buffer_length_int);
 +
 +  const size_t number_of_loops = frames_to_process / 4;
@@ -118,14 +123,14 @@ Index: chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/cpu/ppc6
 +    const __m128 interpolation_factor =
 +        _mm_sub_ps(v_read_position, _mm_cvtepi32_ps(v_read_index1));
 +
-+    const uint32_t* read_index1 =
-+        reinterpret_cast<const uint32_t*>(&v_read_index1);
-+    const uint32_t* read_index2 =
-+        reinterpret_cast<const uint32_t*>(&v_read_index2);
++    const std::array<uint32_t, 4> read_index1 =
++        base::bit_cast<std::array<uint32_t, 4>>(v_read_index1);
++    const std::array<uint32_t, 4> read_index2 =
++        base::bit_cast<std::array<uint32_t, 4>>(v_read_index2);
 +
 +    for (int m = 0; m < 4; ++m) {
-+      sample1[m] = buffer_[UNSAFE_TODO(read_index1[m])];
-+      sample2[m] = buffer_[UNSAFE_TODO(read_index2[m])];
++      sample1[m] = buffer_[read_index1[m]];
++      sample2[m] = buffer_[read_index2[m]];
 +    }
 +
 +    const __m128 v_sample1 = _mm_load_ps(sample1.data());
@@ -150,67 +155,4 @@ Index: chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/cpu/ppc6
 +  return std::make_tuple(k, w_index);
 +}
 +
-+void Delay::HandleNaN(base::span<float> delay_times,
-+                      size_t frames_to_process,
-+                      float max_time) {
-+  unsigned k = 0;
-+  const unsigned number_of_loops = frames_to_process / 4;
-+
-+  __m128 v_max_time = _mm_set1_ps(max_time);
-+
-+  // This is approximately 4 times faster than the scalar version.
-+  for (unsigned loop = 0; loop < number_of_loops; ++loop, k += 4) {
-+    __m128 x = _mm_loadu_ps(delay_times.subspan(k, 4u).data());
-+    // 0xffffffff if x is NaN. Otherwise 0
-+    __m128 cmp = _mm_cmpunord_ps(x, x);
-+
-+    // Use cmp as a mask to set a component of x to 0 if is NaN.  Otherwise,
-+    // preserve x.
-+    x = _mm_andnot_ps(cmp, x);
-+
-+    // Now set cmp to be max_time if the value is 0xffffffff or 0.
-+    cmp = _mm_and_ps(cmp, v_max_time);
-+
-+    // Merge i (bitwise or) x and cmp.  This makes x = max_time if x was NaN and
-+    // preserves x if not.
-+    x = _mm_or_ps(x, cmp);
-+    _mm_storeu_ps(delay_times.subspan(k, 4u).data(), x);
-+  }
-+
-+  // Handle any frames not done in the loop above.
-+  for (; k < frames_to_process; ++k) {
-+    if (std::isnan(delay_times[k])) {
-+      delay_times[k] = max_time;
-+    }
-+  }
-+}
-+
 +}  // namespace blink
-Index: chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/delay.cc
-===================================================================
---- chromium-156.0.8078.35.orig/third_party/blink/renderer/platform/audio/delay.cc
-+++ chromium-156.0.8078.35/third_party/blink/renderer/platform/audio/delay.cc
-@@ -100,7 +100,7 @@ double Delay::DelayTime(float sample_rat
-   return desired_delay_frames_ / sample_rate;
- }
- 
--#if !(defined(ARCH_CPU_X86_FAMILY) || defined(CPU_ARM_NEON))
-+#if !(defined(ARCH_CPU_X86_FAMILY) || defined(CPU_ARM_NEON) || defined(ARCH_CPU_PPC64_FAMILY))
- // Default scalar versions if simd/neon are not available.
- std::tuple<size_t, size_t> Delay::ProcessARateVector(
-     base::span<float> destination,
-Index: chromium-156.0.8078.35/third_party/blink/renderer/platform/BUILD.gn
-===================================================================
---- chromium-156.0.8078.35.orig/third_party/blink/renderer/platform/BUILD.gn
-+++ chromium-156.0.8078.35/third_party/blink/renderer/platform/BUILD.gn
-@@ -1997,6 +1997,10 @@ component("platform") {
-     sources += [ "audio/cpu/arm/delay_neon.cc" ]
-   }
- 
-+  if (current_cpu == "ppc64") {
-+    sources += [ "audio/cpu/ppc64/delay_altivec.cc" ]
-+  }
-+
-   if (rtc_use_h265) {
-     sources += [
-       "peerconnection/h265_parameter_sets_tracker.cc",

                 reply	other threads:[~2026-10-22  8:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179265800729.1.17943252596153100581.rpms-chromium-e402dd33400b@fedoraproject.org \
    --to=than@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox