From 7244cf2aa5494840c7ced3d1bc65de7d76e53014 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Fri, 21 Aug 2015 12:17:43 -0700 Subject: [PATCH] To compile with llvm integrated assembler. * Explicitly specify default .align 0. * Use standard ldmfdlo instruction. * Before and after gas outputs are identical, with align 0 sections. * Objdump showed .text/.data/.bss section alignment attributes are 2^0 from gas and 2^2 from llvm assembler. These .S files might be working when compiled by gas, but llvm assembler's output should be more correct or conservative. Change-Id: I4e578dbc8155c0d06d1bbc1c33ec4cc851a18479 --- libpixelflinger/Android.mk | 4 ---- libpixelflinger/arch-arm64/col32cb16blend.S | 2 +- libpixelflinger/arch-arm64/t32cb16blend.S | 2 +- libpixelflinger/t32cb16blend.S | 5 +++-- libpixelflinger/tests/arch-arm64/assembler/Android.mk | 3 --- libpixelflinger/tests/arch-arm64/assembler/asm_test_jacket.S | 2 +- libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk | 2 -- libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk | 2 -- 8 files changed, 6 insertions(+), 16 deletions(-) diff --git a/libpixelflinger/Android.mk b/libpixelflinger/Android.mk index 697db25e1..11e7988b3 100644 --- a/libpixelflinger/Android.mk +++ b/libpixelflinger/Android.mk @@ -70,10 +70,6 @@ LOCAL_SHARED_LIBRARIES := libcutils liblog # libhardware, but this at least gets us built. LOCAL_SHARED_LIBRARIES += libhardware_legacy LOCAL_CFLAGS += -DWITH_LIB_HARDWARE -# t32cb16blend.S does not compile with Clang. -LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as -# arch-arm64/col32cb16blend.S does not compile with Clang. -LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as include $(BUILD_SHARED_LIBRARY) include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/libpixelflinger/arch-arm64/col32cb16blend.S b/libpixelflinger/arch-arm64/col32cb16blend.S index 18a01fd68..8d9c7c419 100644 --- a/libpixelflinger/arch-arm64/col32cb16blend.S +++ b/libpixelflinger/arch-arm64/col32cb16blend.S @@ -26,7 +26,7 @@ * SUCH DAMAGE. */ .text - .align + .align 0 .global scanline_col32cb16blend_arm64 diff --git a/libpixelflinger/arch-arm64/t32cb16blend.S b/libpixelflinger/arch-arm64/t32cb16blend.S index 7da8cf559..230f47bb4 100644 --- a/libpixelflinger/arch-arm64/t32cb16blend.S +++ b/libpixelflinger/arch-arm64/t32cb16blend.S @@ -26,7 +26,7 @@ * SUCH DAMAGE. */ .text - .align + .align 0 .global scanline_t32cb16blend_arm64 diff --git a/libpixelflinger/t32cb16blend.S b/libpixelflinger/t32cb16blend.S index caf9eb7cd..1d40ad4e5 100644 --- a/libpixelflinger/t32cb16blend.S +++ b/libpixelflinger/t32cb16blend.S @@ -17,6 +17,7 @@ .text + .syntax unified .align .global scanline_t32cb16blend_arm @@ -146,7 +147,7 @@ scanline_t32cb16blend_arm: tst r0, #0x3 beq aligned subs r2, r2, #1 - ldmlofd sp!, {r4-r7, lr} // return + ldmfdlo sp!, {r4-r7, lr} // return bxlo lr last: @@ -197,6 +198,6 @@ aligned: mov r4, r5 9: adds r2, r2, #1 - ldmlofd sp!, {r4-r7, lr} // return + ldmfdlo sp!, {r4-r7, lr} // return bxlo lr b last diff --git a/libpixelflinger/tests/arch-arm64/assembler/Android.mk b/libpixelflinger/tests/arch-arm64/assembler/Android.mk index 448d2980e..bd0f24b3e 100644 --- a/libpixelflinger/tests/arch-arm64/assembler/Android.mk +++ b/libpixelflinger/tests/arch-arm64/assembler/Android.mk @@ -5,9 +5,6 @@ LOCAL_SRC_FILES:= \ arm64_assembler_test.cpp\ asm_test_jacket.S -# asm_test_jacket.S does not compile with Clang. -LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as - LOCAL_SHARED_LIBRARIES := \ libcutils \ libpixelflinger diff --git a/libpixelflinger/tests/arch-arm64/assembler/asm_test_jacket.S b/libpixelflinger/tests/arch-arm64/assembler/asm_test_jacket.S index a1392c29e..f44859f62 100644 --- a/libpixelflinger/tests/arch-arm64/assembler/asm_test_jacket.S +++ b/libpixelflinger/tests/arch-arm64/assembler/asm_test_jacket.S @@ -27,7 +27,7 @@ */ .text - .align + .align 0 .global asm_test_jacket diff --git a/libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk b/libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk index 5d69203b4..3368eb017 100644 --- a/libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk +++ b/libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk @@ -5,8 +5,6 @@ LOCAL_SRC_FILES:= \ col32cb16blend_test.c \ ../../../arch-arm64/col32cb16blend.S -LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as - LOCAL_SHARED_LIBRARIES := LOCAL_C_INCLUDES := diff --git a/libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk b/libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk index 2c1379bd7..8e5ec5e01 100644 --- a/libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk +++ b/libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk @@ -5,8 +5,6 @@ LOCAL_SRC_FILES:= \ t32cb16blend_test.c \ ../../../arch-arm64/t32cb16blend.S -LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as - LOCAL_SHARED_LIBRARIES := LOCAL_C_INCLUDES :=