<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 2:59 AM, chen <span dir="ltr"><<a href="mailto:chenm003@163.com" target="_blank">chenm003@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div>From d23527c6204921b782ef8bc2f1a69d<wbr>e88163202a Mon Sep 17 00:00:00 2001</div><div>From: Min Chen <<a href="mailto:min.chen@multicorewareinc.com" target="_blank">min.chen@multicorewareinc.com</a><wbr>></div><div>Date: Mon, 24 Oct 2016 16:27:35 -0500</div><div>Subject: [PATCH] [PPC] support option --no-asm to disable Altivec</div></div></blockquote><div><br></div><div>On what parent was this patch created? These don't apply on the current tip.</div><div>Also, these don't look like regular hg patches that come on the mailing list; can you please fix and send?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div><br></div><div>---</div><div> source/CMakeLists.txt        |    2 +-</div><div> source/common/cpu.cpp        |   17 ++++++++++++++++-</div><div> source/common/primitives.cpp |   11 +++++++----</div><div> source/common/version.cpp    |    4 +---</div><div> source/x265.h                |    3 +++</div><div> 5 files changed, 28 insertions(+), 9 deletions(-)</div><div><br></div><div>diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt</div><div>index 18cad9a..9e8e5ab 100644</div><div>--- a/source/CMakeLists.txt</div><div>+++ b/source/CMakeLists.txt</div><div>@@ -426,7 +426,7 @@ if(POWER)</div><div> </div><div>     option(CPU_POWER8 "Enable CPU POWER8 profiling instrumentation" ON)</div><div>     if(CPU_POWER8)</div><div>-        add_definitions(-mcpu=power8)</div><div>+        add_definitions(-mcpu=power8 -DX265_ARCH_POWER8=1)</div><div>     endif()</div><div> endif()</div><div> </div><div>diff --git a/source/common/cpu.cpp b/source/common/cpu.cpp</div><div>index 0dafe48..5bd1e0f 100644</div><div>--- a/source/common/cpu.cpp</div><div>+++ b/source/common/cpu.cpp</div><div>@@ -99,6 +99,10 @@ const cpu_name_t cpu_names[] =</div><div>     { "ARMv6",           X265_CPU_ARMV6 },</div><div>     { "NEON",            X265_CPU_NEON },</div><div>     { "FastNeonMRC",     X265_CPU_FAST_NEON_MRC },</div><div>+</div><div>+#elif X265_ARCH_POWER8</div><div>+    { "Altivec",         X265_CPU_ALTIVEC },</div><div>+</div><div> #endif // if X265_ARCH_X86</div><div>     { "", 0 },</div><div> };</div><div>@@ -363,7 +367,18 @@ uint32_t cpu_detect(void)</div><div>     return flags;</div><div> }</div><div> </div><div>-#else // if X265_ARCH_X86</div><div>+#elif X265_ARCH_POWER8</div><div>+</div><div>+uint32_t cpu_detect(void)</div><div>+{</div><div>+#if HAVE_ALTIVEC</div><div>+    return X265_CPU_ALTIVEC;</div><div>+#else</div><div>+    return 0;</div><div>+#endif</div><div>+}</div><div>+</div><div>+#else // if X265_ARCH_POWER8</div><div> </div><div> uint32_t cpu_detect(void)</div><div> {</div><div>diff --git a/source/common/primitives.cpp b/source/common/primitives.cpp</div><div>index 569f8ad..e000a2f 100644</div><div>--- a/source/common/primitives.cpp</div><div>+++ b/source/common/primitives.cpp</div><div>@@ -244,10 +244,13 @@ void x265_setup_primitives(x265_<wbr>param *param)</div><div>         setupAssemblyPrimitives(<wbr>primitives, param->cpuid);</div><div> #endif</div><div> #if HAVE_ALTIVEC</div><div>-        setupPixelPrimitives_altivec(<wbr>primitives);      // pixel_altivec.cpp, overwrite the initialization for altivec optimizated functions</div><div>-        setupDCTPrimitives_altivec(<wbr>primitives);        // dct_altivec.cpp, overwrite the initialization for altivec optimizated functions</div><div>-        setupFilterPrimitives_<wbr>altivec(primitives);     // ipfilter.cpp, overwrite the initialization for altivec optimizated functions</div><div>-        setupIntraPrimitives_altivec(<wbr>primitives); // intrapred_altivec.cpp, overwrite the initialization for altivec optimizated functions</div><div>+        if (param->cpuid & X265_CPU_ALTIVEC)</div><div>+        {</div><div>+            setupPixelPrimitives_altivec(<wbr>primitives);       // pixel_altivec.cpp, overwrite the initialization for altivec optimizated functions</div><div>+            setupDCTPrimitives_altivec(<wbr>primitives);         // dct_altivec.cpp, overwrite the initialization for altivec optimizated functions</div><div>+            setupFilterPrimitives_<wbr>altivec(primitives);      // ipfilter.cpp, overwrite the initialization for altivec optimizated functions</div><div>+            setupIntraPrimitives_altivec(<wbr>primitives);       // intrapred_altivec.cpp, overwrite the initialization for altivec optimizated functions</div><div>+        }</div><div> #endif</div><div> </div><div>         setupAliasPrimitives(<wbr>primitives);</div><div>diff --git a/source/common/version.cpp b/source/common/version.cpp</div><div>index dd114a3..e4d7554 100644</div><div>--- a/source/common/version.cpp</div><div>+++ b/source/common/version.cpp</div><div>@@ -77,10 +77,8 @@</div><div> #define BITS    "[32 bit]"</div><div> #endif</div><div> </div><div>-#if defined(ENABLE_ASSEMBLY)</div><div>+#if defined(ENABLE_ASSEMBLY) || HAVE_ALTIVEC</div><div> #define ASM     ""</div><div>-#elif HAVE_ALTIVEC</div><div>-#define ASM     "[altivec]"</div><div> #else</div><div> #define ASM     "[noasm]"</div><div> #endif</div><div>diff --git a/source/x265.h b/source/x265.h</div><div>index 6ef27de..e6a8b01 100644</div><div>--- a/source/x265.h</div><div>+++ b/source/x265.h</div><div>@@ -335,6 +335,9 @@ typedef enum</div><div> #define X265_CPU_NEON            0x0000002  /* ARM NEON */</div><div> #define X265_CPU_FAST_NEON_MRC   0x0000004  /* Transfer from NEON to ARM register is fast (Cortex-A9) */</div><div> </div><div>+/* IBM Power8 */</div><div>+#define X265_CPU_ALTIVEC         0x0000001</div><div>+</div><div> #define X265_MAX_SUBPEL_LEVEL   7</div><div> </div><div> /* Log level */</div><span class="HOEnZb"><font color="#888888"><div>-- </div><div>1.7.9.msysgit.0</div><div><br></div></font></span></div><br>______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
<br></blockquote></div><br></div></div>