summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-05-04 20:45:33 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-05-04 20:45:33 +0000
commit117e943be6548c6e2aed04892f37b5f387dc8f87 (patch)
tree04fbcbaca9a465a2d060ef3270646d57551308ad
parent2d3e548cda4cf58511e647e7298f0dd40a50a626 (diff)
parent5b0b4eba89a3afd78cd162a8e598783346a63303 (diff)
downloadsonivox-117e943be6548c6e2aed04892f37b5f387dc8f87.tar.gz
Merge "Fix ARM assembler for clang."
-rw-r--r--arm-wt-22k/Android.bp15
-rw-r--r--arm-wt-22k/lib_src/ARM-E_filter_gnu.s4
-rw-r--r--arm-wt-22k/lib_src/ARM-E_interpolate_loop_gnu.s18
-rw-r--r--arm-wt-22k/lib_src/ARM-E_interpolate_noloop_gnu.s18
-rw-r--r--arm-wt-22k/lib_src/ARM-E_mastergain_gnu.s3
-rw-r--r--arm-wt-22k/lib_src/ARM-E_voice_gain_gnu.s14
-rw-r--r--arm-wt-22k/lib_src/ARM_synth_constants_gnu.inc54
7 files changed, 58 insertions, 68 deletions
diff --git a/arm-wt-22k/Android.bp b/arm-wt-22k/Android.bp
index 32c32ca..c05443b 100644
--- a/arm-wt-22k/Android.bp
+++ b/arm-wt-22k/Android.bp
@@ -111,22 +111,15 @@ cc_defaults {
// In order to use #include instead of .include
"-xassembler-with-cpp",
- "-Wa,--defsym,SAMPLE_RATE_22050=1",
- "-Wa,--defsym,STEREO_OUTPUT=1",
- "-Wa,--defsym,FILTER_ENABLED=1",
- "-Wa,--defsym,SAMPLES_16_BIT=1",
+ "-DSAMPLE_RATE_22050=1",
+ "-DSTEREO_OUTPUT=1",
+ "-DFILTER_ENABLED=1",
+ "-DSAMPLES_16_BIT=1",
],
cflags: [
"-DNATIVE_EAS_KERNEL",
],
-
- // .s files not ported for Clang assembler yet.
- clang_asflags: ["-no-integrated-as"],
- },
- arm64: {
- // .s files not ported for Clang assembler yet.
- clang_asflags: ["-no-integrated-as"],
},
},
sanitize: {
diff --git a/arm-wt-22k/lib_src/ARM-E_filter_gnu.s b/arm-wt-22k/lib_src/ARM-E_filter_gnu.s
index 859d9a4..c4ffd55 100644
--- a/arm-wt-22k/lib_src/ARM-E_filter_gnu.s
+++ b/arm-wt-22k/lib_src/ARM-E_filter_gnu.s
@@ -55,7 +55,6 @@ tmp2 .req r10
@RestoreRegs RLIST {r4-r10, pc}
- .func WT_VoiceFilter
WT_VoiceFilter:
STMFD sp!, {r4-r10, lr}
@@ -112,7 +111,7 @@ FilterLoop:
MOV z1, tmp1, ASR #14 @ shift result to low word
- LDRGTSH tmp0, [pBuffer, #NEXT_OUTPUT_PCM] @ fetch next sample
+ LDRSHGT tmp0, [pBuffer, #NEXT_OUTPUT_PCM] @ fetch next sample
STRH z1, [pBuffer], #NEXT_OUTPUT_PCM @ write back to buffer
@@ -129,6 +128,5 @@ FilterLoop:
LDMFD sp!,{r4-r10, lr}
BX lr
- .endfunc
.end
diff --git a/arm-wt-22k/lib_src/ARM-E_interpolate_loop_gnu.s b/arm-wt-22k/lib_src/ARM-E_interpolate_loop_gnu.s
index 2529e93..59ab0fd 100644
--- a/arm-wt-22k/lib_src/ARM-E_interpolate_loop_gnu.s
+++ b/arm-wt-22k/lib_src/ARM-E_interpolate_loop_gnu.s
@@ -56,7 +56,6 @@ phaseFracMask .req r11
@SaveRegs RLIST {r4-r11,lr}
@RestoreRegs RLIST {r4-r11,pc}
- .func WT_Interpolate
WT_Interpolate:
STMFD sp!,{r4-r11,lr}
@@ -81,13 +80,15 @@ InterpolationLoop:
SUBS tmp0, pPhaseAccum, pLoopEnd @ check for loop end
ADDGE pPhaseAccum, pLoopStart, tmp0 @ loop back to start
- .ifdef SAMPLES_8_BIT
+ #ifdef SAMPLES_8_BIT
LDRSB tmp0, [pPhaseAccum] @ tmp0 = x0
LDRSB tmp1, [pPhaseAccum, #1] @ tmp1 = x1
- .else
+ #elif SAMPLES_16_BIT
LDRSH tmp0, [pPhaseAccum] @ tmp0 = x0
LDRSH tmp1, [pPhaseAccum, #2] @ tmp1 = x1
- .endif
+ #else
+ #error Must define one of SAMPLES_8_BIT or SAMPLES_16_BIT.
+ #endif
ADD tmp2, phaseIncrement, phaseFrac @ increment pointer here to avoid pipeline stall
@@ -101,11 +102,13 @@ InterpolationLoop:
@ saturation operation should take in the filter before scaling back to
@ 16 bits or the signal path should be increased to 18 bits or more.
- .ifdef SAMPLES_8_BIT
+ #ifdef SAMPLES_8_BIT
MOV tmp0, tmp0, LSL #6 @ boost 8-bit signal by 36dB
- .else
+ #elif SAMPLES_16_BIT
MOV tmp0, tmp0, ASR #2 @ reduce 16-bit signal by 12dB
- .endif
+ #else
+ #error Must define one of SAMPLES_8_BIT or SAMPLES_16_BIT.
+ #endif
ADD tmp1, tmp0, tmp1, ASR #(NUM_EG1_FRAC_BITS-6) @ tmp1 = tmp0 + (tmp1 >> (15-6))
@ = x0 + f * (x1 - x0) == interpolated result
@@ -126,6 +129,5 @@ InterpolationLoop:
LDMFD sp!,{r4-r11,lr}
BX lr
- .endfunc
.end
diff --git a/arm-wt-22k/lib_src/ARM-E_interpolate_noloop_gnu.s b/arm-wt-22k/lib_src/ARM-E_interpolate_noloop_gnu.s
index 55a0ba7..baa6f7a 100644
--- a/arm-wt-22k/lib_src/ARM-E_interpolate_noloop_gnu.s
+++ b/arm-wt-22k/lib_src/ARM-E_interpolate_noloop_gnu.s
@@ -54,7 +54,6 @@ tmp2 .req r9
@SaveRegs RLIST {r4-r9,lr}
@RestoreRegs RLIST {r4-r9,pc}
- .func WT_InterpolateNoLoop
WT_InterpolateNoLoop:
STMFD sp!, {r4-r9,lr}
@@ -73,13 +72,15 @@ WT_InterpolateNoLoop:
InterpolationLoop:
- .ifdef SAMPLES_8_BIT
+ #ifdef SAMPLES_8_BIT
LDRSB tmp0, [pPhaseAccum] @ tmp0 = x0
LDRSB tmp1, [pPhaseAccum, #1] @ tmp1 = x1
- .else
+ #elif SAMPLES_16_BIT
LDRSH tmp0, [pPhaseAccum] @ tmp0 = x0
LDRSH tmp1, [pPhaseAccum, #2] @ tmp1 = x1
- .endif
+ #else
+ #error Must define one of SAMPLES_8_BIT or SAMPLES_16_BIT.
+ #endif
ADD tmp2, phaseIncrement, phaseFrac @ increment pointer here to avoid pipeline stall
@@ -93,11 +94,13 @@ InterpolationLoop:
@ saturation operation should take in the filter before scaling back to
@ 16 bits or the signal path should be increased to 18 bits or more.
- .ifdef SAMPLES_8_BIT
+ #ifdef SAMPLES_8_BIT
MOV tmp0, tmp0, LSL #6 @ boost 8-bit signal by 36dB
- .else
+ #elif SAMPLES_16_BIT
MOV tmp0, tmp0, ASR #2 @ reduce 16-bit signal by 12dB
- .endif
+ #else
+ #error Must define one of SAMPLES_8_BIT or SAMPLES_16_BIT.
+ #endif
ADD tmp1, tmp0, tmp1, ASR #(NUM_EG1_FRAC_BITS-6) @ tmp1 = tmp0 + (tmp1 >> (15-6))
@ = x0 + f * (x1 - x0) == interpolated result
@@ -125,6 +128,5 @@ InterpolationLoop:
LDMFD sp!,{r4-r9,lr}
BX lr
- .endfunc
.end
diff --git a/arm-wt-22k/lib_src/ARM-E_mastergain_gnu.s b/arm-wt-22k/lib_src/ARM-E_mastergain_gnu.s
index f443fbb..e53bb99 100644
--- a/arm-wt-22k/lib_src/ARM-E_mastergain_gnu.s
+++ b/arm-wt-22k/lib_src/ARM-E_mastergain_gnu.s
@@ -40,7 +40,6 @@
.arm
.text
- .func SynthMasterGain
SynthMasterGain:
.global SynthMasterGain @ allow other files to use this function
@@ -103,7 +102,5 @@ loop:
@*****************************************************************************
- .endfunc @ end of function/procedure
-
.end @ end of assembly code
diff --git a/arm-wt-22k/lib_src/ARM-E_voice_gain_gnu.s b/arm-wt-22k/lib_src/ARM-E_voice_gain_gnu.s
index 6ca28b2..9e1fcce 100644
--- a/arm-wt-22k/lib_src/ARM-E_voice_gain_gnu.s
+++ b/arm-wt-22k/lib_src/ARM-E_voice_gain_gnu.s
@@ -49,22 +49,21 @@ tmp3 .req r6
numSamples .req r9
- .if STEREO_OUTPUT
+ #if STEREO_OUTPUT
gainIncLeft .req r7
gainIncRight .req r8
gainLeft .req r10
gainRight .req r11
- .else
+ #else
gainIncrement .req r7
gain .req r8
- .endif
+ #endif
@ register context for local variables
@SaveRegs RLIST {r4-r11,lr}
@RestoreRegs RLIST {r4-r11,pc}
- .func WT_VoiceGain
WT_VoiceGain:
STMFD sp!, {r4-r11,lr}
@@ -80,7 +79,7 @@ WT_VoiceGain:
@ due to storage and computational dependencies.
@----------------------------------------------------------------
- .if STEREO_OUTPUT
+ #if STEREO_OUTPUT
LDR tmp0, [pWTFrame, #m_prevGain]
LDR tmp1, [pWTFrame, #m_gainTarget]
@@ -132,7 +131,7 @@ StereoGainLoop:
@----------------------------------------------------------------
@ Mono version
@----------------------------------------------------------------
- .else
+ #else
LDR gain, [pWTFrame, #m_prevGain]
MOV gain, gain, LSL #(NUM_MIXER_GUARD_BITS + 4)
@@ -156,11 +155,10 @@ MonoGainLoop:
SUBS numSamples, numSamples, #1
BGT MonoGainLoop
- .endif @end Mono version
+ #endif @end Mono version
LDMFD sp!,{r4-r11,lr}
BX lr
- .endfunc
.end
diff --git a/arm-wt-22k/lib_src/ARM_synth_constants_gnu.inc b/arm-wt-22k/lib_src/ARM_synth_constants_gnu.inc
index c0f8df3..213944e 100644
--- a/arm-wt-22k/lib_src/ARM_synth_constants_gnu.inc
+++ b/arm-wt-22k/lib_src/ARM_synth_constants_gnu.inc
@@ -12,45 +12,45 @@
@****************************************************************
- .ifdef SAMPLE_RATE_8000
+ #ifdef SAMPLE_RATE_8000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 5
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 32
- .endif
+ #endif
- .ifdef SAMPLE_RATE_16000
+ #ifdef SAMPLE_RATE_16000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 6
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 64
- .endif
+ #endif
- .ifdef SAMPLE_RATE_20000
+ #ifdef SAMPLE_RATE_20000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 7
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 128
- .endif
+ #endif
- .ifdef SAMPLE_RATE_22050
+ #ifdef SAMPLE_RATE_22050
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 7
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 128
- .endif
+ #endif
- .ifdef SAMPLE_RATE_24000
+ #ifdef SAMPLE_RATE_24000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 7
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 128
- .endif
+ #endif
- .ifdef SAMPLE_RATE_32000
+ #ifdef SAMPLE_RATE_32000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 7
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 128
- .endif
+ #endif
- .ifdef SAMPLE_RATE_44100
+ #ifdef SAMPLE_RATE_44100
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 8
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 256
- .endif
+ #endif
- .ifdef SAMPLE_RATE_48000
+ #ifdef SAMPLE_RATE_48000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 8
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 256
- .endif
+ #endif
@ if the OUTPUT PCM sample is 16-bits, then when using indexed addressing,
@@ -64,13 +64,13 @@
.equ PHASE_FRAC_MASK, 0x7FFF
@ shift for phase accumulator when fraction carries over
- .ifdef SAMPLES_8_BIT
+ #ifdef SAMPLES_8_BIT
.equ NEXT_INPUT_PCM_SHIFT, 0
- .endif
+ #endif
- .ifdef SAMPLES_16_BIT
+ #ifdef SAMPLES_16_BIT
.equ NEXT_INPUT_PCM_SHIFT, 1
- .endif
+ #endif
@****************************************************************************
.equ NUM_MIXER_GUARD_BITS, 4
@@ -90,19 +90,19 @@
@ handle a struct in a compatible fashion. Switching to old fashion EQU
@
- .if FILTER_ENABLED
+ #if FILTER_ENABLED
@**************************************
@ typedef struct s_filter_tag
.equ m_z1, 0
.equ m_z2, 2
- .endif
+ #endif
@**************************************
@ typedef struct s_wt_frame_tag
.equ m_gainTarget, 0
.equ m_phaseIncrement, 4
- .if FILTER_ENABLED
+ #if FILTER_ENABLED
.equ m_k, 8
.equ m_b1, 12
.equ m_b2, 16
@@ -110,12 +110,12 @@
.equ m_pMixBuffer, 24
.equ m_numSamples, 28
.equ m_prevGain, 32
- .else
+ #else
.equ m_pAudioBuffer, 8
.equ m_pMixBuffer, 12
.equ m_numSamples, 16
.equ m_prevGain, 20
- .endif
+ #endif
@**************************************
@@ -125,10 +125,10 @@
.equ m_pPhaseAccum, 8 @ /* points to first sample at start of loop */
.equ m_phaseFrac, 12 @ /* points to first sample at start of loop */
- .if STEREO_OUTPUT
+ #if STEREO_OUTPUT
.equ m_gainLeft, 16 @ /* current gain, left ch */
.equ m_gainRight, 18 @ /* current gain, right ch */
- .endif
+ #endif
@****************************************************************************