On Fri, 3 Oct 2025, Rémi Denis-Courmont wrote:
Le 3 octobre 2025 15:44:56 GMT+03:00, "Martin Storsjö via ffmpeg-devel"
<[email protected]> a écrit :
First off, calling a C function, which turns out to be in x86_64 mode,
will clobber those registers.
Will it? I thought code JITed from x86_64 to AArch64 could *not* access
the reserved registers, and that was why they were forbidden (which
barely makes sense to me).
The JITed code itself probably doesn't don't use those registers, no, and
probably not the JIT compiler itself either. I'm not entirely sure about
which case actually would clobber them - but I'm told this is a case that
can do it. Perhaps there's some serialization to/from CONTEXT in some of
the transitions (perhaps when invoking the JIT compiler?).
But again, the use case seems very unclear.
Requesting us to provide premade builds for this mode seems very unclear,
yes - that sounds unreasonable to me.
Wanting to use the libav* libraries in a hybrid x86_64/arm64ec process
seems like something quite plausible though. Not something I'd go out of
my way to complicate other things to accomplish, but reasonable build
system tweaks to allow such builds sound tolerable to me.
I'm sure some people are using x86 FFmpeg on Arm, but how do you
credibly end up with an AArch64 FFmpeg inside an Arm64EC process?
I don't quite understand what you mean here. Do you mean how one does to
end up with the aarch64 assembly touching all registers, in an arm64ec
process? Or how one does to retrofit an aarch64 ffmpeg DLL into an arm64ec
process?
For the former - it works just fine to build and assemble our current
aarch64 assembly, unmodified, with both MSVC and LLVM build tools. Both of
them complain loudly about code touching the unavailable registers, but it
still builds fine, and runs fine in practice.
// Martin
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]