Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.5.1)
project(libxaac C CXX)
enable_language(ASM)

set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/decoder/armv8")

option(BUILD64 "Build for 64 bit" OFF)
set(XAAC_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
set(XAAC_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}")
Expand Down
6 changes: 4 additions & 2 deletions decoder/armv8/ixheaacd_apply_scale_factors.s
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
ldp X8, X9, [sp], #16
.endm

.include "ixheaacd_neon_macros.s"
.text
.p2align 2
.global ixheaacd_scale_factor_process_armv8

ixheaacd_scale_factor_process_armv8:
ENTRY ixheaacd_scale_factor_process_armv8

push_v_regs

Expand All @@ -37,6 +37,7 @@ ixheaacd_scale_factor_process_armv8:
BGT lbl17

pop_v_regs
EXIT_FUNC
ret
lbl17:
MOV x10, #0
Expand Down Expand Up @@ -163,4 +164,5 @@ OFFSET_ZERO:
BGT TBANDS_LOOP

pop_v_regs
EXIT_FUNC
ret
4 changes: 3 additions & 1 deletion decoder/armv8/ixheaacd_calcmaxspectralline.s
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
//*/


.include "ixheaacd_neon_macros.s"
.text
.global ixheaacd_calc_max_spectral_line_armv8
ixheaacd_calc_max_spectral_line_armv8:
ENTRY ixheaacd_calc_max_spectral_line_armv8

LSR W4, W1, #3
LSL W6, W4, #3
Expand Down Expand Up @@ -75,6 +76,7 @@ END_FUNC:
CLZ W0, W0
SUB W0, W0, #1

EXIT_FUNC
RET


Expand Down
5 changes: 3 additions & 2 deletions decoder/armv8/ixheaacd_cos_sin_mod_loop1.s
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
ldp q8, q9, [sp], #32
.endm

.include "ixheaacd_neon_macros.s"
.text
.p2align 2

.global ixheaacd_cos_sin_mod_loop1
ixheaacd_cos_sin_mod_loop1:
ENTRY ixheaacd_cos_sin_mod_loop1

// STMFD sp!, {x4-x12, x14}
push_v_regs
Expand Down Expand Up @@ -202,6 +202,7 @@ LOOP1:
// LDMFD sp!, {x4-x12, x15}
//ldp x19, x20,[sp],#16
pop_v_regs
EXIT_FUNC
ret


Expand Down
5 changes: 3 additions & 2 deletions decoder/armv8/ixheaacd_cos_sin_mod_loop2.s
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
ldp q8, q9, [sp], #32
.endm

.include "ixheaacd_neon_macros.s"
.text
.p2align 2

.global ixheaacd_cos_sin_mod_loop2
ixheaacd_cos_sin_mod_loop2:
ENTRY ixheaacd_cos_sin_mod_loop2

// STMFD sp!, {x4-x12, x14}
push_v_regs
Expand Down Expand Up @@ -210,4 +210,5 @@ LOOP1:
// LDMFD sp!, {x4-x12, x15}
//ldp x19, x20,[sp],#16
pop_v_regs
EXIT_FUNC
ret
5 changes: 3 additions & 2 deletions decoder/armv8/ixheaacd_fft32x32_ld2_armv8.s
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
.endm


.include "ixheaacd_neon_macros.s"
.text
.p2align 2
.global ixheaacd_fft32x32_ld2_armv8

ixheaacd_fft32x32_ld2_armv8:
ENTRY ixheaacd_fft32x32_ld2_armv8

// STMFD sp!, {x4-x12,x14}
push_v_regs
Expand Down Expand Up @@ -551,5 +551,6 @@ ixheaacd_fft32x32_ld2_armv8:
// LDMFD sp!, {x4-x12,x15}
ldp x19, x20, [sp], #16
pop_v_regs
EXIT_FUNC
ret

6 changes: 4 additions & 2 deletions decoder/armv8/ixheaacd_imdct_using_fft.s
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@
MOv \reg1, \reg2
MOv \reg2, x16
.endm

.include "ixheaacd_neon_macros.s"
.text
.p2align 2
.global ixheaacd_imdct_using_fft_armv8
ixheaacd_imdct_using_fft_armv8:
ENTRY ixheaacd_imdct_using_fft_armv8
push_v_regs

MOV X29, #11600
Expand Down Expand Up @@ -813,6 +814,7 @@ BYPASS_IF:
BNE OUTER_LOOP_R4
END_LOOPS:
pop_v_regs
EXIT_FUNC
RET


Expand Down
4 changes: 3 additions & 1 deletion decoder/armv8/ixheaacd_inv_dit_fft_8pt.s
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
.endm


.include "ixheaacd_neon_macros.s"
.text
.global ixheaacd_inv_dit_fft_8pt_armv8
ixheaacd_inv_dit_fft_8pt_armv8:
ENTRY ixheaacd_inv_dit_fft_8pt_armv8
push_v_regs
MOV w3, #0x5A820000
DUP v0.2s, w3
Expand Down Expand Up @@ -164,6 +165,7 @@ ixheaacd_inv_dit_fft_8pt_armv8:
//ST2 {v12.s,v13.s}[0],[x1]
//ST2 {v12.s,v13.s}[1],[x2]
pop_v_regs
EXIT_FUNC
ret


Expand Down
48 changes: 48 additions & 0 deletions decoder/armv8/ixheaacd_neon_macros.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// decoder/armv8/ixheaacd_armv8_macros.s

// --- Internal Security Dispatchers ---
.macro BTI_ENABLE
#if defined(__ARM_FEATURE_BTI_DEFAULT)
bti c
#endif
.endm

.macro PAC_ENTRY
#if defined(__ARM_FEATURE_PAC_DEFAULT)
paciasp
#endif
.endm

.macro PAC_EXIT
#if defined(__ARM_FEATURE_PAC_DEFAULT)
autiasp
#endif
.endm

// --- Main ENTRY and EXIT Macros ---
.macro ENTRY name
.p2align 2
\name:
BTI_ENABLE
PAC_ENTRY
.endm

.macro EXIT_FUNC
PAC_EXIT
.endm

// --- GNU Property Note ---
// Signals BTI and PAC support to the Android linker.
#if defined(__linux__) && defined(__aarch64__)
.pushsection .note.gnu.property, "a" // Switch to Note section
.p2align 3
.word 4 // Name size
.word 16 // Data size
.word 5 // NT_GNU_PROPERTY_TYPE_0
.asciz "GNU" // Owner
.word 0xc0000000 // GNU_PROPERTY_AARCH64_FEATURE_1_AND
.word 4 // Data size
.word 3 // Value: BTI (Bit 0) | PAC (Bit 1)
.word 0 // Padding
.popsection // Switch back to previous section
#endif
5 changes: 4 additions & 1 deletion decoder/armv8/ixheaacd_no_lap1.s
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
ldp q10, q11, [sp], #32
ldp q8, q9, [sp], #32
.endm

.include "ixheaacd_neon_macros.s"
.text
.global ixheaacd_neg_shift_spec_armv8
ixheaacd_neg_shift_spec_armv8:
ENTRY ixheaacd_neg_shift_spec_armv8
push_v_regs
MOV X5, #448
SUB X6, X5, #1
Expand Down Expand Up @@ -109,4 +111,5 @@ LOOP_1:
ST1 {V22.S}[0], [X1], X7
ST1 {V22.S}[1], [X1], X7
pop_v_regs
EXIT_FUNC
RET
4 changes: 3 additions & 1 deletion decoder/armv8/ixheaacd_overlap_add1.s
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
ldp q8, q9, [sp], #32
.endm

.include "ixheaacd_neon_macros.s"
.text
.global ixheaacd_over_lap_add1_armv8
ixheaacd_over_lap_add1_armv8:
ENTRY ixheaacd_over_lap_add1_armv8
push_v_regs
LSL X6 , X6 , #1
LSL X10, X5, #1
Expand Down Expand Up @@ -294,6 +295,7 @@ LOOP_1:
ST1 {V9.S}[2], [X6], X9
ST1 {V9.S}[3], [X6], X9
pop_v_regs
EXIT_FUNC
RET


Expand Down
5 changes: 4 additions & 1 deletion decoder/armv8/ixheaacd_overlap_add2.s
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@
ldp q10, q11, [sp], #32
ldp q8, q9, [sp], #32
.endm

.include "ixheaacd_neon_macros.s"
.text
.global ixheaacd_over_lap_add2_armv8


ixheaacd_over_lap_add2_armv8:
ENTRY ixheaacd_over_lap_add2_armv8
push_v_regs
MOV X8, X5
SUB X12, X5, #1
Expand Down Expand Up @@ -302,4 +304,5 @@ LOOP_2:
ST1 {V16.S}[3], [X7], X8

pop_v_regs
EXIT_FUNC
RET
5 changes: 4 additions & 1 deletion decoder/armv8/ixheaacd_post_twiddle.s
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
MOV \reg1, \reg2
MOV \reg2, x16
.endm

.include "ixheaacd_neon_macros.s"
.text
.global ixheaacd_post_twiddle_armv8
ixheaacd_post_twiddle_armv8:
ENTRY ixheaacd_post_twiddle_armv8


push_v_regs
Expand Down Expand Up @@ -698,6 +700,7 @@ NEON_EPILOGUE:


pop_v_regs
EXIT_FUNC
ret


Expand Down
5 changes: 3 additions & 2 deletions decoder/armv8/ixheaacd_post_twiddle_overlap.s
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
.endm


.include "ixheaacd_neon_macros.s"
.text
.p2align 2
.global ixheaacd_post_twid_overlap_add_armv8

ixheaacd_post_twid_overlap_add_armv8:
ENTRY ixheaacd_post_twid_overlap_add_armv8

// STMFD sp!, {x4-x12}
push_v_regs
Expand Down Expand Up @@ -1873,6 +1873,7 @@ ARM_LOOP:
ADD x5, x5, x10

pop_v_regs
EXIT_FUNC
ret


5 changes: 3 additions & 2 deletions decoder/armv8/ixheaacd_postradixcompute4.s
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
ldp X8, X9, [sp], #16
.endm

.include "ixheaacd_neon_macros.s"
.text
.p2align 2
.global ixheaacd_postradixcompute4


ixheaacd_postradixcompute4:
ENTRY ixheaacd_postradixcompute4

// STMFD sp!, {x4-x12, x14}
push_v_regs
Expand Down Expand Up @@ -143,6 +143,7 @@ POSTRADIX4_START:

// LDMFD sp!, {x4-x12, x15}
pop_v_regs
EXIT_FUNC
ret


5 changes: 4 additions & 1 deletion decoder/armv8/ixheaacd_pre_twiddle.s
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
MOV \reg1, \reg2
MOV \reg2, x16
.endm

.include "ixheaacd_neon_macros.s"
.text
.global ixheaacd_pretwiddle_compute_armv8

ixheaacd_pretwiddle_compute_armv8:
ENTRY ixheaacd_pretwiddle_compute_armv8

push_v_regs

Expand Down Expand Up @@ -506,6 +508,7 @@ RESIDUE_NEON:

END1:
pop_v_regs
EXIT_FUNC
ret


Expand Down
6 changes: 4 additions & 2 deletions decoder/armv8/ixheaacd_sbr_imdct_using_fft.s
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@
MOV \reg1, \reg2
MOV \reg2, x16
.endm

.include "ixheaacd_neon_macros.s"
.text
.p2align 2
.global ixheaacd_sbr_imdct_using_fft
ixheaacd_sbr_imdct_using_fft:
ENTRY ixheaacd_sbr_imdct_using_fft
push_v_regs


Expand Down Expand Up @@ -774,4 +775,5 @@ BYPASS_IF:
BNE OUTER_LOOP_R4
END_LOOPS:
pop_v_regs
EXIT_FUNC
RET
5 changes: 3 additions & 2 deletions decoder/armv8/ixheaacd_sbr_qmf_analysis32_neon.s
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
ldp d8, d9, [sp], #16
.endm

.include "ixheaacd_neon_macros.s"
.text
.p2align 2
.global ixheaacd_sbr_qmfanal32_winadds

ixheaacd_sbr_qmfanal32_winadds: // PROC
ENTRY ixheaacd_sbr_qmfanal32_winadds // PROC

// STMFD sp!, {x4-x12, x14}
push_v_regs
Expand Down Expand Up @@ -337,5 +337,6 @@ LOOP_1:
// LDMFD sp!, {x4-x12, x15}
ldp x19, x20, [sp], #16
pop_v_regs
EXIT_FUNC
ret
// ENDP
Loading
Loading