From: Mario Hros <k3x-devel@outlook.com> To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org> Cc: "ting.fu@intel.com" <ting.fu@intel.com> Subject: Re: [FFmpeg-devel] [PATCH] libswscale/x86/yuv2rgb: Add missing EMMS Date: Tue, 11 Jun 2024 17:19:06 +0000 Message-ID: <AM9P193MB19401D8FF12C08DD5BBA00E4AFC72@AM9P193MB1940.EURP193.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AM9P193MB194004554ECF79F43679CFB2AFF92@AM9P193MB1940.EURP193.PROD.OUTLOOK.COM> Ping? Not including EMMS causes the FPU to become unusable (as the IE and SF bits are set in the status word). This breaks code which, for instance, calls fmod() and is compiled by GCC with the -O3 flag enabled. In that scenario, GCC implements fmod using the FPREM FPU instruction, but because FPU is in the invalid state at that point, the result is NaN. This must to breaking other code using FPU also. The original code with inline assembly used EMMS at the end. ________________________________ From: Mario Hros <k3x-devel@outlook.com> Sent: Wednesday, June 5, 2024 7:35 PM To: ffmpeg-devel@ffmpeg.org <ffmpeg-devel@ffmpeg.org> Cc: Mario Hros <k3x-devel@outlook.com> Subject: [PATCH] libswscale/x86/yuv2rgb: Add missing EMMS Previous rewrite from inline assembly into nasm (commit e934194) missed the required EMMS instruction to bring the x87 FPU back into usable state. Signed-off-by: Mario Hros <k3x-devel@outlook.com> --- libswscale/x86/yuv_2_rgb.asm | 1 + 1 file changed, 1 insertion(+) diff --git a/libswscale/x86/yuv_2_rgb.asm b/libswscale/x86/yuv_2_rgb.asm index e3470fd9ad..7a247797e4 100644 --- a/libswscale/x86/yuv_2_rgb.asm +++ b/libswscale/x86/yuv_2_rgb.asm @@ -353,6 +353,7 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters add imageq, 8 * depth * time_num add indexq, 4 * time_num js .loop0 +emms RET -- 2.39.3 (Apple Git-146) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-06-11 17:19 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-06-05 17:35 Mario Hros 2024-06-11 17:19 ` Mario Hros [this message] 2024-06-25 20:09 ` Michael Niedermayer 2024-06-26 17:54 ` [FFmpeg-devel] [PATCH v2] " Mario Hros 2024-06-26 18:55 ` Ramiro Polla 2024-07-01 11:46 ` Ramiro Polla 2024-07-04 17:52 ` Mario Hros 2024-07-05 8:46 ` Ramiro Polla
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=AM9P193MB19401D8FF12C08DD5BBA00E4AFC72@AM9P193MB1940.EURP193.PROD.OUTLOOK.COM \ --to=k3x-devel@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=ting.fu@intel.com \ /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
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git