[x264-devel] arm: Use const macros in arm assembly where applicable

Martin Storsjö git at videolan.org
Mon May 22 00:01:33 CEST 2017


x264 | branch: master | Martin Storsjö <martin at martin.st> | Fri Mar 24 11:33:36 2017 +0200| [3a3cfe32416efa4f966c0586411148236e4703c1] | committer: Henrik Gramner

arm: Use const macros in arm assembly where applicable

This unifies the source code style, and allows building the code
with clang without gas-preprocessor.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=3a3cfe32416efa4f966c0586411148236e4703c1
---

 common/arm/dct-a.S     |  6 ++----
 common/arm/mc-a.S      |  5 ++---
 common/arm/pixel-a.S   | 11 ++++++-----
 common/arm/predict-a.S |  7 +++----
 common/arm/quant-a.S   | 11 ++++++-----
 tools/checkasm-arm.S   |  8 ++++----
 6 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/common/arm/dct-a.S b/common/arm/dct-a.S
index 13d5061c..48a34985 100644
--- a/common/arm/dct-a.S
+++ b/common/arm/dct-a.S
@@ -26,14 +26,12 @@
 
 #include "asm.S"
 
-.section .rodata
-.align 4
-
-scan4x4_frame:
+const scan4x4_frame, align=4
 .byte    0,1,   8,9,   2,3,   4,5
 .byte    2,3,   8,9,  16,17, 10,11
 .byte   12,13,  6,7,  14,15, 20,21
 .byte   10,11, 12,13,  6,7,  14,15
+endconst
 
 .text
 
diff --git a/common/arm/mc-a.S b/common/arm/mc-a.S
index 1d179e1b..2d6dc2ed 100644
--- a/common/arm/mc-a.S
+++ b/common/arm/mc-a.S
@@ -28,10 +28,9 @@
 
 #include "asm.S"
 
-.section .rodata
-.align 4
-pw_0to15:
+const pw_0to15, align=4
 .short 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
+endconst
 
 .text
 
diff --git a/common/arm/pixel-a.S b/common/arm/pixel-a.S
index a1a0673d..f562009c 100644
--- a/common/arm/pixel-a.S
+++ b/common/arm/pixel-a.S
@@ -26,9 +26,7 @@
 
 #include "asm.S"
 
-.section .rodata
-.align 4
-
+const mask_array, align=4
 .rept 16
         .byte 0xff
 .endr
@@ -36,11 +34,14 @@ mask_ff:
 .rept 16
         .byte 0
 .endr
+endconst
 
-mask_ac4:
+const mask_ac4, align=4
 .short 0, -1, -1, -1,  0, -1, -1, -1
-mask_ac8:
+endconst
+const mask_ac8, align=4
 .short 0, -1, -1, -1, -1, -1, -1, -1
+endconst
 
 .text
 
diff --git a/common/arm/predict-a.S b/common/arm/predict-a.S
index a7d9f10f..06366ccf 100644
--- a/common/arm/predict-a.S
+++ b/common/arm/predict-a.S
@@ -27,10 +27,9 @@
 
 #include "asm.S"
 
-.section .rodata
-.align 4
-
-p16weight: .short 1,2,3,4,5,6,7,8
+const p16weight, align=4
+.short 1,2,3,4,5,6,7,8
+endconst
 
 .text
 
diff --git a/common/arm/quant-a.S b/common/arm/quant-a.S
index eb3fd36c..a7f6cd2d 100644
--- a/common/arm/quant-a.S
+++ b/common/arm/quant-a.S
@@ -26,19 +26,20 @@
 
 #include "asm.S"
 
-.section .rodata
-.align 4
-pmovmskb_byte:
+const pmovmskb_byte, align=4
 .byte 1,2,4,8,16,32,64,128
 .byte 1,2,4,8,16,32,64,128
+endconst
 
-mask_2bit:
+const mask_2bit, align=4
 .byte 3,12,48,192,3,12,48,192
 .byte 3,12,48,192,3,12,48,192
+endconst
 
-mask_1bit:
+const mask_1bit, align=4
 .byte 128,64,32,16,8,4,2,1
 .byte 128,64,32,16,8,4,2,1
+endconst
 
 .text
 
diff --git a/tools/checkasm-arm.S b/tools/checkasm-arm.S
index 433ac538..4bd0ca04 100644
--- a/tools/checkasm-arm.S
+++ b/tools/checkasm-arm.S
@@ -25,9 +25,7 @@
 
 #include "../common/arm/asm.S"
 
-.section .rodata
-.align 4
-register_init:
+const register_init, align=4
 .quad 0x21f86d66c8ca00ce
 .quad 0x75b6ba21077c48ad
 .quad 0xed56bb2dcb3c7736
@@ -36,9 +34,11 @@ register_init:
 .quad 0xdf9a54b303f1d3a3
 .quad 0x4a75479abd64e097
 .quad 0x249214109d5d1c88
+endconst
 
-error_message:
+const error_message
 .asciz "failed to preserve register"
+endconst
 
 .text
 



More information about the x264-devel mailing list