]> git.sesse.net Git - x264/commitdiff
aarch64: Simplify the decimate_score functions
authorMartin Storsjö <martin@martin.st>
Thu, 13 Aug 2015 20:59:26 +0000 (23:59 +0300)
committerHenrik Gramner <henrik@gramner.com>
Sun, 11 Oct 2015 16:44:53 +0000 (18:44 +0200)
After doing a left shift by the number of bits returned by clz,
only bits set to zero can be shifted out, so if the register
was nonzero to start with (which is checked), it can't become
zero here.

common/aarch64/quant-a.S

index 2e1558b35b3325852e2a30498c01c4fedc6629a3..443a91dad623f8e4a4b2cca398b92fd1b38039ae 100644 (file)
@@ -328,17 +328,13 @@ function x264_decimate_score\size\()_neon, export=1
     lsr         x6,  x3,  #2
     lsl         x1,  x1,  x3
     ldrb        w7,  [x5, x6]
-    cbz         x1,  2f
     lsl         x1,  x1,  #4
     add         w0,  w0,  w7
     cbnz        x1,  1b
     ret
-2:
-    add         w0,  w0,  w7
-0:
-    ret
 9:
     mov         w0,  #9
+0:
     ret
 endfunc
 .endm
@@ -399,17 +395,13 @@ function x264_decimate_score64_neon, export=1
     clz         x3,  x1
     lsl         x1,  x1,  x3
     ldrb        w7,  [x5, x3]
-    cbz         x1,  2f
     lsl         x1,  x1,  #1
     add         w0,  w0,  w7
     cbnz        x1,  1b
     ret
-2:
-    add         w0,  w0,  w7
-0:
-    ret
 9:
     mov         w0,  #9
+0:
     ret
 endfunc