From: Anton Mitrofanov Date: Thu, 22 May 2014 09:27:00 +0000 (+0400) Subject: Fix pixel_ssim_end4 asm function for x86_64 systems X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13d6dfd83af98e472a9e9a8b6abf5c971707a893;p=libx264 Fix pixel_ssim_end4 asm function for x86_64 systems --- diff --git a/common/x86/pixel-a.asm b/common/x86/pixel-a.asm index 85e7d5a4..edadad38 100644 --- a/common/x86/pixel-a.asm +++ b/common/x86/pixel-a.asm @@ -4689,7 +4689,8 @@ cglobal pixel_ssim_4x4x2_core, 4,4,8 ;----------------------------------------------------------------------------- ; float pixel_ssim_end( int sum0[5][4], int sum1[5][4], int width ) ;----------------------------------------------------------------------------- -cglobal pixel_ssim_end4, 3,3,7 +cglobal pixel_ssim_end4, 2,3,7 + mov r2d, r2m movdqa m0, [r0+ 0] movdqa m1, [r0+16] movdqa m2, [r0+32] diff --git a/tools/checkasm.c b/tools/checkasm.c index f72b7a00..cb889660 100644 --- a/tools/checkasm.c +++ b/tools/checkasm.c @@ -728,11 +728,14 @@ static int check_pixel( int cpu_ref, int cpu_new ) fprintf( stderr, "ssim: %.7f != %.7f [FAILED]\n", res_c, res_a ); } set_func_name( "ssim_core" ); - call_c2( pixel_c.ssim_4x4x2_core, pbuf1+2, (intptr_t)32, pbuf2+2, (intptr_t)32, sums ); - call_a2( pixel_asm.ssim_4x4x2_core, pbuf1+2, (intptr_t)32, pbuf2+2, (intptr_t)32, sums ); + call_c( pixel_c.ssim_4x4x2_core, pbuf1+2, (intptr_t)32, pbuf2+2, (intptr_t)32, sums ); + call_a( pixel_asm.ssim_4x4x2_core, pbuf1+2, (intptr_t)32, pbuf2+2, (intptr_t)32, sums ); set_func_name( "ssim_end" ); call_c2( pixel_c.ssim_end4, sums, sums, 4 ); call_a2( pixel_asm.ssim_end4, sums, sums, 4 ); + /* check incorrect assumptions that 32-bit ints are zero-extended to 64-bit */ + call_c1( pixel_c.ssim_end4, sums, sums, 3 ); + call_a1( pixel_asm.ssim_end4, sums, sums, 3 ); report( "ssim :" ); }