diff mbox series

[FFmpeg-devel] Replace br return with ret

Message ID bfd7faea-bd3e-0b4c-ba29-c78119e1bb8b@arm.com
State New
Headers show
Series [FFmpeg-devel] Replace br return with ret | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

Casey Smalley Aug. 8, 2023, 12:22 p.m. UTC
This patch changes the return instruction in the
tr_32x4 macro from br to ret.

Using ret properly hints that the branch is a
function return.

On devices that support BTI a landing pad is
required when branching with br, or the instruction
can be replaced with a ret.

The change fixes fate-hevc-hdr-vivid-metadata when
on hardware with BTI support.

Signed-off-by: Casey Smalley <casey.smalley@arm.com>
---
  libavcodec/aarch64/hevcdsp_idct_neon.S | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Comments

Martin Storsjö Aug. 8, 2023, 5:46 p.m. UTC | #1
On Tue, 8 Aug 2023, Casey Smalley wrote:

> This patch changes the return instruction in the
> tr_32x4 macro from br to ret.
>
> Using ret properly hints that the branch is a
> function return.
>
> On devices that support BTI a landing pad is
> required when branching with br, or the instruction
> can be replaced with a ret.
>
> The change fixes fate-hevc-hdr-vivid-metadata when
> on hardware with BTI support.
>
> Signed-off-by: Casey Smalley <casey.smalley@arm.com>
> ---
> libavcodec/aarch64/hevcdsp_idct_neon.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

I already pushed this patch yesterday (but probably forgot to reply to the 
list about it). Thanks for the patch in any case!

// Martin
diff mbox series

Patch

diff --git a/libavcodec/aarch64/hevcdsp_idct_neon.S
b/libavcodec/aarch64/hevcdsp_idct_neon.S
index f7142c939c..dbb3705670 100644
--- a/libavcodec/aarch64/hevcdsp_idct_neon.S
+++ b/libavcodec/aarch64/hevcdsp_idct_neon.S
@@ -790,7 +790,7 @@  function func_tr_32x4_\name
          add             x3, x11, #(32 + 3 * 64)
          scale_store     \shift
  -        br               x10
+        ret              x10
  endfunc
  .endm
  -- 2.40.1