Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions source/common/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,16 @@ uint32_t cpu_detect( bool benableavx512 )
}

#elif X265_ARCH_POWER8
#include "ppc/cpu.h"

uint32_t cpu_detect(bool benableavx512)
{
#if HAVE_ALTIVEC
return X265_CPU_ALTIVEC;
#else
return 0;
#endif
(void)benableavx512;
uint32_t flags = 0;

flags = ppc_cpu_detect();

return flags;
}

#else // if X265_ARCH_POWER8
Expand Down
39 changes: 39 additions & 0 deletions source/common/ppc/cpu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*****************************************************************************
* Copyright (C) 2026 MulticoreWare, Inc
*
* Authors: Brad Smith <brad@comstyle.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
*
* This program is also available under a commercial proprietary license.
* For more information, contact us at license @ x265.com.
*****************************************************************************/

#ifndef X265_COMMON_PPC_CPU_H
#define X265_COMMON_PPC_CPU_H

#include "x265.h"

static inline uint32_t ppc_cpu_detect()
{
uint32_t flags = 0;

#if HAVE_ALTIVEC
flags |= X265_CPU_ALTIVEC;
#endif
return flags;
}

#endif // ifndef X265_COMMON_PPC_CPU_H