ref: 5d014b41b8a2e09a5c786e26eaa8c61e676e24ea
parent: b7d7c8ce18693d64c52956944c39777d047cfd4d
author: Martin Storsjö <martin@martin.st>
date: Thu Oct 10 19:16:42 EDT 2019
arm: util: Split movrel into movrel and movrel_local
--- a/src/arm/32/cdef.S
+++ b/src/arm/32/cdef.S
@@ -348,10 +348,10 @@
vpush {q4-q7}
ldrd r4, r5, [sp, #92]
ldrd r6, r7, [sp, #100]
- movrel r8, pri_taps, global=0
+ movrel_local r8, pri_taps
and r9, r3, #1
add r8, r8, r9, lsl #1
- movrel r9, directions\w, global=0
+ movrel_local r9, directions\w
add r5, r9, r5, lsl #1
vmov.u16 d17, #15
vdup.16 d16, r6 // damping
@@ -563,7 +563,7 @@
vstr s16, [sp, #2*4] // cost[2]
vstr s17, [sp, #6*4] // cost[6]
- movrel r12, div_table, global=0
+ movrel_local r12, div_table
vld1.16 {q14}, [r12, :128]
vmull.s16 q5, d0, d0 // sum_diag[0]*sum_diag[0]
@@ -584,7 +584,7 @@
vadd.i32 d0, d0, d1
vpadd.i32 d0, d10, d0 // cost[0,4] = s0,s1
- movrel r12, alt_fact, global=0
+ movrel_local r12, alt_fact
vld1.16 {d29, d30, d31}, [r12, :64] // div_table[2*m+1] + 105
vstr s0, [sp, #0*4] // cost[0]
--- a/src/arm/32/util.S
+++ b/src/arm/32/util.S
@@ -32,9 +32,22 @@
#include "config.h"
#include "src/arm/asm.S"
-.macro movrel rd, val, offset=0, global=1
+.macro movrel_local rd, val, offset=0
+#if defined(PIC)
+ ldr \rd, 1f
+ b 2f
+1:
+ .word \val + \offset - (2f + 8 - 4 * CONFIG_THUMB)
+2:
+ add \rd, \rd, pc
+#else
+ movw \rd, #:lower16:\val+\offset
+ movt \rd, #:upper16:\val+\offset
+#endif
+.endm
+
+.macro movrel rd, val, offset=0
#if defined(PIC) && defined(__APPLE__)
-.if \global
ldr \rd, 1f
b 2f
1:
@@ -51,21 +64,8 @@
.indirect_symbol \val
.word 0
.text
-.else
-#endif
-#if defined(PIC)
- ldr \rd, 1f
- b 2f
-1:
- .word \val + \offset - (2f + 8 - 4 * CONFIG_THUMB)
-2:
- add \rd, \rd, pc
-#if defined(__APPLE__)
-.endif
-#endif
#else
- movw \rd, #:lower16:\val+\offset
- movt \rd, #:upper16:\val+\offset
+ movrel_local \rd, \val, \offset
#endif
.endm