[x264-devel] [PATCH 04/14] arm: Use const macros in arm assembly where applicable

Martin Storsjö martin at martin.st
Fri Mar 24 10:33:36 CET 2017


This unifies the source code style, and allows building the code
with clang without gas-preprocessor.
---
 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 13d5061..48a3498 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 1d179e1..2d6dc2e 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 a1a0673..f562009 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 a7d9f10..06366cc 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 eb3fd36..a7f6cd2 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 433ac53..4bd0ca0 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
 
-- 
2.7.4



More information about the x264-devel mailing list