From: "Martin Storsjö" <martin@martin.st>
To: John Cox <jc@kynesim.co.uk>
Cc: thomas.mundt@hr.de,
FFmpeg development discussions and patches
<ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 02/15] avfilter/vf_bwdif: Add common macros and consts for aarch64 neon
Date: Mon, 3 Jul 2023 00:02:27 +0300 (EEST)
Message-ID: <9d8615fb-473e-1cd7-9261-2c8942ada660@martin.st> (raw)
In-Reply-To: <a1b6d12-dd1b-bb5f-f1f9-61f678776582@martin.st>
On Sun, 2 Jul 2023, Martin Storsjö wrote:
> On Sun, 2 Jul 2023, John Cox wrote:
>
>> On Sun, 2 Jul 2023 00:35:14 +0300 (EEST), you wrote:
>>
>>> On Thu, 29 Jun 2023, John Cox wrote:
>>>
>>>> Add macros for dual scalar half->single multiply and accumulate
>>>> Add macro for shift, saturate and shorten single to byte
>>>> Add filter constants
>>>>
>>>> Signed-off-by: John Cox <jc@kynesim.co.uk>
>>>> ---
>>>> libavfilter/aarch64/vf_bwdif_neon.S | 46 +++++++++++++++++++++++++++++
>>>> 1 file changed, 46 insertions(+)
>>>>
>>>> +
>>>> + .align 16
>>>
>>> Note that .align for arm is power of two; this triggers a 2^16 byte
>>> alignment here, which certainly isn't intended.
>>
>> Yikes! I'll swap that for a .balign now I've looked that up
>>
>>> But in general, the usual way of defining constants is with a
>>> const/endconst block, which places them in the right rdata section instead
>>> of in the text section. But that then requires you to use a movrel macro
>>> for accessing the data, instead of a plain ldr instruction.
>>
>> Yeah - arm has a history of mixing text & const - I went with the
>> simpler code. Is this a deal breaker or can I leave it as is?
>
> I wouldn't treat it as a deal breaker as long as it works across all
> platforms - even if consistency with the code style elsewhere is preferred,
> but IIRC there may be issues with MS armasm (after passed through
> gas-preprocessor). IIRC there might be issues with starting out with straight
> up content without the full setup made by the function/const macros. OTOH I
> might have fixed that in gas-preprocessor too...
>
> Last time around, the patchset failed building in that configuration due ot
> the out of range alignment, I'll see how it fares now.
I'm sorry, but I'd just recommend you to go with the const macros.
Your current patch fails because gas-preprocessor,
https://github.com/ffmpeg/gas-preprocessor, doesn't support the .balign
directive, it only recognizes .align and .p2align. (Extending it to
support it would be trivial though.)
If I change your code to ".align 4", I get the following warning:
\home\martin\code\ffmpeg-msvc-arm64\libavfilter\aarch64\vf_bwdif_neon.o.asm(1011)
: warning A4228: Alignment value exceeds AREA alignment; alignment not
guaranteed
ALIGN 16
Since we haven't started any section, apparently armasm defaults to a
section with 4 byte alignment.
But anyway, regardless of the alignment, it later fails with this error:
\home\martin\code\ffmpeg-msvc-arm64\libavfilter\aarch64\vf_bwdif_neon.o.asm(1051)
: error A2504: operand 2: Expected address
ldr q0, coeffs
So I would request you to just go with the macros we use elsewhere. The
gas-preprocessor/armasm setup doesn't support/expect any random assembly,
but the disciplined subset we normally write. In most cases, we
essentially never write bare directives in the code, but only use the
macros from asm.S, which are set up to handle portability across all
supported platforms and their toolchains.
// Martin
_______________________________________________
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:[~2023-07-02 21:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 17:57 [FFmpeg-devel] [PATCH 00/15] avfilter/vf_bwdif: Add aarch64 neon functions John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 01/15] avfilter/vf_bwdif: Add outline for aarch " John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 02/15] avfilter/vf_bwdif: Add common macros and consts for aarch64 neon John Cox
2023-07-01 21:35 ` Martin Storsjö
2023-07-02 10:27 ` John Cox
2023-07-02 20:07 ` Martin Storsjö
2023-07-02 21:02 ` Martin Storsjö [this message]
2023-07-03 8:31 ` John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 03/15] avfilter/vf_bwdif: Export C filter_intra John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 04/15] avfilter/vf_bwdif: Add neon for filter_intra John Cox
2023-07-01 21:37 ` Martin Storsjö
2023-07-02 10:43 ` John Cox
2023-07-02 20:18 ` Martin Storsjö
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 05/15] tests/checkasm: Add test for vf_bwdif filter_intra John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 06/15] avfilter/vf_bwdif: Add clip and spatial macros for aarch64 neon John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 07/15] avfilter/vf_bwdif: Export C filter_edge John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 08/15] avfilter/vf_bwdif: Add neon for filter_edge John Cox
2023-07-01 21:40 ` Martin Storsjö
2023-07-02 10:50 ` John Cox
2023-07-02 20:36 ` Martin Storsjö
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 09/15] tests/checkasm: Add test for vf_bwdif filter_edge John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 10/15] avfilter/vf_bwdif: Export C filter_line John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 11/15] avfilter/vf_bwdif: Add neon for filter_line John Cox
2023-07-01 21:44 ` Martin Storsjö
2023-07-02 10:57 ` John Cox
2023-07-02 20:40 ` Martin Storsjö
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 12/15] avfilter/vf_bwdif: Add a filter_line3 method for optimisation John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 13/15] avfilter/vf_bwdif: Add neon for filter_line3 John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 14/15] tests/checkasm: Add test for vf_bwdif filter_line3 John Cox
2023-06-29 17:57 ` [FFmpeg-devel] [PATCH 15/15] avfilter/vf_bwdif: Block filter slices into a multiple of 4 lines John Cox
2023-07-01 21:33 ` [FFmpeg-devel] [PATCH 00/15] avfilter/vf_bwdif: Add aarch64 neon functions Martin Storsjö
2023-07-02 10:18 ` John Cox
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=9d8615fb-473e-1cd7-9261-2c8942ada660@martin.st \
--to=martin@martin.st \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=jc@kynesim.co.uk \
--cc=thomas.mundt@hr.de \
/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