[2/2] arm: vp9mc: Use a different helper register for PIC loads

Message ID 1478777225-8920-2-git-send-email-martin@martin.st
State Committed
Commit 11623217e3c9b859daee544e31acdd0821b61039
Headers show

Commit Message

Martin Storsjö Nov. 10, 2016, 11:27 a.m.
This fixes crashes since 557c1675cf in linux PIC builds.

Previously, movrelx silently used r12 as helper register, which
doesn't work when r12 is the destination register.
---
 libavcodec/arm/vp9mc_neon.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin Storsjö Nov. 10, 2016, noon | #1
On Thu, 10 Nov 2016, Martin Storsjö wrote:

> This fixes crashes since 557c1675cf in linux PIC builds.
>
> Previously, movrelx silently used r12 as helper register, which
> doesn't work when r12 is the destination register.
> ---
> libavcodec/arm/vp9mc_neon.S | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/arm/vp9mc_neon.S b/libavcodec/arm/vp9mc_neon.S
> index 9deb656..d3d2c7f 100644
> --- a/libavcodec/arm/vp9mc_neon.S
> +++ b/libavcodec/arm/vp9mc_neon.S
> @@ -404,7 +404,7 @@ function ff_vp9_\type\()_\filter\()\size\()_h_neon, export=1
>         ldr             r4,  [sp, #16]
>         ldr             r5,  [sp, #20]
> .endif
> -        movrelx         r12, X(ff_vp9_subpel_filters)
> +        movrelx         r12, X(ff_vp9_subpel_filters), r6
>         add             r12, r12, 120*\offset - 8
>         cmp             r5,  #8
>         add             r12, r12, r5, lsl #3
> @@ -680,8 +680,8 @@ function ff_vp9_\type\()_\filter\()\size\()_v_neon, export=1
>         push            {r4-r5}
>         vpush           {q4-q7}
>         ldr             r4,  [sp, #72]
> +        movrelx         r12, X(ff_vp9_subpel_filters), r5
>         ldr             r5,  [sp, #80]
> -        movrelx         r12, X(ff_vp9_subpel_filters)
>         add             r12, r12, 120*\offset - 8
>         add             r12, r12, r5, lsl #3
>         cmp             r5,  #8
> -- 
> 2.7.4

OK'd by Janne on irc.

// Martin

Patch

diff --git a/libavcodec/arm/vp9mc_neon.S b/libavcodec/arm/vp9mc_neon.S
index 9deb656..d3d2c7f 100644
--- a/libavcodec/arm/vp9mc_neon.S
+++ b/libavcodec/arm/vp9mc_neon.S
@@ -404,7 +404,7 @@  function ff_vp9_\type\()_\filter\()\size\()_h_neon, export=1
         ldr             r4,  [sp, #16]
         ldr             r5,  [sp, #20]
 .endif
-        movrelx         r12, X(ff_vp9_subpel_filters)
+        movrelx         r12, X(ff_vp9_subpel_filters), r6
         add             r12, r12, 120*\offset - 8
         cmp             r5,  #8
         add             r12, r12, r5, lsl #3
@@ -680,8 +680,8 @@  function ff_vp9_\type\()_\filter\()\size\()_v_neon, export=1
         push            {r4-r5}
         vpush           {q4-q7}
         ldr             r4,  [sp, #72]
+        movrelx         r12, X(ff_vp9_subpel_filters), r5
         ldr             r5,  [sp, #80]
-        movrelx         r12, X(ff_vp9_subpel_filters)
         add             r12, r12, 120*\offset - 8
         add             r12, r12, r5, lsl #3
         cmp             r5,  #8