[x265] [PATCH] asm: enable asm functions that support both x86 and x64

Steve Borho steve at borho.org
Fri Mar 6 02:30:59 CET 2015


On 03/05, Min Chen wrote:
> # HG changeset patch
> # User Min Chen <chenm003 at 163.com>
> # Date 1425598752 28800
> # Node ID 32a6cc2ef00fd64d97f9a35c092bb30aa542e42d
> # Parent  e6b519dfbf812f0ba392a70ce651bf589d2ab82a
> asm: enable asm functions that support both x86 and x64
> ---
>  source/common/x86/asm-primitives.cpp |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff -r e6b519dfbf81 -r 32a6cc2ef00f source/common/x86/asm-primitives.cpp
> --- a/source/common/x86/asm-primitives.cpp	Thu Mar 05 16:06:04 2015 +0530
> +++ b/source/common/x86/asm-primitives.cpp	Thu Mar 05 15:39:12 2015 -0800
> @@ -1592,7 +1592,7 @@
>  
>          p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].filter_vps = x265_interp_4tap_vert_ps_16x16_avx2;
>          p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].filter_vps = x265_interp_4tap_vert_ps_32x32_avx2;
> -#else
> +#endif
>          /* functions with both 64-bit and 32-bit implementations */
>          p.cu[BLOCK_4x4].dct = x265_dct4_avx2;
>  
> @@ -1619,7 +1619,6 @@
>          p.pu[LUMA_4x16].luma_vss = x265_interp_8tap_vert_ss_4x16_avx2;
>          p.pu[LUMA_8x4].luma_vss = x265_interp_8tap_vert_ss_8x4_avx2;
>          p.pu[LUMA_16x4].luma_vss = x265_interp_8tap_vert_ss_16x4_avx2;
> -#endif

this #if #else is correct. in the #if X86_64 section we use ALL_LUMA_PU
to setup pointers for all PUs, then in the #else section we setup
pointers for the few PU functions that are available for 32bit builds.

That said, I'm not sure anyone would notice is we just wrapped all of 
if (cpuMask & X265_CPU_AVX2) within #if X86_64 and just not worry about
32-bit versions of the AVX2 functions. Not many 32-bit O/S will support
AVX2 registers.

-- 
Steve Borho


More information about the x265-devel mailing list