From: "Martin Storsjö via ffmpeg-devel" <ffmpeg-devel@ffmpeg.org>
To: "Rémi Denis-Courmont via ffmpeg-devel" <ffmpeg-devel@ffmpeg.org>
Cc: "Rémi Denis-Courmont" <remi@remlab.net>,
harish.rajaselvan@multicorewareinc.com,
"Martin Storsjö" <martin@martin.st>
Subject: [FFmpeg-devel] Re: [DISCUSSION] Adding ARM64EC support to FFmpeg
Date: Thu, 23 Oct 2025 09:31:26 +0300 (EEST)
Message-ID: <68c24bcd-716b-fe5-3687-a54fc1346942@martin.st> (raw)
In-Reply-To: <651065E9-B30C-4BF6-BD0F-D22CFE589C00@remlab.net>
On Thu, 23 Oct 2025, Rémi Denis-Courmont via ffmpeg-devel wrote:
>
>
> Le 23 octobre 2025 00:01:55 GMT+03:00, "Martin Storsjö" <martin@martin.st> a écrit :
>> On Wed, 22 Oct 2025, Rémi Denis-Courmont via ffmpeg-devel wrote:
>>
>>> If you want to compile AArch64 FFmpeg for use in emulated x86 processes, then you need a FFmpeg that exposes the same ABI as the x86 FFmpeg. That's going to require a lot of changes throughout the code base (and I doubt people here will agree to them overall).
>>
>> Can you elaborate on what changes you think would be needed?
>
> You're supposed to expose the same binary interface as x86. This is
> obviously not working correctly for CPU flags, which *are* part of the
> public libavutil interface, AFAIK.
Yes - although most users of the DLLs won't touch these, so as long as all
the libav* DLLs are built in the same form, this won't matter.
> I don't know what else won't work and I'm not going to audit the code.
>
>> In arm64ec mode, the compiler defines __x86_64__ (or _M_X64) and does
>> not define __aarch64__ (or _M_ARM64). It does define __arm64ec__ (or
>> _M_ARM64EC) to distinguish it from regular x86_64 though.
>
> Yes, and it seems extremely unlikely that that would just work. Any
> inline x86 assembler could break. And even if that did work, it would
> lack all Arm assembler optimisation so it would likely be worst than
> just using x86 FFmpeg and passing it through the JIT.
>
> I guess that the code is instead compiled as normal AArch64 just with a
> different ABI, but then that doesn't work either as noted above.
Yes, it's built with ARCH_AARCH64 within ffmpeg, so it doesn't see the
inline x86 assembler - and uses the aarch64 assembly.
Anyway, you're right that there are potential subtle ABI inconsistencies
in this build mode. But it also practically seems to work fine. It's
not a setup that I would go out and vouch support for - but for people
willing to build it, it seems to practically be usable - without any
further patches.
Offhand, I don't foresee any more patches being needed here (and Harish
can maybe chime in if you had any more patches in your pipeline for this
build mode?), other than potential minor build system tweaks. (The patch
for makedef being discussed here seems ok to me, and I'll merge it soon.)
If other patches were to be suggested, that would be more invasive and
affect maintainability, I agree that we should push back against including
it. But these build system fixes seem fine.
// Martin
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
next prev parent reply other threads:[~2025-10-23 6:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 10:04 [FFmpeg-devel] " harish.rajaselvan--- via ffmpeg-devel
2025-09-22 11:48 ` [FFmpeg-devel] " Martin Storsjö via ffmpeg-devel
2025-09-23 13:03 ` Harish Raja Selvan via ffmpeg-devel
2025-09-24 12:15 ` Martin Storsjö via ffmpeg-devel
2025-09-30 4:58 ` Harish Raja Selvan via ffmpeg-devel
2025-10-03 12:27 ` Martin Storsjö via ffmpeg-devel
2025-10-22 4:33 ` Harish Raja Selvan via ffmpeg-devel
2025-10-22 11:48 ` Martin Storsjö via ffmpeg-devel
2025-10-23 5:34 ` Harish Raja Selvan via ffmpeg-devel
2025-10-22 17:13 ` Rémi Denis-Courmont via ffmpeg-devel
2025-10-22 21:01 ` Martin Storsjö via ffmpeg-devel
2025-10-23 6:10 ` Rémi Denis-Courmont via ffmpeg-devel
2025-10-23 6:31 ` Martin Storsjö via ffmpeg-devel [this message]
2025-10-23 7:14 ` Rémi Denis-Courmont via ffmpeg-devel
2025-10-23 7:15 ` Rémi Denis-Courmont via ffmpeg-devel
2025-09-27 9:00 ` Rémi Denis-Courmont via ffmpeg-devel
2025-10-03 12:44 ` Martin Storsjö via ffmpeg-devel
2025-10-03 14:32 ` Rémi Denis-Courmont via ffmpeg-devel
2025-10-03 15:11 ` Martin Storsjö via ffmpeg-devel
2025-10-03 16:39 ` Rémi Denis-Courmont via ffmpeg-devel
2025-10-03 20:49 ` Stephen Hutchinson via ffmpeg-devel
2025-10-04 8:43 ` Rémi Denis-Courmont via ffmpeg-devel
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=68c24bcd-716b-fe5-3687-a54fc1346942@martin.st \
--to=ffmpeg-devel@ffmpeg.org \
--cc=harish.rajaselvan@multicorewareinc.com \
--cc=martin@martin.st \
--cc=remi@remlab.net \
/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