Commit 36a2d2ca authored by Janne Grunau's avatar Janne Grunau

arm: reverse jump tables

Instead of bit reverting the register subtract 24 from clz. This avoids
two empty filler values in the jump table with the same instruction
count.
parent e214351b
......@@ -72,6 +72,7 @@ function \type\()_8bpc_neon, export=1
push {r4-r6,lr}
ldr r4, [sp, #16]
ldr r5, [sp, #20]
clz r4, r4
.ifnc \type, avg
ldr lr, [sp, #24]
.endif
......@@ -83,22 +84,20 @@ function \type\()_8bpc_neon, export=1
.ifc \type, mask
vmov.i8 q15, #256-2
.endif
rbit r4, r4
adr r12, L(\type\()_tbl)
clz r4, r4
sub r4, r4, #24
ldr r4, [r12, r4, lsl #2]
\type d16, d17, q0, q1, q2, q3
add r12, r12, r4
bx r12
.align 2
L(\type\()_tbl):
.word 0, 0
.word 4f - L(\type\()_tbl) + CONFIG_THUMB
.word 80f - L(\type\()_tbl) + CONFIG_THUMB
.word 160f - L(\type\()_tbl) + CONFIG_THUMB
.word 320f - L(\type\()_tbl) + CONFIG_THUMB
.word 640f - L(\type\()_tbl) + CONFIG_THUMB
.word 1280f - L(\type\()_tbl) + CONFIG_THUMB
.word 640f - L(\type\()_tbl) + CONFIG_THUMB
.word 320f - L(\type\()_tbl) + CONFIG_THUMB
.word 160f - L(\type\()_tbl) + CONFIG_THUMB
.word 80f - L(\type\()_tbl) + CONFIG_THUMB
.word 4f - L(\type\()_tbl) + CONFIG_THUMB
4:
add r6, r0, r1
lsl r1, r1, #1
......
......@@ -96,6 +96,7 @@
.macro bidir_fn type
function \type\()_8bpc_neon, export=1
clz w4, w4
.ifc \type, w_avg
dup v30.8h, w6
neg v30.8h, v30.8h
......@@ -104,9 +105,8 @@ function \type\()_8bpc_neon, export=1
.ifc \type, mask
movi v31.16b, #256-2
.endif
rbit w4, w4
adr x7, L(\type\()_tbl)
clz w4, w4
sub w4, w4, #24
\type v4, v0, v1
ldrh w4, [x7, x4, lsl #1]
\type v5, v2, v3
......@@ -218,13 +218,12 @@ function \type\()_8bpc_neon, export=1
0:
ret
L(\type\()_tbl):
.hword 0, 0
.hword L(\type\()_tbl) - 4b
.hword L(\type\()_tbl) - 8b
.hword L(\type\()_tbl) - 160b
.hword L(\type\()_tbl) - 320b
.hword L(\type\()_tbl) - 640b
.hword L(\type\()_tbl) - 1280b
.hword L(\type\()_tbl) - 640b
.hword L(\type\()_tbl) - 320b
.hword L(\type\()_tbl) - 160b
.hword L(\type\()_tbl) - 8b
.hword L(\type\()_tbl) - 4b
endfunc
.endm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment