michael@0: ;******************************************************************** michael@0: ;* * michael@0: ;* THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * michael@0: ;* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * michael@0: ;* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * michael@0: ;* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * michael@0: ;* * michael@0: ;* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2010 * michael@0: ;* by the Xiph.Org Foundation and contributors http://www.xiph.org/ * michael@0: ;* * michael@0: ;******************************************************************** michael@0: ; Original implementation: michael@0: ; Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd michael@0: ; last mod: $Id: armidct.s 17481 2010-10-03 22:49:42Z tterribe $ michael@0: ;******************************************************************** michael@0: michael@0: AREA |.text|, CODE, READONLY michael@0: michael@0: ; Explicitly specifying alignment here because some versions of michael@0: ; gas don't align code correctly. See michael@0: ; http://lists.gnu.org/archive/html/bug-binutils/2011-06/msg00199.html michael@0: ; https://bugzilla.mozilla.org/show_bug.cgi?id=920992 michael@0: ALIGN michael@0: michael@0: GET armopts.s michael@0: michael@0: EXPORT oc_idct8x8_1_arm michael@0: EXPORT oc_idct8x8_arm michael@0: michael@0: oc_idct8x8_1_arm PROC michael@0: ; r0 = ogg_int16_t *_y michael@0: ; r1 = ogg_uint16_t _dc michael@0: ORR r1, r1, r1, LSL #16 michael@0: MOV r2, r1 michael@0: MOV r3, r1 michael@0: MOV r12,r1 michael@0: STMIA r0!,{r1,r2,r3,r12} michael@0: STMIA r0!,{r1,r2,r3,r12} michael@0: STMIA r0!,{r1,r2,r3,r12} michael@0: STMIA r0!,{r1,r2,r3,r12} michael@0: STMIA r0!,{r1,r2,r3,r12} michael@0: STMIA r0!,{r1,r2,r3,r12} michael@0: STMIA r0!,{r1,r2,r3,r12} michael@0: STMIA r0!,{r1,r2,r3,r12} michael@0: MOV PC, r14 michael@0: ENDP michael@0: michael@0: oc_idct8x8_arm PROC michael@0: ; r0 = ogg_int16_t *_y michael@0: ; r1 = ogg_int16_t *_x michael@0: ; r2 = int _last_zzi michael@0: CMP r2, #3 michael@0: BLE oc_idct8x8_3_arm michael@0: CMP r2, #6 michael@0: BLE oc_idct8x8_6_arm michael@0: CMP r2, #10 michael@0: BLE oc_idct8x8_10_arm michael@0: oc_idct8x8_slow_arm michael@0: STMFD r13!,{r4-r11,r14} michael@0: SUB r13,r13,#64*2 michael@0: ; Row transforms michael@0: STR r0, [r13,#-4]! michael@0: ADD r0, r13, #4 ; Write to temp storage. michael@0: BL idct8core_arm michael@0: BL idct8core_arm michael@0: BL idct8core_arm michael@0: BL idct8core_arm michael@0: BL idct8core_arm michael@0: BL idct8core_arm michael@0: BL idct8core_arm michael@0: BL idct8core_arm michael@0: LDR r0, [r13], #4 ; Write to the final destination. michael@0: ; Clear input data for next block (decoder only). michael@0: SUB r2, r1, #8*16 michael@0: CMP r0, r2 michael@0: MOV r1, r13 ; And read from temp storage. michael@0: BEQ oc_idct8x8_slow_arm_cols michael@0: MOV r4, #0 michael@0: MOV r5, #0 michael@0: MOV r6, #0 michael@0: MOV r7, #0 michael@0: STMIA r2!,{r4,r5,r6,r7} michael@0: STMIA r2!,{r4,r5,r6,r7} michael@0: STMIA r2!,{r4,r5,r6,r7} michael@0: STMIA r2!,{r4,r5,r6,r7} michael@0: STMIA r2!,{r4,r5,r6,r7} michael@0: STMIA r2!,{r4,r5,r6,r7} michael@0: STMIA r2!,{r4,r5,r6,r7} michael@0: STMIA r2!,{r4,r5,r6,r7} michael@0: oc_idct8x8_slow_arm_cols michael@0: ; Column transforms michael@0: BL idct8core_down_arm michael@0: BL idct8core_down_arm michael@0: BL idct8core_down_arm michael@0: BL idct8core_down_arm michael@0: BL idct8core_down_arm michael@0: BL idct8core_down_arm michael@0: BL idct8core_down_arm michael@0: BL idct8core_down_arm michael@0: ADD r13,r13,#64*2 michael@0: LDMFD r13!,{r4-r11,PC} michael@0: ENDP michael@0: michael@0: oc_idct8x8_10_arm PROC michael@0: STMFD r13!,{r4-r11,r14} michael@0: SUB r13,r13,#64*2 michael@0: ; Row transforms michael@0: MOV r2, r0 michael@0: MOV r0, r13 ; Write to temp storage. michael@0: BL idct4core_arm michael@0: BL idct3core_arm michael@0: BL idct2core_arm michael@0: BL idct1core_arm michael@0: ; Clear input data for next block (decoder only). michael@0: SUB r0, r1, #4*16 michael@0: CMP r0, r2 michael@0: MOV r1, r13 ; Read from temp storage. michael@0: BEQ oc_idct8x8_10_arm_cols michael@0: MOV r4, #0 michael@0: STR r4, [r0] michael@0: STR r4, [r0,#4] michael@0: STR r4, [r0,#16] michael@0: STR r4, [r0,#20] michael@0: STR r4, [r0,#32] michael@0: STR r4, [r0,#48] michael@0: MOV r0, r2 ; Write to the final destination michael@0: oc_idct8x8_10_arm_cols michael@0: ; Column transforms michael@0: BL idct4core_down_arm michael@0: BL idct4core_down_arm michael@0: BL idct4core_down_arm michael@0: BL idct4core_down_arm michael@0: BL idct4core_down_arm michael@0: BL idct4core_down_arm michael@0: BL idct4core_down_arm michael@0: BL idct4core_down_arm michael@0: ADD r13,r13,#64*2 michael@0: LDMFD r13!,{r4-r11,PC} michael@0: ENDP michael@0: michael@0: oc_idct8x8_6_arm PROC michael@0: STMFD r13!,{r4-r7,r9-r11,r14} michael@0: SUB r13,r13,#64*2 michael@0: ; Row transforms michael@0: MOV r2, r0 michael@0: MOV r0, r13 ; Write to temp storage. michael@0: BL idct3core_arm michael@0: BL idct2core_arm michael@0: BL idct1core_arm michael@0: ; Clear input data for next block (decoder only). michael@0: SUB r0, r1, #3*16 michael@0: CMP r0, r2 michael@0: MOV r1, r13 ; Read from temp storage. michael@0: BEQ oc_idct8x8_6_arm_cols michael@0: MOV r4, #0 michael@0: STR r4, [r0] michael@0: STR r4, [r0,#4] michael@0: STR r4, [r0,#16] michael@0: STR r4, [r0,#32] michael@0: MOV r0, r2 ; Write to the final destination michael@0: oc_idct8x8_6_arm_cols michael@0: ; Column transforms michael@0: BL idct3core_down_arm michael@0: BL idct3core_down_arm michael@0: BL idct3core_down_arm michael@0: BL idct3core_down_arm michael@0: BL idct3core_down_arm michael@0: BL idct3core_down_arm michael@0: BL idct3core_down_arm michael@0: BL idct3core_down_arm michael@0: ADD r13,r13,#64*2 michael@0: LDMFD r13!,{r4-r7,r9-r11,PC} michael@0: ENDP michael@0: michael@0: oc_idct8x8_3_arm PROC michael@0: STMFD r13!,{r4-r7,r9-r11,r14} michael@0: SUB r13,r13,#64*2 michael@0: ; Row transforms michael@0: MOV r2, r0 michael@0: MOV r0, r13 ; Write to temp storage. michael@0: BL idct2core_arm michael@0: BL idct1core_arm michael@0: ; Clear input data for next block (decoder only). michael@0: SUB r0, r1, #2*16 michael@0: CMP r0, r2 michael@0: MOV r1, r13 ; Read from temp storage. michael@0: MOVNE r4, #0 michael@0: STRNE r4, [r0] michael@0: STRNE r4, [r0,#16] michael@0: MOVNE r0, r2 ; Write to the final destination michael@0: ; Column transforms michael@0: BL idct2core_down_arm michael@0: BL idct2core_down_arm michael@0: BL idct2core_down_arm michael@0: BL idct2core_down_arm michael@0: BL idct2core_down_arm michael@0: BL idct2core_down_arm michael@0: BL idct2core_down_arm michael@0: BL idct2core_down_arm michael@0: ADD r13,r13,#64*2 michael@0: LDMFD r13!,{r4-r7,r9-r11,PC} michael@0: ENDP michael@0: michael@0: idct1core_arm PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: LDRSH r3, [r1], #16 michael@0: MOV r12,#0x05 michael@0: ORR r12,r12,#0xB500 michael@0: MUL r3, r12, r3 michael@0: ; Stall ? michael@0: MOV r3, r3, ASR #16 michael@0: STRH r3, [r0], #2 michael@0: STRH r3, [r0, #14] michael@0: STRH r3, [r0, #30] michael@0: STRH r3, [r0, #46] michael@0: STRH r3, [r0, #62] michael@0: STRH r3, [r0, #78] michael@0: STRH r3, [r0, #94] michael@0: STRH r3, [r0, #110] michael@0: MOV PC,R14 michael@0: ENDP michael@0: michael@0: idct2core_arm PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: LDRSH r9, [r1], #16 ; r9 = x[0] michael@0: LDR r12,OC_C4S4 michael@0: LDRSH r11,[r1, #-14] ; r11= x[1] michael@0: LDR r3, OC_C7S1 michael@0: MUL r9, r12,r9 ; r9 = t[0]<<16 = OC_C4S4*x[0] michael@0: LDR r10,OC_C1S7 michael@0: MUL r3, r11,r3 ; r3 = t[4]<<16 = OC_C7S1*x[1] michael@0: MOV r9, r9, ASR #16 ; r9 = t[0] michael@0: MUL r11,r10,r11 ; r11= t[7]<<16 = OC_C1S7*x[1] michael@0: MOV r3, r3, ASR #16 ; r3 = t[4] michael@0: MUL r10,r12,r3 ; r10= t[5]<<16 = OC_C4S4*t[4] michael@0: MOV r11,r11,ASR #16 ; r11= t[7] michael@0: MUL r12,r11,r12 ; r12= t[6]<<16 = OC_C4S4*t[7] michael@0: MOV r10,r10,ASR #16 ; r10= t[5] michael@0: ADD r12,r9,r12,ASR #16 ; r12= t[0]+t[6] michael@0: ADD r12,r12,r10 ; r12= t[0]+t2[6] = t[0]+t[6]+t[5] michael@0: SUB r10,r12,r10,LSL #1 ; r10= t[0]+t2[5] = t[0]+t[6]-t[5] michael@0: ADD r3, r3, r9 ; r3 = t[0]+t[4] michael@0: ADD r11,r11,r9 ; r11= t[0]+t[7] michael@0: STRH r11,[r0], #2 ; y[0] = t[0]+t[7] michael@0: STRH r12,[r0, #14] ; y[1] = t[0]+t[6] michael@0: STRH r10,[r0, #30] ; y[2] = t[0]+t[5] michael@0: STRH r3, [r0, #46] ; y[3] = t[0]+t[4] michael@0: RSB r3, r3, r9, LSL #1 ; r3 = t[0]*2-(t[0]+t[4])=t[0]-t[4] michael@0: RSB r10,r10,r9, LSL #1 ; r10= t[0]*2-(t[0]+t[5])=t[0]-t[5] michael@0: RSB r12,r12,r9, LSL #1 ; r12= t[0]*2-(t[0]+t[6])=t[0]-t[6] michael@0: RSB r11,r11,r9, LSL #1 ; r1 = t[0]*2-(t[0]+t[7])=t[0]-t[7] michael@0: STRH r3, [r0, #62] ; y[4] = t[0]-t[4] michael@0: STRH r10,[r0, #78] ; y[5] = t[0]-t[5] michael@0: STRH r12,[r0, #94] ; y[6] = t[0]-t[6] michael@0: STRH r11,[r0, #110] ; y[7] = t[0]-t[7] michael@0: MOV PC,r14 michael@0: ENDP michael@0: michael@0: idct2core_down_arm PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: LDRSH r9, [r1], #16 ; r9 = x[0] michael@0: LDR r12,OC_C4S4 michael@0: LDRSH r11,[r1, #-14] ; r11= x[1] michael@0: LDR r3, OC_C7S1 michael@0: MUL r9, r12,r9 ; r9 = t[0]<<16 = OC_C4S4*x[0] michael@0: LDR r10,OC_C1S7 michael@0: MUL r3, r11,r3 ; r3 = t[4]<<16 = OC_C7S1*x[1] michael@0: MOV r9, r9, ASR #16 ; r9 = t[0] michael@0: MUL r11,r10,r11 ; r11= t[7]<<16 = OC_C1S7*x[1] michael@0: ADD r9, r9, #8 ; r9 = t[0]+8 michael@0: MOV r3, r3, ASR #16 ; r3 = t[4] michael@0: MUL r10,r12,r3 ; r10= t[5]<<16 = OC_C4S4*t[4] michael@0: MOV r11,r11,ASR #16 ; r11= t[7] michael@0: MUL r12,r11,r12 ; r12= t[6]<<16 = OC_C4S4*t[7] michael@0: MOV r10,r10,ASR #16 ; r10= t[5] michael@0: ADD r12,r9,r12,ASR #16 ; r12= t[0]+t[6]+8 michael@0: ADD r12,r12,r10 ; r12= t[0]+t2[6] = t[0]+t[6]+t[5]+8 michael@0: SUB r10,r12,r10,LSL #1 ; r10= t[0]+t2[5] = t[0]+t[6]-t[5]+8 michael@0: ADD r3, r3, r9 ; r3 = t[0]+t[4]+8 michael@0: ADD r11,r11,r9 ; r11= t[0]+t[7]+8 michael@0: ; TODO: This is wrong. michael@0: ; The C code truncates to 16 bits by storing to RAM and doing the michael@0: ; shifts later; we've got an extra 4 bits here. michael@0: MOV r4, r11,ASR #4 michael@0: MOV r5, r12,ASR #4 michael@0: MOV r6, r10,ASR #4 michael@0: MOV r7, r3, ASR #4 michael@0: RSB r3, r3, r9, LSL #1 ;r3 =t[0]*2+8-(t[0]+t[4])=t[0]-t[4]+8 michael@0: RSB r10,r10,r9, LSL #1 ;r10=t[0]*2+8-(t[0]+t[5])=t[0]-t[5]+8 michael@0: RSB r12,r12,r9, LSL #1 ;r12=t[0]*2+8-(t[0]+t[6])=t[0]-t[6]+8 michael@0: RSB r11,r11,r9, LSL #1 ;r11=t[0]*2+8-(t[0]+t[7])=t[0]-t[7]+8 michael@0: MOV r3, r3, ASR #4 michael@0: MOV r10,r10,ASR #4 michael@0: MOV r12,r12,ASR #4 michael@0: MOV r11,r11,ASR #4 michael@0: STRH r4, [r0], #2 ; y[0] = t[0]+t[7] michael@0: STRH r5, [r0, #14] ; y[1] = t[0]+t[6] michael@0: STRH r6, [r0, #30] ; y[2] = t[0]+t[5] michael@0: STRH r7, [r0, #46] ; y[3] = t[0]+t[4] michael@0: STRH r3, [r0, #62] ; y[4] = t[0]-t[4] michael@0: STRH r10,[r0, #78] ; y[5] = t[0]-t[5] michael@0: STRH r12,[r0, #94] ; y[6] = t[0]-t[6] michael@0: STRH r11,[r0, #110] ; y[7] = t[0]-t[7] michael@0: MOV PC,r14 michael@0: ENDP michael@0: michael@0: idct3core_arm PROC michael@0: LDRSH r9, [r1], #16 ; r9 = x[0] michael@0: LDR r12,OC_C4S4 ; r12= OC_C4S4 michael@0: LDRSH r3, [r1, #-12] ; r3 = x[2] michael@0: LDR r10,OC_C6S2 ; r10= OC_C6S2 michael@0: MUL r9, r12,r9 ; r9 = t[0]<<16 = OC_C4S4*x[0] michael@0: LDR r4, OC_C2S6 ; r4 = OC_C2S6 michael@0: MUL r10,r3, r10 ; r10= t[2]<<16 = OC_C6S2*x[2] michael@0: LDRSH r11,[r1, #-14] ; r11= x[1] michael@0: MUL r3, r4, r3 ; r3 = t[3]<<16 = OC_C2S6*x[2] michael@0: LDR r4, OC_C7S1 ; r4 = OC_C7S1 michael@0: LDR r5, OC_C1S7 ; r5 = OC_C1S7 michael@0: MOV r9, r9, ASR #16 ; r9 = t[0] michael@0: MUL r4, r11,r4 ; r4 = t[4]<<16 = OC_C7S1*x[1] michael@0: ADD r3, r9, r3, ASR #16 ; r3 = t[0]+t[3] michael@0: MUL r11,r5, r11 ; r11= t[7]<<16 = OC_C1S7*x[1] michael@0: MOV r4, r4, ASR #16 ; r4 = t[4] michael@0: MUL r5, r12,r4 ; r5 = t[5]<<16 = OC_C4S4*t[4] michael@0: MOV r11,r11,ASR #16 ; r11= t[7] michael@0: MUL r12,r11,r12 ; r12= t[6]<<16 = OC_C4S4*t[7] michael@0: ADD r10,r9, r10,ASR #16 ; r10= t[1] = t[0]+t[2] michael@0: RSB r6, r10,r9, LSL #1 ; r6 = t[2] = t[0]-t[2] michael@0: ; r3 = t2[0] = t[0]+t[3] michael@0: RSB r9, r3, r9, LSL #1 ; r9 = t2[3] = t[0]-t[3] michael@0: MOV r12,r12,ASR #16 ; r12= t[6] michael@0: ADD r5, r12,r5, ASR #16 ; r5 = t2[6] = t[6]+t[5] michael@0: RSB r12,r5, r12,LSL #1 ; r12= t2[5] = t[6]-t[5] michael@0: ADD r11,r3, r11 ; r11= t2[0]+t[7] michael@0: ADD r5, r10,r5 ; r5 = t[1]+t2[6] michael@0: ADD r12,r6, r12 ; r12= t[2]+t2[5] michael@0: ADD r4, r9, r4 ; r4 = t2[3]+t[4] michael@0: STRH r11,[r0], #2 ; y[0] = t[0]+t[7] michael@0: STRH r5, [r0, #14] ; y[1] = t[1]+t2[6] michael@0: STRH r12,[r0, #30] ; y[2] = t[2]+t2[5] michael@0: STRH r4, [r0, #46] ; y[3] = t2[3]+t[4] michael@0: RSB r11,r11,r3, LSL #1 ; r11= t2[0] - t[7] michael@0: RSB r5, r5, r10,LSL #1 ; r5 = t[1] - t2[6] michael@0: RSB r12,r12,r6, LSL #1 ; r6 = t[2] - t2[5] michael@0: RSB r4, r4, r9, LSL #1 ; r4 = t2[3] - t[4] michael@0: STRH r4, [r0, #62] ; y[4] = t2[3]-t[4] michael@0: STRH r12,[r0, #78] ; y[5] = t[2]-t2[5] michael@0: STRH r5, [r0, #94] ; y[6] = t[1]-t2[6] michael@0: STRH r11,[r0, #110] ; y[7] = t2[0]-t[7] michael@0: MOV PC,R14 michael@0: ENDP michael@0: michael@0: idct3core_down_arm PROC michael@0: LDRSH r9, [r1], #16 ; r9 = x[0] michael@0: LDR r12,OC_C4S4 ; r12= OC_C4S4 michael@0: LDRSH r3, [r1, #-12] ; r3 = x[2] michael@0: LDR r10,OC_C6S2 ; r10= OC_C6S2 michael@0: MUL r9, r12,r9 ; r9 = t[0]<<16 = OC_C4S4*x[0] michael@0: LDR r4, OC_C2S6 ; r4 = OC_C2S6 michael@0: MUL r10,r3, r10 ; r10= t[2]<<16 = OC_C6S2*x[2] michael@0: LDRSH r11,[r1, #-14] ; r11= x[1] michael@0: MUL r3, r4, r3 ; r3 = t[3]<<16 = OC_C2S6*x[2] michael@0: LDR r4, OC_C7S1 ; r4 = OC_C7S1 michael@0: LDR r5, OC_C1S7 ; r5 = OC_C1S7 michael@0: MOV r9, r9, ASR #16 ; r9 = t[0] michael@0: MUL r4, r11,r4 ; r4 = t[4]<<16 = OC_C7S1*x[1] michael@0: ADD r9, r9, #8 ; r9 = t[0]+8 michael@0: MUL r11,r5, r11 ; r11= t[7]<<16 = OC_C1S7*x[1] michael@0: ADD r3, r9, r3, ASR #16 ; r3 = t[0]+t[3]+8 michael@0: MOV r4, r4, ASR #16 ; r4 = t[4] michael@0: MUL r5, r12,r4 ; r5 = t[5]<<16 = OC_C4S4*t[4] michael@0: MOV r11,r11,ASR #16 ; r11= t[7] michael@0: MUL r12,r11,r12 ; r12= t[6]<<16 = OC_C4S4*t[7] michael@0: ADD r10,r9, r10,ASR #16 ; r10= t[1]+8 = t[0]+t[2]+8 michael@0: RSB r6, r10,r9, LSL #1 ; r6 = t[2]+8 = t[0]-t[2]+8 michael@0: ; r3 = t2[0]+8 = t[0]+t[3]+8 michael@0: RSB r9, r3, r9, LSL #1 ; r9 = t2[3]+8 = t[0]-t[3]+8 michael@0: MOV r12,r12,ASR #16 ; r12= t[6] michael@0: ADD r5, r12,r5, ASR #16 ; r5 = t2[6] = t[6]+t[5] michael@0: RSB r12,r5, r12,LSL #1 ; r12= t2[5] = t[6]-t[5] michael@0: ADD r11,r3, r11 ; r11= t2[0]+t[7] +8 michael@0: ADD r5, r10,r5 ; r5 = t[1] +t2[6]+8 michael@0: ADD r12,r6, r12 ; r12= t[2] +t2[5]+8 michael@0: ADD r4, r9, r4 ; r4 = t2[3]+t[4] +8 michael@0: RSB r3, r11,r3, LSL #1 ; r11= t2[0] - t[7] + 8 michael@0: RSB r10,r5, r10,LSL #1 ; r5 = t[1] - t2[6] + 8 michael@0: RSB r6, r12,r6, LSL #1 ; r6 = t[2] - t2[5] + 8 michael@0: RSB r9, r4, r9, LSL #1 ; r4 = t2[3] - t[4] + 8 michael@0: ; TODO: This is wrong. michael@0: ; The C code truncates to 16 bits by storing to RAM and doing the michael@0: ; shifts later; we've got an extra 4 bits here. michael@0: MOV r11,r11,ASR #4 michael@0: MOV r5, r5, ASR #4 michael@0: MOV r12,r12,ASR #4 michael@0: MOV r4, r4, ASR #4 michael@0: MOV r9, r9, ASR #4 michael@0: MOV r6, r6, ASR #4 michael@0: MOV r10,r10,ASR #4 michael@0: MOV r3, r3, ASR #4 michael@0: STRH r11,[r0], #2 ; y[0] = t[0]+t[7] michael@0: STRH r5, [r0, #14] ; y[1] = t[1]+t2[6] michael@0: STRH r12,[r0, #30] ; y[2] = t[2]+t2[5] michael@0: STRH r4, [r0, #46] ; y[3] = t2[3]+t[4] michael@0: STRH r9, [r0, #62] ; y[4] = t2[3]-t[4] michael@0: STRH r6, [r0, #78] ; y[5] = t[2]-t2[5] michael@0: STRH r10,[r0, #94] ; y[6] = t[1]-t2[6] michael@0: STRH r3, [r0, #110] ; y[7] = t2[0]-t[7] michael@0: MOV PC,R14 michael@0: ENDP michael@0: michael@0: idct4core_arm PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: LDRSH r9, [r1], #16 ; r9 = x[0] michael@0: LDR r10,OC_C4S4 ; r10= OC_C4S4 michael@0: LDRSH r12,[r1, #-12] ; r12= x[2] michael@0: LDR r4, OC_C6S2 ; r4 = OC_C6S2 michael@0: MUL r9, r10,r9 ; r9 = t[0]<<16 = OC_C4S4*x[0] michael@0: LDR r5, OC_C2S6 ; r5 = OC_C2S6 michael@0: MUL r4, r12,r4 ; r4 = t[2]<<16 = OC_C6S2*x[2] michael@0: LDRSH r3, [r1, #-14] ; r3 = x[1] michael@0: MUL r5, r12,r5 ; r5 = t[3]<<16 = OC_C2S6*x[2] michael@0: LDR r6, OC_C7S1 ; r6 = OC_C7S1 michael@0: LDR r12,OC_C1S7 ; r12= OC_C1S7 michael@0: LDRSH r11,[r1, #-10] ; r11= x[3] michael@0: MUL r6, r3, r6 ; r6 = t[4]<<16 = OC_C7S1*x[1] michael@0: LDR r7, OC_C5S3 ; r7 = OC_C5S3 michael@0: MUL r3, r12,r3 ; r3 = t[7]<<16 = OC_C1S7*x[1] michael@0: LDR r8, OC_C3S5 ; r8 = OC_C3S5 michael@0: MUL r7, r11,r7 ; r7 = -t[5]<<16 = OC_C5S3*x[3] michael@0: MOV r9, r9, ASR #16 ; r9 = t[0] michael@0: MUL r11,r8, r11 ; r11= t[6]<<16 = OC_C3S5*x[3] michael@0: MOV r6, r6, ASR #16 ; r6 = t[4] michael@0: ; TODO: This is wrong; t[4]-t[5] and t[7]-t[6] need to be truncated to 16-bit michael@0: ; before multiplying, not after (this is not equivalent) michael@0: SUB r7, r6, r7, ASR #16 ; r7 = t2[4]=t[4]+t[5] (as r7=-t[5]) michael@0: RSB r6, r7, r6, LSL #1 ; r6 = t[4]-t[5] michael@0: MUL r6, r10,r6 ; r6 = t2[5]<<16 =OC_C4S4*(t[4]-t[5]) michael@0: MOV r3, r3, ASR #16 ; r3 = t[7] michael@0: ADD r11,r3, r11,ASR #16 ; r11= t2[7]=t[7]+t[6] michael@0: RSB r3, r11,r3, LSL #1 ; r3 = t[7]-t[6] michael@0: MUL r3, r10,r3 ; r3 = t2[6]<<16 =OC_C4S4*(t[7]-t[6]) michael@0: ADD r4, r9, r4, ASR #16 ; r4 = t[1] = t[0] + t[2] michael@0: RSB r10,r4, r9, LSL #1 ; r10= t[2] = t[0] - t[2] michael@0: ADD r5, r9, r5, ASR #16 ; r5 = t[0] = t[0] + t[3] michael@0: RSB r9, r5, r9, LSL #1 ; r9 = t[3] = t[0] - t[3] michael@0: MOV r3, r3, ASR #16 ; r3 = t2[6] michael@0: ADD r6, r3, r6, ASR #16 ; r6 = t3[6] = t2[6]+t2[5] michael@0: RSB r3, r6, r3, LSL #1 ; r3 = t3[5] = t2[6]-t2[5] michael@0: ADD r11,r5, r11 ; r11= t[0]+t2[7] michael@0: ADD r6, r4, r6 ; r6 = t[1]+t3[6] michael@0: ADD r3, r10,r3 ; r3 = t[2]+t3[5] michael@0: ADD r7, r9, r7 ; r7 = t[3]+t2[4] michael@0: STRH r11,[r0], #2 ; y[0] = t[0]+t[7] michael@0: STRH r6, [r0, #14] ; y[1] = t[1]+t2[6] michael@0: STRH r3, [r0, #30] ; y[2] = t[2]+t2[5] michael@0: STRH r7, [r0, #46] ; y[3] = t2[3]+t[4] michael@0: RSB r11,r11,r5, LSL #1 ; r11= t[0]-t2[7] michael@0: RSB r6, r6, r4, LSL #1 ; r6 = t[1]-t3[6] michael@0: RSB r3, r3, r10,LSL #1 ; r3 = t[2]-t3[5] michael@0: RSB r7, r7, r9, LSL #1 ; r7 = t[3]-t2[4] michael@0: STRH r7, [r0, #62] ; y[4] = t2[3]-t[4] michael@0: STRH r3, [r0, #78] ; y[5] = t[2]-t2[5] michael@0: STRH r6, [r0, #94] ; y[6] = t[1]-t2[6] michael@0: STRH r11, [r0, #110] ; y[7] = t2[0]-t[7] michael@0: MOV PC,r14 michael@0: ENDP michael@0: michael@0: idct4core_down_arm PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: LDRSH r9, [r1], #16 ; r9 = x[0] michael@0: LDR r10,OC_C4S4 ; r10= OC_C4S4 michael@0: LDRSH r12,[r1, #-12] ; r12= x[2] michael@0: LDR r4, OC_C6S2 ; r4 = OC_C6S2 michael@0: MUL r9, r10,r9 ; r9 = t[0]<<16 = OC_C4S4*x[0] michael@0: LDR r5, OC_C2S6 ; r5 = OC_C2S6 michael@0: MUL r4, r12,r4 ; r4 = t[2]<<16 = OC_C6S2*x[2] michael@0: LDRSH r3, [r1, #-14] ; r3 = x[1] michael@0: MUL r5, r12,r5 ; r5 = t[3]<<16 = OC_C2S6*x[2] michael@0: LDR r6, OC_C7S1 ; r6 = OC_C7S1 michael@0: LDR r12,OC_C1S7 ; r12= OC_C1S7 michael@0: LDRSH r11,[r1, #-10] ; r11= x[3] michael@0: MUL r6, r3, r6 ; r6 = t[4]<<16 = OC_C7S1*x[1] michael@0: LDR r7, OC_C5S3 ; r7 = OC_C5S3 michael@0: MUL r3, r12,r3 ; r3 = t[7]<<16 = OC_C1S7*x[1] michael@0: LDR r8, OC_C3S5 ; r8 = OC_C3S5 michael@0: MUL r7, r11,r7 ; r7 = -t[5]<<16 = OC_C5S3*x[3] michael@0: MOV r9, r9, ASR #16 ; r9 = t[0] michael@0: MUL r11,r8, r11 ; r11= t[6]<<16 = OC_C3S5*x[3] michael@0: MOV r6, r6, ASR #16 ; r6 = t[4] michael@0: ; TODO: This is wrong; t[4]-t[5] and t[7]-t[6] need to be truncated to 16-bit michael@0: ; before multiplying, not after (this is not equivalent) michael@0: SUB r7, r6, r7, ASR #16 ; r7 = t2[4]=t[4]+t[5] (as r7=-t[5]) michael@0: RSB r6, r7, r6, LSL #1 ; r6 = t[4]-t[5] michael@0: MUL r6, r10,r6 ; r6 = t2[5]<<16 =OC_C4S4*(t[4]-t[5]) michael@0: MOV r3, r3, ASR #16 ; r3 = t[7] michael@0: ADD r11,r3, r11,ASR #16 ; r11= t2[7]=t[7]+t[6] michael@0: RSB r3, r11,r3, LSL #1 ; r3 = t[7]-t[6] michael@0: ADD r9, r9, #8 ; r9 = t[0]+8 michael@0: MUL r3, r10,r3 ; r3 = t2[6]<<16 =OC_C4S4*(t[7]-t[6]) michael@0: ADD r4, r9, r4, ASR #16 ; r4 = t[1] = t[0] + t[2] + 8 michael@0: RSB r10,r4, r9, LSL #1 ; r10= t[2] = t[0] - t[2] + 8 michael@0: ADD r5, r9, r5, ASR #16 ; r5 = t[0] = t[0] + t[3] + 8 michael@0: RSB r9, r5, r9, LSL #1 ; r9 = t[3] = t[0] - t[3] + 8 michael@0: MOV r3, r3, ASR #16 ; r3 = t2[6] michael@0: ADD r6, r3, r6, ASR #16 ; r6 = t3[6] = t2[6]+t2[5] michael@0: RSB r3, r6, r3, LSL #1 ; r3 = t3[5] = t2[6]-t2[5] michael@0: ADD r5, r5, r11 ; r5 = t[0]+t2[7]+8 michael@0: ADD r4, r4, r6 ; r4 = t[1]+t3[6]+8 michael@0: ADD r10,r10,r3 ; r10= t[2]+t3[5]+8 michael@0: ADD r9, r9, r7 ; r9 = t[3]+t2[4]+8 michael@0: SUB r11,r5, r11,LSL #1 ; r11= t[0]-t2[7]+8 michael@0: SUB r6, r4, r6, LSL #1 ; r6 = t[1]-t3[6]+8 michael@0: SUB r3, r10,r3, LSL #1 ; r3 = t[2]-t3[5]+8 michael@0: SUB r7, r9, r7, LSL #1 ; r7 = t[3]-t2[4]+8 michael@0: ; TODO: This is wrong. michael@0: ; The C code truncates to 16 bits by storing to RAM and doing the michael@0: ; shifts later; we've got an extra 4 bits here. michael@0: MOV r11,r11,ASR #4 michael@0: MOV r6, r6, ASR #4 michael@0: MOV r3, r3, ASR #4 michael@0: MOV r7, r7, ASR #4 michael@0: MOV r9, r9, ASR #4 michael@0: MOV r10,r10,ASR #4 michael@0: MOV r4, r4, ASR #4 michael@0: MOV r5, r5, ASR #4 michael@0: STRH r5,[r0], #2 ; y[0] = t[0]+t[7] michael@0: STRH r4, [r0, #14] ; y[1] = t[1]+t2[6] michael@0: STRH r10,[r0, #30] ; y[2] = t[2]+t2[5] michael@0: STRH r9, [r0, #46] ; y[3] = t2[3]+t[4] michael@0: STRH r7, [r0, #62] ; y[4] = t2[3]-t[4] michael@0: STRH r3, [r0, #78] ; y[5] = t[2]-t2[5] michael@0: STRH r6, [r0, #94] ; y[6] = t[1]-t2[6] michael@0: STRH r11,[r0, #110] ; y[7] = t2[0]-t[7] michael@0: MOV PC,r14 michael@0: ENDP michael@0: michael@0: idct8core_arm PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: LDRSH r2, [r1],#16 ; r2 = x[0] michael@0: STMFD r13!,{r1,r14} michael@0: LDRSH r6, [r1, #-8] ; r6 = x[4] michael@0: LDR r12,OC_C4S4 ; r12= C4S4 michael@0: LDRSH r4, [r1, #-12] ; r4 = x[2] michael@0: ADD r2, r2, r6 ; r2 = x[0] + x[4] michael@0: SUB r6, r2, r6, LSL #1 ; r6 = x[0] - x[4] michael@0: ; For spec compliance, these sums must be truncated to 16-bit precision michael@0: ; _before_ the multiply (not after). michael@0: ; Sadly, ARMv4 provides no simple way to do that. michael@0: MOV r2, r2, LSL #16 michael@0: MOV r6, r6, LSL #16 michael@0: MOV r2, r2, ASR #16 michael@0: MOV r6, r6, ASR #16 michael@0: MUL r2, r12,r2 ; r2 = t[0]<<16 = C4S4*(x[0]+x[4]) michael@0: LDRSH r8, [r1, #-4] ; r8 = x[6] michael@0: LDR r7, OC_C6S2 ; r7 = OC_C6S2 michael@0: MUL r6, r12,r6 ; r6 = t[1]<<16 = C4S4*(x[0]-x[4]) michael@0: LDR r14,OC_C2S6 ; r14= OC_C2S6 michael@0: MUL r3, r4, r7 ; r3 = OC_C6S2*x[2] michael@0: LDR r5, OC_C7S1 ; r5 = OC_C7S1 michael@0: MUL r4, r14,r4 ; r4 = OC_C2S6*x[2] michael@0: MOV r3, r3, ASR #16 ; r3 = OC_C6S2*x[2]>>16 michael@0: MUL r14,r8, r14 ; r14= OC_C2S6*x[6] michael@0: MOV r4, r4, ASR #16 ; r4 = OC_C2S6*x[2]>>16 michael@0: MUL r8, r7, r8 ; r8 = OC_C6S2*x[6] michael@0: LDR r7, OC_C1S7 ; r7 = OC_C1S7 michael@0: SUB r3, r3, r14,ASR #16 ; r3=t[2]=C6S2*x[2]>>16-C2S6*x[6]>>16 michael@0: LDRSH r14,[r1, #-14] ; r14= x[1] michael@0: ADD r4, r4, r8, ASR #16 ; r4=t[3]=C2S6*x[2]>>16+C6S2*x[6]>>16 michael@0: LDRSH r8, [r1, #-2] ; r8 = x[7] michael@0: MUL r9, r5, r14 ; r9 = OC_C7S1*x[1] michael@0: LDRSH r10,[r1, #-6] ; r10= x[5] michael@0: MUL r14,r7, r14 ; r14= OC_C1S7*x[1] michael@0: MOV r9, r9, ASR #16 ; r9 = OC_C7S1*x[1]>>16 michael@0: MUL r7, r8, r7 ; r7 = OC_C1S7*x[7] michael@0: MOV r14,r14,ASR #16 ; r14= OC_C1S7*x[1]>>16 michael@0: MUL r8, r5, r8 ; r8 = OC_C7S1*x[7] michael@0: LDRSH r1, [r1, #-10] ; r1 = x[3] michael@0: LDR r5, OC_C3S5 ; r5 = OC_C3S5 michael@0: LDR r11,OC_C5S3 ; r11= OC_C5S3 michael@0: ADD r8, r14,r8, ASR #16 ; r8=t[7]=C1S7*x[1]>>16+C7S1*x[7]>>16 michael@0: MUL r14,r5, r10 ; r14= OC_C3S5*x[5] michael@0: SUB r9, r9, r7, ASR #16 ; r9=t[4]=C7S1*x[1]>>16-C1S7*x[7]>>16 michael@0: MUL r10,r11,r10 ; r10= OC_C5S3*x[5] michael@0: MOV r14,r14,ASR #16 ; r14= OC_C3S5*x[5]>>16 michael@0: MUL r11,r1, r11 ; r11= OC_C5S3*x[3] michael@0: MOV r10,r10,ASR #16 ; r10= OC_C5S3*x[5]>>16 michael@0: MUL r1, r5, r1 ; r1 = OC_C3S5*x[3] michael@0: SUB r14,r14,r11,ASR #16 ;r14=t[5]=C3S5*x[5]>>16-C5S3*x[3]>>16 michael@0: ADD r10,r10,r1, ASR #16 ;r10=t[6]=C5S3*x[5]>>16+C3S5*x[3]>>16 michael@0: ; r2=t[0]<<16 r3=t[2] r4=t[3] r6=t[1]<<16 r8=t[7] r9=t[4] michael@0: ; r10=t[6] r12=C4S4 r14=t[5] michael@0: ; TODO: This is wrong; t[4]-t[5] and t[7]-t[6] need to be truncated to 16-bit michael@0: ; before multiplying, not after (this is not equivalent) michael@0: ; Stage 2 michael@0: ; 4-5 butterfly michael@0: ADD r9, r9, r14 ; r9 = t2[4] = t[4]+t[5] michael@0: SUB r14,r9, r14, LSL #1 ; r14= t[4]-t[5] michael@0: MUL r14,r12,r14 ; r14= t2[5]<<16 = C4S4*(t[4]-t[5]) michael@0: ; 7-6 butterfly michael@0: ADD r8, r8, r10 ; r8 = t2[7] = t[7]+t[6] michael@0: SUB r10,r8, r10, LSL #1 ; r10= t[7]-t[6] michael@0: MUL r10,r12,r10 ; r10= t2[6]<<16 = C4S4*(t[7]+t[6]) michael@0: ; r2=t[0]<<16 r3=t[2] r4=t[3] r6=t[1]<<16 r8=t2[7] r9=t2[4] michael@0: ; r10=t2[6]<<16 r12=C4S4 r14=t2[5]<<16 michael@0: ; Stage 3 michael@0: ; 0-3 butterfly michael@0: ADD r2, r4, r2, ASR #16 ; r2 = t2[0] = t[0] + t[3] michael@0: SUB r4, r2, r4, LSL #1 ; r4 = t2[3] = t[0] - t[3] michael@0: ; 1-2 butterfly michael@0: ADD r6, r3, r6, ASR #16 ; r6 = t2[1] = t[1] + t[2] michael@0: SUB r3, r6, r3, LSL #1 ; r3 = t2[2] = t[1] - t[2] michael@0: ; 6-5 butterfly michael@0: MOV r14,r14,ASR #16 ; r14= t2[5] michael@0: ADD r10,r14,r10,ASR #16 ; r10= t3[6] = t[6] + t[5] michael@0: SUB r14,r10,r14,LSL #1 ; r14= t3[5] = t[6] - t[5] michael@0: ; r2=t2[0] r3=t2[2] r4=t2[3] r6=t2[1] r8=t2[7] r9=t2[4] michael@0: ; r10=t3[6] r14=t3[5] michael@0: ; Stage 4 michael@0: ADD r2, r2, r8 ; r2 = t[0] + t[7] michael@0: ADD r6, r6, r10 ; r6 = t[1] + t[6] michael@0: ADD r3, r3, r14 ; r3 = t[2] + t[5] michael@0: ADD r4, r4, r9 ; r4 = t[3] + t[4] michael@0: SUB r8, r2, r8, LSL #1 ; r8 = t[0] - t[7] michael@0: SUB r10,r6, r10,LSL #1 ; r10= t[1] - t[6] michael@0: SUB r14,r3, r14,LSL #1 ; r14= t[2] - t[5] michael@0: SUB r9, r4, r9, LSL #1 ; r9 = t[3] - t[4] michael@0: STRH r2, [r0], #2 ; y[0] = t[0]+t[7] michael@0: STRH r6, [r0, #14] ; y[1] = t[1]+t[6] michael@0: STRH r3, [r0, #30] ; y[2] = t[2]+t[5] michael@0: STRH r4, [r0, #46] ; y[3] = t[3]+t[4] michael@0: STRH r9, [r0, #62] ; y[4] = t[3]-t[4] michael@0: STRH r14,[r0, #78] ; y[5] = t[2]-t[5] michael@0: STRH r10,[r0, #94] ; y[6] = t[1]-t[6] michael@0: STRH r8, [r0, #110] ; y[7] = t[0]-t[7] michael@0: LDMFD r13!,{r1,PC} michael@0: ENDP michael@0: michael@0: idct8core_down_arm PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: LDRSH r2, [r1],#16 ; r2 = x[0] michael@0: STMFD r13!,{r1,r14} michael@0: LDRSH r6, [r1, #-8] ; r6 = x[4] michael@0: LDR r12,OC_C4S4 ; r12= C4S4 michael@0: LDRSH r4, [r1, #-12] ; r4 = x[2] michael@0: ADD r2, r2, r6 ; r2 = x[0] + x[4] michael@0: SUB r6, r2, r6, LSL #1 ; r6 = x[0] - x[4] michael@0: ; For spec compliance, these sums must be truncated to 16-bit precision michael@0: ; _before_ the multiply (not after). michael@0: ; Sadly, ARMv4 provides no simple way to do that. michael@0: MOV r2, r2, LSL #16 michael@0: MOV r6, r6, LSL #16 michael@0: MOV r2, r2, ASR #16 michael@0: MOV r6, r6, ASR #16 michael@0: MUL r2, r12,r2 ; r2 = t[0]<<16 = C4S4*(x[0]+x[4]) michael@0: LDRSH r8, [r1, #-4] ; r8 = x[6] michael@0: LDR r7, OC_C6S2 ; r7 = OC_C6S2 michael@0: MUL r6, r12,r6 ; r6 = t[1]<<16 = C4S4*(x[0]-x[4]) michael@0: LDR r14,OC_C2S6 ; r14= OC_C2S6 michael@0: MUL r3, r4, r7 ; r3 = OC_C6S2*x[2] michael@0: LDR r5, OC_C7S1 ; r5 = OC_C7S1 michael@0: MUL r4, r14,r4 ; r4 = OC_C2S6*x[2] michael@0: MOV r3, r3, ASR #16 ; r3 = OC_C6S2*x[2]>>16 michael@0: MUL r14,r8, r14 ; r14= OC_C2S6*x[6] michael@0: MOV r4, r4, ASR #16 ; r4 = OC_C2S6*x[2]>>16 michael@0: MUL r8, r7, r8 ; r8 = OC_C6S2*x[6] michael@0: LDR r7, OC_C1S7 ; r7 = OC_C1S7 michael@0: SUB r3, r3, r14,ASR #16 ; r3=t[2]=C6S2*x[2]>>16-C2S6*x[6]>>16 michael@0: LDRSH r14,[r1, #-14] ; r14= x[1] michael@0: ADD r4, r4, r8, ASR #16 ; r4=t[3]=C2S6*x[2]>>16+C6S2*x[6]>>16 michael@0: LDRSH r8, [r1, #-2] ; r8 = x[7] michael@0: MUL r9, r5, r14 ; r9 = OC_C7S1*x[1] michael@0: LDRSH r10,[r1, #-6] ; r10= x[5] michael@0: MUL r14,r7, r14 ; r14= OC_C1S7*x[1] michael@0: MOV r9, r9, ASR #16 ; r9 = OC_C7S1*x[1]>>16 michael@0: MUL r7, r8, r7 ; r7 = OC_C1S7*x[7] michael@0: MOV r14,r14,ASR #16 ; r14= OC_C1S7*x[1]>>16 michael@0: MUL r8, r5, r8 ; r8 = OC_C7S1*x[7] michael@0: LDRSH r1, [r1, #-10] ; r1 = x[3] michael@0: LDR r5, OC_C3S5 ; r5 = OC_C3S5 michael@0: LDR r11,OC_C5S3 ; r11= OC_C5S3 michael@0: ADD r8, r14,r8, ASR #16 ; r8=t[7]=C1S7*x[1]>>16+C7S1*x[7]>>16 michael@0: MUL r14,r5, r10 ; r14= OC_C3S5*x[5] michael@0: SUB r9, r9, r7, ASR #16 ; r9=t[4]=C7S1*x[1]>>16-C1S7*x[7]>>16 michael@0: MUL r10,r11,r10 ; r10= OC_C5S3*x[5] michael@0: MOV r14,r14,ASR #16 ; r14= OC_C3S5*x[5]>>16 michael@0: MUL r11,r1, r11 ; r11= OC_C5S3*x[3] michael@0: MOV r10,r10,ASR #16 ; r10= OC_C5S3*x[5]>>16 michael@0: MUL r1, r5, r1 ; r1 = OC_C3S5*x[3] michael@0: SUB r14,r14,r11,ASR #16 ;r14=t[5]=C3S5*x[5]>>16-C5S3*x[3]>>16 michael@0: ADD r10,r10,r1, ASR #16 ;r10=t[6]=C5S3*x[5]>>16+C3S5*x[3]>>16 michael@0: ; r2=t[0]<<16 r3=t[2] r4=t[3] r6=t[1]<<16 r8=t[7] r9=t[4] michael@0: ; r10=t[6] r12=C4S4 r14=t[5] michael@0: ; Stage 2 michael@0: ; TODO: This is wrong; t[4]-t[5] and t[7]-t[6] need to be truncated to 16-bit michael@0: ; before multiplying, not after (this is not equivalent) michael@0: ; 4-5 butterfly michael@0: ADD r9, r9, r14 ; r9 = t2[4] = t[4]+t[5] michael@0: SUB r14,r9, r14, LSL #1 ; r14= t[4]-t[5] michael@0: MUL r14,r12,r14 ; r14= t2[5]<<16 = C4S4*(t[4]-t[5]) michael@0: ; 7-6 butterfly michael@0: ADD r8, r8, r10 ; r8 = t2[7] = t[7]+t[6] michael@0: SUB r10,r8, r10, LSL #1 ; r10= t[7]-t[6] michael@0: MUL r10,r12,r10 ; r10= t2[6]<<16 = C4S4*(t[7]+t[6]) michael@0: ; r2=t[0]<<16 r3=t[2] r4=t[3] r6=t[1]<<16 r8=t2[7] r9=t2[4] michael@0: ; r10=t2[6]<<16 r12=C4S4 r14=t2[5]<<16 michael@0: ; Stage 3 michael@0: ADD r2, r2, #8<<16 ; r2 = t[0]+8<<16 michael@0: ADD r6, r6, #8<<16 ; r6 = t[1]+8<<16 michael@0: ; 0-3 butterfly michael@0: ADD r2, r4, r2, ASR #16 ; r2 = t2[0] = t[0] + t[3] + 8 michael@0: SUB r4, r2, r4, LSL #1 ; r4 = t2[3] = t[0] - t[3] + 8 michael@0: ; 1-2 butterfly michael@0: ADD r6, r3, r6, ASR #16 ; r6 = t2[1] = t[1] + t[2] + 8 michael@0: SUB r3, r6, r3, LSL #1 ; r3 = t2[2] = t[1] - t[2] + 8 michael@0: ; 6-5 butterfly michael@0: MOV r14,r14,ASR #16 ; r14= t2[5] michael@0: ADD r10,r14,r10,ASR #16 ; r10= t3[6] = t[6] + t[5] michael@0: SUB r14,r10,r14,LSL #1 ; r14= t3[5] = t[6] - t[5] michael@0: ; r2=t2[0] r3=t2[2] r4=t2[3] r6=t2[1] r8=t2[7] r9=t2[4] michael@0: ; r10=t3[6] r14=t3[5] michael@0: ; Stage 4 michael@0: ADD r2, r2, r8 ; r2 = t[0] + t[7] + 8 michael@0: ADD r6, r6, r10 ; r6 = t[1] + t[6] + 8 michael@0: ADD r3, r3, r14 ; r3 = t[2] + t[5] + 8 michael@0: ADD r4, r4, r9 ; r4 = t[3] + t[4] + 8 michael@0: SUB r8, r2, r8, LSL #1 ; r8 = t[0] - t[7] + 8 michael@0: SUB r10,r6, r10,LSL #1 ; r10= t[1] - t[6] + 8 michael@0: SUB r14,r3, r14,LSL #1 ; r14= t[2] - t[5] + 8 michael@0: SUB r9, r4, r9, LSL #1 ; r9 = t[3] - t[4] + 8 michael@0: ; TODO: This is wrong. michael@0: ; The C code truncates to 16 bits by storing to RAM and doing the michael@0: ; shifts later; we've got an extra 4 bits here. michael@0: MOV r2, r2, ASR #4 michael@0: MOV r6, r6, ASR #4 michael@0: MOV r3, r3, ASR #4 michael@0: MOV r4, r4, ASR #4 michael@0: MOV r8, r8, ASR #4 michael@0: MOV r10,r10,ASR #4 michael@0: MOV r14,r14,ASR #4 michael@0: MOV r9, r9, ASR #4 michael@0: STRH r2, [r0], #2 ; y[0] = t[0]+t[7] michael@0: STRH r6, [r0, #14] ; y[1] = t[1]+t[6] michael@0: STRH r3, [r0, #30] ; y[2] = t[2]+t[5] michael@0: STRH r4, [r0, #46] ; y[3] = t[3]+t[4] michael@0: STRH r9, [r0, #62] ; y[4] = t[3]-t[4] michael@0: STRH r14,[r0, #78] ; y[5] = t[2]-t[5] michael@0: STRH r10,[r0, #94] ; y[6] = t[1]-t[6] michael@0: STRH r8, [r0, #110] ; y[7] = t[0]-t[7] michael@0: LDMFD r13!,{r1,PC} michael@0: ENDP michael@0: michael@0: [ OC_ARM_ASM_MEDIA michael@0: EXPORT oc_idct8x8_1_v6 michael@0: EXPORT oc_idct8x8_v6 michael@0: michael@0: oc_idct8x8_1_v6 PROC michael@0: ; r0 = ogg_int16_t *_y michael@0: ; r1 = ogg_uint16_t _dc michael@0: ORR r2, r1, r1, LSL #16 michael@0: ORR r3, r1, r1, LSL #16 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: STRD r2, [r0], #8 michael@0: MOV PC, r14 michael@0: ENDP michael@0: michael@0: oc_idct8x8_v6 PROC michael@0: ; r0 = ogg_int16_t *_y michael@0: ; r1 = ogg_int16_t *_x michael@0: ; r2 = int _last_zzi michael@0: CMP r2, #3 michael@0: BLE oc_idct8x8_3_v6 michael@0: ;CMP r2, #6 michael@0: ;BLE oc_idct8x8_6_v6 michael@0: CMP r2, #10 michael@0: BLE oc_idct8x8_10_v6 michael@0: oc_idct8x8_slow_v6 michael@0: STMFD r13!,{r4-r11,r14} michael@0: SUB r13,r13,#64*2 michael@0: ; Row transforms michael@0: STR r0, [r13,#-4]! michael@0: ADD r0, r13, #4 ; Write to temp storage. michael@0: BL idct8_8core_v6 michael@0: BL idct8_8core_v6 michael@0: BL idct8_8core_v6 michael@0: BL idct8_8core_v6 michael@0: LDR r0, [r13], #4 ; Write to the final destination. michael@0: ; Clear input data for next block (decoder only). michael@0: SUB r2, r1, #8*16 michael@0: CMP r0, r2 michael@0: MOV r1, r13 ; And read from temp storage. michael@0: BEQ oc_idct8x8_slow_v6_cols michael@0: MOV r4, #0 michael@0: MOV r5, #0 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: STRD r4, [r2], #8 michael@0: oc_idct8x8_slow_v6_cols michael@0: ; Column transforms michael@0: BL idct8_8core_down_v6 michael@0: BL idct8_8core_down_v6 michael@0: BL idct8_8core_down_v6 michael@0: BL idct8_8core_down_v6 michael@0: ADD r13,r13,#64*2 michael@0: LDMFD r13!,{r4-r11,PC} michael@0: ENDP michael@0: michael@0: oc_idct8x8_10_v6 PROC michael@0: STMFD r13!,{r4-r11,r14} michael@0: SUB r13,r13,#64*2+4 michael@0: ; Row transforms michael@0: MOV r2, r13 michael@0: STR r0, [r13,#-4]! michael@0: AND r0, r2, #4 ; Align the stack. michael@0: ADD r0, r0, r2 ; Write to temp storage. michael@0: BL idct4_3core_v6 michael@0: BL idct2_1core_v6 michael@0: LDR r0, [r13], #4 ; Write to the final destination. michael@0: ; Clear input data for next block (decoder only). michael@0: SUB r2, r1, #4*16 michael@0: CMP r0, r2 michael@0: AND r1, r13,#4 ; Align the stack. michael@0: BEQ oc_idct8x8_10_v6_cols michael@0: MOV r4, #0 michael@0: MOV r5, #0 michael@0: STRD r4, [r2] michael@0: STRD r4, [r2,#16] michael@0: STR r4, [r2,#32] michael@0: STR r4, [r2,#48] michael@0: oc_idct8x8_10_v6_cols michael@0: ; Column transforms michael@0: ADD r1, r1, r13 ; And read from temp storage. michael@0: BL idct4_4core_down_v6 michael@0: BL idct4_4core_down_v6 michael@0: BL idct4_4core_down_v6 michael@0: BL idct4_4core_down_v6 michael@0: ADD r13,r13,#64*2+4 michael@0: LDMFD r13!,{r4-r11,PC} michael@0: ENDP michael@0: michael@0: oc_idct8x8_3_v6 PROC michael@0: STMFD r13!,{r4-r8,r14} michael@0: SUB r13,r13,#64*2 michael@0: ; Row transforms michael@0: MOV r8, r0 michael@0: MOV r0, r13 ; Write to temp storage. michael@0: BL idct2_1core_v6 michael@0: ; Clear input data for next block (decoder only). michael@0: SUB r0, r1, #2*16 michael@0: CMP r0, r8 michael@0: MOV r1, r13 ; Read from temp storage. michael@0: MOVNE r4, #0 michael@0: STRNE r4, [r0] michael@0: STRNE r4, [r0,#16] michael@0: MOVNE r0, r8 ; Write to the final destination. michael@0: ; Column transforms michael@0: BL idct2_2core_down_v6 michael@0: BL idct2_2core_down_v6 michael@0: BL idct2_2core_down_v6 michael@0: BL idct2_2core_down_v6 michael@0: ADD r13,r13,#64*2 michael@0: LDMFD r13!,{r4-r8,PC} michael@0: ENDP michael@0: michael@0: idct2_1core_v6 PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: ; Stage 1: michael@0: LDR r2, [r1], #16 ; r2 = michael@0: LDR r3, OC_C4S4 michael@0: LDRSH r6, [r1], #16 ; r6 = x[1,0] michael@0: SMULWB r12,r3, r2 ; r12= t[0,0]=OC_C4S4*x[0,0]>>16 michael@0: LDRD r4, OC_C7S1 ; r4 = OC_C7S1; r5 = OC_C1S7 michael@0: SMULWB r6, r3, r6 ; r6 = t[1,0]=OC_C4S4*x[1,0]>>16 michael@0: SMULWT r4, r4, r2 ; r4 = t[0,4]=OC_C7S1*x[0,1]>>16 michael@0: SMULWT r7, r5, r2 ; r7 = t[0,7]=OC_C1S7*x[0,1]>>16 michael@0: ; Stage 2: michael@0: SMULWB r5, r3, r4 ; r5 = t[0,5]=OC_C4S4*t[0,4]>>16 michael@0: PKHBT r12,r12,r6, LSL #16 ; r12= michael@0: SMULWB r6, r3, r7 ; r6 = t[0,6]=OC_C4S4*t[0,7]>>16 michael@0: PKHBT r7, r7, r3 ; r7 = <0|t[0,7]> michael@0: ; Stage 3: michael@0: PKHBT r5, r6, r5, LSL #16 ; r5 = michael@0: PKHBT r4, r4, r3 ; r4 = <0|t[0,4]> michael@0: SASX r5, r5, r5 ; r5 = michael@0: ; Stage 4: michael@0: PKHTB r6, r3, r5, ASR #16 ; r6 = <0|t[0,6]> michael@0: PKHBT r5, r5, r3 ; r5 = <0|t[0,5]> michael@0: SADD16 r3, r12,r7 ; r3 = t[0]+t[7] michael@0: STR r3, [r0], #4 ; y[0<<3] = t[0]+t[7] michael@0: SADD16 r3, r12,r6 ; r3 = t[0]+t[6] michael@0: STR r3, [r0, #12] ; y[1<<3] = t[0]+t[6] michael@0: SADD16 r3, r12,r5 ; r3 = t[0]+t[5] michael@0: STR r3, [r0, #28] ; y[2<<3] = t[0]+t[5] michael@0: SADD16 r3, r12,r4 ; r3 = t[0]+t[4] michael@0: STR r3, [r0, #44] ; y[3<<3] = t[0]+t[4] michael@0: SSUB16 r4, r12,r4 ; r4 = t[0]-t[4] michael@0: STR r4, [r0, #60] ; y[4<<3] = t[0]-t[4] michael@0: SSUB16 r5, r12,r5 ; r5 = t[0]-t[5] michael@0: STR r5, [r0, #76] ; y[5<<3] = t[0]-t[5] michael@0: SSUB16 r6, r12,r6 ; r6 = t[0]-t[6] michael@0: STR r6, [r0, #92] ; y[6<<3] = t[0]-t[6] michael@0: SSUB16 r7, r12,r7 ; r7 = t[0]-t[7] michael@0: STR r7, [r0, #108] ; y[7<<3] = t[0]-t[7] michael@0: MOV PC,r14 michael@0: ENDP michael@0: ] michael@0: michael@0: ALIGN 8 michael@0: OC_C7S1 michael@0: DCD 12785 ; 31F1 michael@0: OC_C1S7 michael@0: DCD 64277 ; FB15 michael@0: OC_C6S2 michael@0: DCD 25080 ; 61F8 michael@0: OC_C2S6 michael@0: DCD 60547 ; EC83 michael@0: OC_C5S3 michael@0: DCD 36410 ; 8E3A michael@0: OC_C3S5 michael@0: DCD 54491 ; D4DB michael@0: OC_C4S4 michael@0: DCD 46341 ; B505 michael@0: michael@0: [ OC_ARM_ASM_MEDIA michael@0: idct2_2core_down_v6 PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: ; Stage 1: michael@0: LDR r2, [r1], #16 ; r2 = michael@0: LDR r3, OC_C4S4 michael@0: MOV r7 ,#8 ; r7 = 8 michael@0: LDR r6, [r1], #16 ; r6 = michael@0: SMLAWB r12,r3, r2, r7 ; r12= (t[0,0]=OC_C4S4*x[0,0]>>16)+8 michael@0: LDRD r4, OC_C7S1 ; r4 = OC_C7S1; r5 = OC_C1S7 michael@0: SMLAWB r7, r3, r6, r7 ; r7 = (t[1,0]=OC_C4S4*x[1,0]>>16)+8 michael@0: SMULWT r5, r5, r2 ; r2 = t[0,7]=OC_C1S7*x[0,1]>>16 michael@0: PKHBT r12,r12,r7, LSL #16 ; r12= michael@0: SMULWT r4, r4, r2 ; r4 = t[0,4]=OC_C7S1*x[0,1]>>16 michael@0: ; Here we cheat: row 1 had just a DC, so x[0,1]==x[1,1] by definition. michael@0: PKHBT r7, r5, r5, LSL #16 ; r7 = michael@0: ; Stage 2: michael@0: SMULWB r6, r3, r7 ; r6 = t[0,6]=OC_C4S4*t[0,7]>>16 michael@0: PKHBT r4, r4, r4, LSL #16 ; r4 = michael@0: SMULWT r2, r3, r7 ; r2 = t[1,6]=OC_C4S4*t[1,7]>>16 michael@0: SMULWB r5, r3, r4 ; r5 = t[0,5]=OC_C4S4*t[0,4]>>16 michael@0: PKHBT r6, r6, r2, LSL #16 ; r6 = michael@0: SMULWT r2, r3, r4 ; r2 = t[1,5]=OC_C4S4*t[1,4]>>16 michael@0: PKHBT r2, r5, r2, LSL #16 ; r2 = michael@0: ; Stage 3: michael@0: SSUB16 r5, r6, r2 ; r5 = michael@0: SADD16 r6, r6, r2 ; r6 = michael@0: ; Stage 4: michael@0: SADD16 r2, r12,r7 ; r2 = t[0]+t[7]+8 michael@0: MOV r3, r2, ASR #4 michael@0: MOV r2, r2, LSL #16 michael@0: PKHTB r3, r3, r2, ASR #20 ; r3 = t[0]+t[7]+8>>4 michael@0: STR r3, [r0], #4 ; y[0<<3] = t[0]+t[7]+8>>4 michael@0: SADD16 r2, r12,r6 ; r2 = t[0]+t[6]+8 michael@0: MOV r3, r2, ASR #4 michael@0: MOV r2, r2, LSL #16 michael@0: PKHTB r3, r3, r2, ASR #20 ; r3 = t[0]+t[6]+8>>4 michael@0: STR r3, [r0, #12] ; y[1<<3] = t[0]+t[6]+8>>4 michael@0: SADD16 r2, r12,r5 ; r2 = t[0]+t[5]+8 michael@0: MOV r3, r2, ASR #4 michael@0: MOV r2, r2, LSL #16 michael@0: PKHTB r3, r3, r2, ASR #20 ; r3 = t[0]+t[5]+8>>4 michael@0: STR r3, [r0, #28] ; y[2<<3] = t[0]+t[5]+8>>4 michael@0: SADD16 r2, r12,r4 ; r2 = t[0]+t[4]+8 michael@0: MOV r3, r2, ASR #4 michael@0: MOV r2, r2, LSL #16 michael@0: PKHTB r3, r3, r2, ASR #20 ; r3 = t[0]+t[4]+8>>4 michael@0: STR r3, [r0, #44] ; y[3<<3] = t[0]+t[4]+8>>4 michael@0: SSUB16 r4, r12,r4 ; r4 = t[0]-t[4]+8 michael@0: MOV r3, r4, ASR #4 michael@0: MOV r4, r4, LSL #16 michael@0: PKHTB r3, r3, r4, ASR #20 ; r3 = t[0]-t[4]+8>>4 michael@0: STR r3, [r0, #60] ; y[4<<3] = t[0]-t[4]+8>>4 michael@0: SSUB16 r5, r12,r5 ; r5 = t[0]-t[5]+8 michael@0: MOV r3, r5, ASR #4 michael@0: MOV r5, r5, LSL #16 michael@0: PKHTB r3, r3, r5, ASR #20 ; r3 = t[0]-t[5]+8>>4 michael@0: STR r3, [r0, #76] ; y[5<<3] = t[0]-t[5]+8>>4 michael@0: SSUB16 r6, r12,r6 ; r6 = t[0]-t[6]+8 michael@0: MOV r3, r6, ASR #4 michael@0: MOV r6, r6, LSL #16 michael@0: PKHTB r3, r3, r6, ASR #20 ; r3 = t[0]-t[6]+8>>4 michael@0: STR r3, [r0, #92] ; y[6<<3] = t[0]-t[6]+8>>4 michael@0: SSUB16 r7, r12,r7 ; r7 = t[0]-t[7]+8 michael@0: MOV r3, r7, ASR #4 michael@0: MOV r7, r7, LSL #16 michael@0: PKHTB r3, r3, r7, ASR #20 ; r3 = t[0]-t[7]+8>>4 michael@0: STR r3, [r0, #108] ; y[7<<3] = t[0]-t[7]+8>>4 michael@0: MOV PC,r14 michael@0: ENDP michael@0: michael@0: ; In theory this should save ~75 cycles over oc_idct8x8_10, more than enough to michael@0: ; pay for increased branch mis-prediction to get here, but in practice it michael@0: ; doesn't seem to slow anything down to take it out, and it's less code this michael@0: ; way. michael@0: [ 0 michael@0: oc_idct8x8_6_v6 PROC michael@0: STMFD r13!,{r4-r8,r10,r11,r14} michael@0: SUB r13,r13,#64*2+4 michael@0: ; Row transforms michael@0: MOV r8, r0 michael@0: AND r0, r13,#4 ; Align the stack. michael@0: ADD r0, r0, r13 ; Write to temp storage. michael@0: BL idct3_2core_v6 michael@0: BL idct1core_v6 michael@0: ; Clear input data for next block (decoder only). michael@0: SUB r0, r1, #3*16 michael@0: CMP r0, r8 michael@0: AND r1, r13,#4 ; Align the stack. michael@0: BEQ oc_idct8x8_6_v6_cols michael@0: MOV r4, #0 michael@0: MOV r5, #0 michael@0: STRD r4, [r0] michael@0: STR r4, [r0,#16] michael@0: STR r4, [r0,#32] michael@0: MOV r0, r8 ; Write to the final destination. michael@0: oc_idct8x8_6_v6_cols michael@0: ; Column transforms michael@0: ADD r1, r1, r13 ; And read from temp storage. michael@0: BL idct3_3core_down_v6 michael@0: BL idct3_3core_down_v6 michael@0: BL idct3_3core_down_v6 michael@0: BL idct3_3core_down_v6 michael@0: ADD r13,r13,#64*2+4 michael@0: LDMFD r13!,{r4-r8,r10,r11,PC} michael@0: ENDP michael@0: michael@0: idct1core_v6 PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: LDRSH r3, [r1], #16 michael@0: MOV r12,#0x05 michael@0: ORR r12,r12,#0xB500 michael@0: MUL r3, r12, r3 michael@0: ; Stall ? michael@0: MOV r3, r3, ASR #16 michael@0: ; Don't need to actually store the odd lines; they won't be read. michael@0: STRH r3, [r0], #2 michael@0: STRH r3, [r0, #30] michael@0: STRH r3, [r0, #62] michael@0: STRH r3, [r0, #94] michael@0: MOV PC,R14 michael@0: ENDP michael@0: michael@0: idct3_2core_v6 PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: ; Stage 1: michael@0: LDRD r4, [r1], #16 ; r4 = ; r5 = <*|x[0,2]> michael@0: LDRD r10,OC_C6S2_3_v6 ; r10= OC_C6S2; r11= OC_C2S6 michael@0: ; Stall michael@0: SMULWB r3, r11,r5 ; r3 = t[0,3]=OC_C2S6*x[0,2]>>16 michael@0: LDR r11,OC_C4S4 michael@0: SMULWB r2, r10,r5 ; r2 = t[0,2]=OC_C6S2*x[0,2]>>16 michael@0: LDR r5, [r1], #16 ; r5 = michael@0: SMULWB r12,r11,r4 ; r12= (t[0,0]=OC_C4S4*x[0,0]>>16) michael@0: LDRD r6, OC_C7S1_3_v6 ; r6 = OC_C7S1; r7 = OC_C1S7 michael@0: SMULWB r10,r11,r5 ; r10= (t[1,0]=OC_C4S4*x[1,0]>>16) michael@0: PKHBT r12,r12,r10,LSL #16 ; r12= michael@0: SMULWT r10,r7, r5 ; r10= t[1,7]=OC_C1S7*x[1,1]>>16 michael@0: PKHBT r2, r2, r11 ; r2 = <0|t[0,2]> michael@0: SMULWT r7, r7, r4 ; r7 = t[0,7]=OC_C1S7*x[0,1]>>16 michael@0: PKHBT r3, r3, r11 ; r3 = <0|t[0,3]> michael@0: SMULWT r5, r6, r5 ; r10= t[1,4]=OC_C7S1*x[1,1]>>16 michael@0: PKHBT r7, r7, r10,LSL #16 ; r7 = michael@0: SMULWT r4, r6, r4 ; r4 = t[0,4]=OC_C7S1*x[0,1]>>16 michael@0: ; Stage 2: michael@0: SMULWB r6, r11,r7 ; r6 = t[0,6]=OC_C4S4*t[0,7]>>16 michael@0: PKHBT r4, r4, r5, LSL #16 ; r4 = michael@0: SMULWT r10,r11,r7 ; r10= t[1,6]=OC_C4S4*t[1,7]>>16 michael@0: SMULWB r5, r11,r4 ; r5 = t[0,5]=OC_C4S4*t[0,4]>>16 michael@0: PKHBT r6, r6, r10,LSL #16 ; r6 = michael@0: SMULWT r10,r11,r4 ; r10= t[1,5]=OC_C4S4*t[1,4]>>16 michael@0: ; Stage 3: michael@0: B idct4_3core_stage3_v6 michael@0: ENDP michael@0: michael@0: ; Another copy so the LDRD offsets are less than +/- 255. michael@0: ALIGN 8 michael@0: OC_C7S1_3_v6 michael@0: DCD 12785 ; 31F1 michael@0: OC_C1S7_3_v6 michael@0: DCD 64277 ; FB15 michael@0: OC_C6S2_3_v6 michael@0: DCD 25080 ; 61F8 michael@0: OC_C2S6_3_v6 michael@0: DCD 60547 ; EC83 michael@0: michael@0: idct3_3core_down_v6 PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: ; Stage 1: michael@0: LDRD r10,[r1], #16 ; r10= ; r11= michael@0: LDRD r6, OC_C6S2_3_v6 ; r6 = OC_C6S2; r7 = OC_C2S6 michael@0: LDR r4, [r1], #16 ; r4 = michael@0: SMULWB r3, r7, r11 ; r3 = t[0,3]=OC_C2S6*x[0,2]>>16 michael@0: MOV r7,#8 michael@0: SMULWB r2, r6, r11 ; r2 = t[0,2]=OC_C6S2*x[0,2]>>16 michael@0: LDR r11,OC_C4S4 michael@0: SMLAWB r12,r11,r10,r7 ; r12= t[0,0]+8=(OC_C4S4*x[0,0]>>16)+8 michael@0: ; Here we cheat: row 2 had just a DC, so x[0,2]==x[1,2] by definition. michael@0: PKHBT r3, r3, r3, LSL #16 ; r3 = michael@0: SMLAWB r5, r11,r4, r7 ; r5 = t[1,0]+8=(OC_C4S4*x[1,0]>>16)+8 michael@0: PKHBT r2, r2, r2, LSL #16 ; r2 = michael@0: LDRD r6, OC_C7S1_3_v6 ; r6 = OC_C7S1; r7 = OC_C1S7 michael@0: PKHBT r12,r12,r5, LSL #16 ; r12= michael@0: SMULWT r5, r7, r4 ; r5 = t[1,7]=OC_C1S7*x[1,1]>>16 michael@0: SMULWT r7, r7, r10 ; r7 = t[0,7]=OC_C1S7*x[0,1]>>16 michael@0: SMULWT r10,r6, r10 ; r10= t[0,4]=OC_C7S1*x[0,1]>>16 michael@0: PKHBT r7, r7, r5, LSL #16 ; r7 = michael@0: SMULWT r4, r6, r4 ; r4 = t[1,4]=OC_C7S1*x[1,1]>>16 michael@0: ; Stage 2: michael@0: SMULWB r6, r11,r7 ; r6 = t[0,6]=OC_C4S4*t[0,7]>>16 michael@0: PKHBT r4, r10,r4, LSL #16 ; r4 = michael@0: SMULWT r10,r11,r7 ; r10= t[1,6]=OC_C4S4*t[1,7]>>16 michael@0: SMULWB r5, r11,r4 ; r5 = t[0,5]=OC_C4S4*t[0,4]>>16 michael@0: PKHBT r6, r6, r10,LSL #16 ; r6 = michael@0: SMULWT r10,r11,r4 ; r10= t[1,5]=OC_C4S4*t[1,4]>>16 michael@0: ; Stage 3: michael@0: B idct4_4core_down_stage3_v6 michael@0: ENDP michael@0: ] michael@0: michael@0: idct4_3core_v6 PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: ; Stage 1: michael@0: LDRD r10,[r1], #16 ; r10= ; r11= michael@0: LDRD r2, OC_C5S3_4_v6 ; r2 = OC_C5S3; r3 = OC_C3S5 michael@0: LDRD r4, [r1], #16 ; r4 = ; r5 = michael@0: SMULWT r9, r3, r11 ; r9 = t[0,6]=OC_C3S5*x[0,3]>>16 michael@0: SMULWT r8, r2, r11 ; r8 = -t[0,5]=OC_C5S3*x[0,3]>>16 michael@0: PKHBT r9, r9, r2 ; r9 = <0|t[0,6]> michael@0: LDRD r6, OC_C6S2_4_v6 ; r6 = OC_C6S2; r7 = OC_C2S6 michael@0: PKHBT r8, r8, r2 ; r9 = <0|-t[0,5]> michael@0: SMULWB r3, r7, r11 ; r3 = t[0,3]=OC_C2S6*x[0,2]>>16 michael@0: SMULWB r2, r6, r11 ; r2 = t[0,2]=OC_C6S2*x[0,2]>>16 michael@0: LDR r11,OC_C4S4 michael@0: SMULWB r12,r7, r5 ; r12= t[1,3]=OC_C2S6*x[1,2]>>16 michael@0: SMULWB r5, r6, r5 ; r5 = t[1,2]=OC_C6S2*x[1,2]>>16 michael@0: PKHBT r3, r3, r12,LSL #16 ; r3 = michael@0: SMULWB r12,r11,r10 ; r12= t[0,0]=OC_C4S4*x[0,0]>>16 michael@0: PKHBT r2, r2, r5, LSL #16 ; r2 = michael@0: SMULWB r5, r11,r4 ; r5 = t[1,0]=OC_C4S4*x[1,0]>>16 michael@0: LDRD r6, OC_C7S1_4_v6 ; r6 = OC_C7S1; r7 = OC_C1S7 michael@0: PKHBT r12,r12,r5, LSL #16 ; r12= michael@0: SMULWT r5, r7, r4 ; r5 = t[1,7]=OC_C1S7*x[1,1]>>16 michael@0: SMULWT r7, r7, r10 ; r7 = t[0,7]=OC_C1S7*x[0,1]>>16 michael@0: SMULWT r10,r6, r10 ; r10= t[0,4]=OC_C7S1*x[0,1]>>16 michael@0: PKHBT r7, r7, r5, LSL #16 ; r7 = michael@0: SMULWT r4, r6, r4 ; r4 = t[1,4]=OC_C7S1*x[1,1]>>16 michael@0: ; Stage 2: michael@0: SSUB16 r6, r7, r9 ; r6 = t[7]-t[6] michael@0: PKHBT r4, r10,r4, LSL #16 ; r4 = michael@0: SADD16 r7, r7, r9 ; r7 = t[7]=t[7]+t[6] michael@0: SMULWT r9, r11,r6 ; r9 = t[1,6]=OC_C4S4*r6T>>16 michael@0: SADD16 r5, r4, r8 ; r5 = t[4]-t[5] michael@0: SMULWB r6, r11,r6 ; r6 = t[0,6]=OC_C4S4*r6B>>16 michael@0: SSUB16 r4, r4, r8 ; r4 = t[4]=t[4]+t[5] michael@0: SMULWT r10,r11,r5 ; r10= t[1,5]=OC_C4S4*r5T>>16 michael@0: PKHBT r6, r6, r9, LSL #16 ; r6 = michael@0: SMULWB r5, r11,r5 ; r5 = t[0,5]=OC_C4S4*r5B>>16 michael@0: ; Stage 3: michael@0: idct4_3core_stage3_v6 michael@0: SADD16 r11,r12,r2 ; r11= t[1]=t[0]+t[2] michael@0: PKHBT r10,r5, r10,LSL #16 ; r10= michael@0: SSUB16 r2, r12,r2 ; r2 = t[2]=t[0]-t[2] michael@0: idct4_3core_stage3_5_v6 michael@0: SSUB16 r5, r6, r10 ; r5 = t[5]'=t[6]-t[5] michael@0: SADD16 r6, r6, r10 ; r6 = t[6]=t[6]+t[5] michael@0: SADD16 r10,r12,r3 ; r10= t[0]'=t[0]+t[3] michael@0: SSUB16 r3, r12,r3 ; r3 = t[3]=t[0]-t[3] michael@0: ; Stage 4: michael@0: SADD16 r12,r10,r7 ; r12= t[0]+t[7] michael@0: STR r12,[r0], #4 ; y[0<<3] = t[0]+t[7] michael@0: SADD16 r12,r11,r6 ; r12= t[1]+t[6] michael@0: STR r12,[r0, #12] ; y[1<<3] = t[1]+t[6] michael@0: SADD16 r12,r2, r5 ; r12= t[2]+t[5] michael@0: STR r12,[r0, #28] ; y[2<<3] = t[2]+t[5] michael@0: SADD16 r12,r3, r4 ; r12= t[3]+t[4] michael@0: STR r12,[r0, #44] ; y[3<<3] = t[3]+t[4] michael@0: SSUB16 r4, r3, r4 ; r4 = t[3]-t[4] michael@0: STR r4, [r0, #60] ; y[4<<3] = t[3]-t[4] michael@0: SSUB16 r5, r2, r5 ; r5 = t[2]-t[5] michael@0: STR r5, [r0, #76] ; y[5<<3] = t[2]-t[5] michael@0: SSUB16 r6, r11,r6 ; r6 = t[1]-t[6] michael@0: STR r6, [r0, #92] ; y[6<<3] = t[1]-t[6] michael@0: SSUB16 r7, r10,r7 ; r7 = t[0]-t[7] michael@0: STR r7, [r0, #108] ; y[7<<3] = t[0]-t[7] michael@0: MOV PC,r14 michael@0: ENDP michael@0: michael@0: ; Another copy so the LDRD offsets are less than +/- 255. michael@0: ALIGN 8 michael@0: OC_C7S1_4_v6 michael@0: DCD 12785 ; 31F1 michael@0: OC_C1S7_4_v6 michael@0: DCD 64277 ; FB15 michael@0: OC_C6S2_4_v6 michael@0: DCD 25080 ; 61F8 michael@0: OC_C2S6_4_v6 michael@0: DCD 60547 ; EC83 michael@0: OC_C5S3_4_v6 michael@0: DCD 36410 ; 8E3A michael@0: OC_C3S5_4_v6 michael@0: DCD 54491 ; D4DB michael@0: michael@0: idct4_4core_down_v6 PROC michael@0: ; r0 = ogg_int16_t *_y (destination) michael@0: ; r1 = const ogg_int16_t *_x (source) michael@0: ; Stage 1: michael@0: LDRD r10,[r1], #16 ; r10= ; r11= michael@0: LDRD r2, OC_C5S3_4_v6 ; r2 = OC_C5S3; r3 = OC_C3S5 michael@0: LDRD r4, [r1], #16 ; r4 = ; r5 = michael@0: SMULWT r9, r3, r11 ; r9 = t[0,6]=OC_C3S5*x[0,3]>>16 michael@0: LDRD r6, OC_C6S2_4_v6 ; r6 = OC_C6S2; r7 = OC_C2S6 michael@0: SMULWT r8, r2, r11 ; r8 = -t[0,5]=OC_C5S3*x[0,3]>>16 michael@0: ; Here we cheat: row 3 had just a DC, so x[0,3]==x[1,3] by definition. michael@0: PKHBT r9, r9, r9, LSL #16 ; r9 = michael@0: SMULWB r3, r7, r11 ; r3 = t[0,3]=OC_C2S6*x[0,2]>>16 michael@0: PKHBT r8, r8, r8, LSL #16 ; r8 = <-t[0,5]|-t[0,5]> michael@0: SMULWB r2, r6, r11 ; r2 = t[0,2]=OC_C6S2*x[0,2]>>16 michael@0: LDR r11,OC_C4S4 michael@0: SMULWB r12,r7, r5 ; r12= t[1,3]=OC_C2S6*x[1,2]>>16 michael@0: MOV r7,#8 michael@0: SMULWB r5, r6, r5 ; r5 = t[1,2]=OC_C6S2*x[1,2]>>16 michael@0: PKHBT r3, r3, r12,LSL #16 ; r3 = michael@0: SMLAWB r12,r11,r10,r7 ; r12= t[0,0]+8=(OC_C4S4*x[0,0]>>16)+8 michael@0: PKHBT r2, r2, r5, LSL #16 ; r2 = michael@0: SMLAWB r5, r11,r4 ,r7 ; r5 = t[1,0]+8=(OC_C4S4*x[1,0]>>16)+8 michael@0: LDRD r6, OC_C7S1_4_v6 ; r6 = OC_C7S1; r7 = OC_C1S7 michael@0: PKHBT r12,r12,r5, LSL #16 ; r12= michael@0: SMULWT r5, r7, r4 ; r5 = t[1,7]=OC_C1S7*x[1,1]>>16 michael@0: SMULWT r7, r7, r10 ; r7 = t[0,7]=OC_C1S7*x[0,1]>>16 michael@0: SMULWT r10,r6, r10 ; r10= t[0,4]=OC_C7S1*x[0,1]>>16 michael@0: PKHBT r7, r7, r5, LSL #16 ; r7 = michael@0: SMULWT r4, r6, r4 ; r4 = t[1,4]=OC_C7S1*x[1,1]>>16 michael@0: ; Stage 2: michael@0: SSUB16 r6, r7, r9 ; r6 = t[7]-t[6] michael@0: PKHBT r4, r10,r4, LSL #16 ; r4 = michael@0: SADD16 r7, r7, r9 ; r7 = t[7]=t[7]+t[6] michael@0: SMULWT r9, r11,r6 ; r9 = t[1,6]=OC_C4S4*r6T>>16 michael@0: SADD16 r5, r4, r8 ; r5 = t[4]-t[5] michael@0: SMULWB r6, r11,r6 ; r6 = t[0,6]=OC_C4S4*r6B>>16 michael@0: SSUB16 r4, r4, r8 ; r4 = t[4]=t[4]+t[5] michael@0: SMULWT r10,r11,r5 ; r10= t[1,5]=OC_C4S4*r5T>>16 michael@0: PKHBT r6, r6, r9, LSL #16 ; r6 = michael@0: SMULWB r5, r11,r5 ; r5 = t[0,5]=OC_C4S4*r5B>>16 michael@0: ; Stage 3: michael@0: idct4_4core_down_stage3_v6 michael@0: SADD16 r11,r12,r2 ; r11= t[1]+8=t[0]+t[2]+8 michael@0: PKHBT r10,r5, r10,LSL #16 ; r10= michael@0: SSUB16 r2, r12,r2 ; r2 = t[2]+8=t[0]-t[2]+8 michael@0: B idct8_8core_down_stage3_5_v6 michael@0: ENDP michael@0: michael@0: idct8_8core_v6 PROC michael@0: STMFD r13!,{r0,r14} michael@0: ; Stage 1: michael@0: ;5-6 rotation by 3pi/16 michael@0: LDRD r10,OC_C5S3_4_v6 ; r10= OC_C5S3, r11= OC_C3S5 michael@0: LDR r4, [r1,#8] ; r4 = michael@0: LDR r7, [r1,#24] ; r7 = michael@0: SMULWT r5, r11,r4 ; r5 = OC_C3S5*x[0,5]>>16 michael@0: LDR r0, [r1,#4] ; r0 = michael@0: SMULWT r3, r11,r7 ; r3 = OC_C3S5*x[1,5]>>16 michael@0: LDR r12,[r1,#20] ; r12= michael@0: SMULWT r6, r11,r0 ; r6 = OC_C3S5*x[0,3]>>16 michael@0: SMULWT r11,r11,r12 ; r11= OC_C3S5*x[1,3]>>16 michael@0: SMLAWT r6, r10,r4, r6 ; r6 = t[0,6]=r6+(OC_C5S3*x[0,5]>>16) michael@0: PKHBT r5, r5, r3, LSL #16 ; r5 = michael@0: SMLAWT r11,r10,r7, r11 ; r11= t[1,6]=r11+(OC_C5S3*x[1,5]>>16) michael@0: PKHBT r4, r4, r7, LSL #16 ; r4 = michael@0: SMULWT r3, r10,r0 ; r3 = OC_C5S3*x[0,3]>>16 michael@0: PKHBT r6, r6, r11,LSL #16 ; r6 = michael@0: SMULWT r8, r10,r12 ; r8 = OC_C5S3*x[1,3]>>16 michael@0: ;2-3 rotation by 6pi/16 michael@0: LDRD r10,OC_C6S2_4_v6 ; r10= OC_C6S2, r11= OC_C2S6 michael@0: PKHBT r3, r3, r8, LSL #16 ; r3 = michael@0: LDR r8, [r1,#12] ; r8 = michael@0: SMULWB r2, r10,r0 ; r2 = OC_C6S2*x[0,2]>>16 michael@0: SSUB16 r5, r5, r3 ; r5 = michael@0: SMULWB r9, r10,r12 ; r9 = OC_C6S2*x[1,2]>>16 michael@0: LDR r7, [r1,#28] ; r7 = michael@0: SMULWB r3, r10,r8 ; r3 = OC_C6S2*x[0,6]>>16 michael@0: SMULWB r10,r10,r7 ; r10= OC_C6S2*x[1,6]>>16 michael@0: PKHBT r2, r2, r9, LSL #16 ; r2 = michael@0: SMLAWB r3, r11,r0, r3 ; r3 = t[0,3]=r3+(OC_C2S6*x[0,2]>>16) michael@0: SMLAWB r10,r11,r12,r10 ; r10= t[1,3]=r10+(OC_C2S6*x[1,2]>>16) michael@0: SMULWB r9, r11,r8 ; r9 = OC_C2S6*x[0,6]>>16 michael@0: PKHBT r3, r3, r10,LSL #16 ; r3 = michael@0: SMULWB r12,r11,r7 ; r12= OC_C2S6*x[1,6]>>16 michael@0: ;4-7 rotation by 7pi/16 michael@0: LDRD r10,OC_C7S1_8_v6 ; r10= OC_C7S1, r11= OC_C1S7 michael@0: PKHBT r9, r9, r12,LSL #16 ; r9 = michael@0: LDR r0, [r1],#16 ; r0 = michael@0: PKHTB r7, r7, r8, ASR #16 ; r7 = michael@0: SSUB16 r2, r2, r9 ; r2 = michael@0: SMULWB r9, r10,r7 ; r9 = OC_C7S1*x[0,7]>>16 michael@0: LDR r14,[r1],#16 ; r14= michael@0: SMULWT r12,r10,r7 ; r12= OC_C7S1*x[1,7]>>16 michael@0: SMULWT r8, r10,r0 ; r8 = OC_C7S1*x[0,1]>>16 michael@0: SMULWT r10,r10,r14 ; r10= OC_C7S1*x[1,1]>>16 michael@0: SMLAWT r9, r11,r0, r9 ; r9 = t[0,7]=r9+(OC_C1S7*x[0,1]>>16) michael@0: PKHBT r8, r8, r10,LSL #16 ; r8 = michael@0: SMLAWT r12,r11,r14,r12 ; r12= t[1,7]=r12+(OC_C1S7*x[1,1]>>16) michael@0: PKHBT r0, r0, r14,LSL #16 ; r0 = michael@0: SMULWB r10,r11,r7 ; r10= OC_C1S7*x[0,6]>>16 michael@0: PKHBT r9, r9, r12,LSL #16 ; r9 = michael@0: SMULWT r12,r11,r7 ; r12= OC_C1S7*x[1,6]>>16 michael@0: ;0-1 butterfly michael@0: LDR r11,OC_C4S4 michael@0: PKHBT r10,r10,r12,LSL #16 ; r10= michael@0: SADD16 r7, r0, r4 ; r7 = x[0]+x[4] michael@0: SSUB16 r10,r8, r10 ; r10= michael@0: SSUB16 r4, r0, r4 ; r4 = x[0]-x[4] michael@0: SMULWB r8, r11,r7 ; r8 = t[0,0]=OC_C4S4*r7B>>16 michael@0: SMULWT r12,r11,r7 ; r12= t[1,0]=OC_C4S4*r7T>>16 michael@0: SMULWB r7, r11,r4 ; r7 = t[0,1]=OC_C4S4*r4B>>16 michael@0: PKHBT r12,r8, r12,LSL #16 ; r12= michael@0: SMULWT r8, r11,r4 ; r8 = t[1,1]=OC_C4S4*r4T>>16 michael@0: ; Stage 2: michael@0: SADD16 r4, r10,r5 ; r4 = t[4]'=t[4]+t[5] michael@0: PKHBT r8, r7, r8, LSL #16 ; r8 = michael@0: SSUB16 r5, r10,r5 ; r5 = t[4]-t[5] michael@0: SMULWB r10,r11,r5 ; r10= t[0,5]=OC_C4S4*r5B>>16 michael@0: SADD16 r7, r9, r6 ; r7 = t[7]'=t[7]+t[6] michael@0: SMULWT r5, r11,r5 ; r5 = t[1,5]=OC_C4S4*r5T>>16 michael@0: SSUB16 r6, r9, r6 ; r6 = t[7]-t[6] michael@0: SMULWB r9, r11,r6 ; r9 = t[0,6]=OC_C4S4*r6B>>16 michael@0: PKHBT r10,r10,r5, LSL #16 ; r10= michael@0: SMULWT r6, r11,r6 ; r6 = t[1,6]=OC_C4S4*r6T>>16 michael@0: ; Stage 3: michael@0: SADD16 r11,r8, r2 ; r11= t[1]'=t[1]+t[2] michael@0: PKHBT r6, r9, r6, LSL #16 ; r6 = michael@0: SSUB16 r2, r8, r2 ; r2 = t[2]=t[1]-t[2] michael@0: LDMFD r13!,{r0,r14} michael@0: B idct4_3core_stage3_5_v6 michael@0: ENDP michael@0: michael@0: ; Another copy so the LDRD offsets are less than +/- 255. michael@0: ALIGN 8 michael@0: OC_C7S1_8_v6 michael@0: DCD 12785 ; 31F1 michael@0: OC_C1S7_8_v6 michael@0: DCD 64277 ; FB15 michael@0: OC_C6S2_8_v6 michael@0: DCD 25080 ; 61F8 michael@0: OC_C2S6_8_v6 michael@0: DCD 60547 ; EC83 michael@0: OC_C5S3_8_v6 michael@0: DCD 36410 ; 8E3A michael@0: OC_C3S5_8_v6 michael@0: DCD 54491 ; D4DB michael@0: michael@0: idct8_8core_down_v6 PROC michael@0: STMFD r13!,{r0,r14} michael@0: ; Stage 1: michael@0: ;5-6 rotation by 3pi/16 michael@0: LDRD r10,OC_C5S3_8_v6 ; r10= OC_C5S3, r11= OC_C3S5 michael@0: LDR r4, [r1,#8] ; r4 = michael@0: LDR r7, [r1,#24] ; r7 = michael@0: SMULWT r5, r11,r4 ; r5 = OC_C3S5*x[0,5]>>16 michael@0: LDR r0, [r1,#4] ; r0 = michael@0: SMULWT r3, r11,r7 ; r3 = OC_C3S5*x[1,5]>>16 michael@0: LDR r12,[r1,#20] ; r12= michael@0: SMULWT r6, r11,r0 ; r6 = OC_C3S5*x[0,3]>>16 michael@0: SMULWT r11,r11,r12 ; r11= OC_C3S5*x[1,3]>>16 michael@0: SMLAWT r6, r10,r4, r6 ; r6 = t[0,6]=r6+(OC_C5S3*x[0,5]>>16) michael@0: PKHBT r5, r5, r3, LSL #16 ; r5 = michael@0: SMLAWT r11,r10,r7, r11 ; r11= t[1,6]=r11+(OC_C5S3*x[1,5]>>16) michael@0: PKHBT r4, r4, r7, LSL #16 ; r4 = michael@0: SMULWT r3, r10,r0 ; r3 = OC_C5S3*x[0,3]>>16 michael@0: PKHBT r6, r6, r11,LSL #16 ; r6 = michael@0: SMULWT r8, r10,r12 ; r8 = OC_C5S3*x[1,3]>>16 michael@0: ;2-3 rotation by 6pi/16 michael@0: LDRD r10,OC_C6S2_8_v6 ; r10= OC_C6S2, r11= OC_C2S6 michael@0: PKHBT r3, r3, r8, LSL #16 ; r3 = michael@0: LDR r8, [r1,#12] ; r8 = michael@0: SMULWB r2, r10,r0 ; r2 = OC_C6S2*x[0,2]>>16 michael@0: SSUB16 r5, r5, r3 ; r5 = michael@0: SMULWB r9, r10,r12 ; r9 = OC_C6S2*x[1,2]>>16 michael@0: LDR r7, [r1,#28] ; r7 = michael@0: SMULWB r3, r10,r8 ; r3 = OC_C6S2*x[0,6]>>16 michael@0: SMULWB r10,r10,r7 ; r10= OC_C6S2*x[1,6]>>16 michael@0: PKHBT r2, r2, r9, LSL #16 ; r2 = michael@0: SMLAWB r3, r11,r0, r3 ; r3 = t[0,3]=r3+(OC_C2S6*x[0,2]>>16) michael@0: SMLAWB r10,r11,r12,r10 ; r10= t[1,3]=r10+(OC_C2S6*x[1,2]>>16) michael@0: SMULWB r9, r11,r8 ; r9 = OC_C2S6*x[0,6]>>16 michael@0: PKHBT r3, r3, r10,LSL #16 ; r3 = michael@0: SMULWB r12,r11,r7 ; r12= OC_C2S6*x[1,6]>>16 michael@0: ;4-7 rotation by 7pi/16 michael@0: LDRD r10,OC_C7S1_8_v6 ; r10= OC_C7S1, r11= OC_C1S7 michael@0: PKHBT r9, r9, r12,LSL #16 ; r9 = michael@0: LDR r0, [r1],#16 ; r0 = michael@0: PKHTB r7, r7, r8, ASR #16 ; r7 = michael@0: SSUB16 r2, r2, r9 ; r2 = michael@0: SMULWB r9, r10,r7 ; r9 = OC_C7S1*x[0,7]>>16 michael@0: LDR r14,[r1],#16 ; r14= michael@0: SMULWT r12,r10,r7 ; r12= OC_C7S1*x[1,7]>>16 michael@0: SMULWT r8, r10,r0 ; r8 = OC_C7S1*x[0,1]>>16 michael@0: SMULWT r10,r10,r14 ; r10= OC_C7S1*x[1,1]>>16 michael@0: SMLAWT r9, r11,r0, r9 ; r9 = t[0,7]=r9+(OC_C1S7*x[0,1]>>16) michael@0: PKHBT r8, r8, r10,LSL #16 ; r8 = michael@0: SMLAWT r12,r11,r14,r12 ; r12= t[1,7]=r12+(OC_C1S7*x[1,1]>>16) michael@0: PKHBT r0, r0, r14,LSL #16 ; r0 = michael@0: SMULWB r10,r11,r7 ; r10= OC_C1S7*x[0,6]>>16 michael@0: PKHBT r9, r9, r12,LSL #16 ; r9 = michael@0: SMULWT r12,r11,r7 ; r12= OC_C1S7*x[1,6]>>16 michael@0: ;0-1 butterfly michael@0: LDR r11,OC_C4S4 michael@0: MOV r14,#8 michael@0: PKHBT r10,r10,r12,LSL #16 ; r10= michael@0: SADD16 r7, r0, r4 ; r7 = x[0]+x[4] michael@0: SSUB16 r10,r8, r10 ; r10= michael@0: SMLAWB r8, r11,r7, r14 ; r8 = t[0,0]+8=(OC_C4S4*r7B>>16)+8 michael@0: SSUB16 r4, r0, r4 ; r4 = x[0]-x[4] michael@0: SMLAWT r12,r11,r7, r14 ; r12= t[1,0]+8=(OC_C4S4*r7T>>16)+8 michael@0: SMLAWB r7, r11,r4, r14 ; r7 = t[0,1]+8=(OC_C4S4*r4B>>16)+8 michael@0: PKHBT r12,r8, r12,LSL #16 ; r12= michael@0: SMLAWT r8, r11,r4, r14 ; r8 = t[1,1]+8=(OC_C4S4*r4T>>16)+8 michael@0: ; Stage 2: michael@0: SADD16 r4, r10,r5 ; r4 = t[4]'=t[4]+t[5] michael@0: PKHBT r8, r7, r8, LSL #16 ; r8 = michael@0: SSUB16 r5, r10,r5 ; r5 = t[4]-t[5] michael@0: SMULWB r10,r11,r5 ; r10= t[0,5]=OC_C4S4*r5B>>16 michael@0: SADD16 r7, r9, r6 ; r7 = t[7]'=t[7]+t[6] michael@0: SMULWT r5, r11,r5 ; r5 = t[1,5]=OC_C4S4*r5T>>16 michael@0: SSUB16 r6, r9, r6 ; r6 = t[7]-t[6] michael@0: SMULWB r9, r11,r6 ; r9 = t[0,6]=OC_C4S4*r6B>>16 michael@0: PKHBT r10,r10,r5, LSL #16 ; r10= michael@0: SMULWT r6, r11,r6 ; r6 = t[1,6]=OC_C4S4*r6T>>16 michael@0: ; Stage 3: michael@0: SADD16 r11,r8, r2 ; r11= t[1]'+8=t[1]+t[2]+8 michael@0: PKHBT r6, r9, r6, LSL #16 ; r6 = michael@0: SSUB16 r2, r8, r2 ; r2 = t[2]+8=t[1]-t[2]+8 michael@0: LDMFD r13!,{r0,r14} michael@0: idct8_8core_down_stage3_5_v6 michael@0: SSUB16 r5, r6, r10 ; r5 = t[5]'=t[6]-t[5] michael@0: SADD16 r6, r6, r10 ; r6 = t[6]=t[6]+t[5] michael@0: SADD16 r10,r12,r3 ; r10= t[0]'+8=t[0]+t[3]+8 michael@0: SSUB16 r3, r12,r3 ; r3 = t[3]+8=t[0]-t[3]+8 michael@0: ; Stage 4: michael@0: SADD16 r12,r10,r7 ; r12= t[0]+t[7]+8 michael@0: SSUB16 r7, r10,r7 ; r7 = t[0]-t[7]+8 michael@0: MOV r10,r12,ASR #4 michael@0: MOV r12,r12,LSL #16 michael@0: PKHTB r10,r10,r12,ASR #20 ; r10= t[0]+t[7]+8>>4 michael@0: STR r10,[r0], #4 ; y[0<<3] = t[0]+t[7]+8>>4 michael@0: SADD16 r12,r11,r6 ; r12= t[1]+t[6]+8 michael@0: SSUB16 r6, r11,r6 ; r6 = t[1]-t[6]+8 michael@0: MOV r10,r12,ASR #4 michael@0: MOV r12,r12,LSL #16 michael@0: PKHTB r10,r10,r12,ASR #20 ; r10= t[1]+t[6]+8>>4 michael@0: STR r10,[r0, #12] ; y[1<<3] = t[1]+t[6]+8>>4 michael@0: SADD16 r12,r2, r5 ; r12= t[2]+t[5]+8 michael@0: SSUB16 r5, r2, r5 ; r5 = t[2]-t[5]+8 michael@0: MOV r10,r12,ASR #4 michael@0: MOV r12,r12,LSL #16 michael@0: PKHTB r10,r10,r12,ASR #20 ; r10= t[2]+t[5]+8>>4 michael@0: STR r10,[r0, #28] ; y[2<<3] = t[2]+t[5]+8>>4 michael@0: SADD16 r12,r3, r4 ; r12= t[3]+t[4]+8 michael@0: SSUB16 r4, r3, r4 ; r4 = t[3]-t[4]+8 michael@0: MOV r10,r12,ASR #4 michael@0: MOV r12,r12,LSL #16 michael@0: PKHTB r10,r10,r12,ASR #20 ; r10= t[3]+t[4]+8>>4 michael@0: STR r10,[r0, #44] ; y[3<<3] = t[3]+t[4]+8>>4 michael@0: MOV r10,r4, ASR #4 michael@0: MOV r4, r4, LSL #16 michael@0: PKHTB r10,r10,r4, ASR #20 ; r10= t[3]-t[4]+8>>4 michael@0: STR r10,[r0, #60] ; y[4<<3] = t[3]-t[4]+8>>4 michael@0: MOV r10,r5, ASR #4 michael@0: MOV r5, r5, LSL #16 michael@0: PKHTB r10,r10,r5, ASR #20 ; r10= t[2]-t[5]+8>>4 michael@0: STR r10,[r0, #76] ; y[5<<3] = t[2]-t[5]+8>>4 michael@0: MOV r10,r6, ASR #4 michael@0: MOV r6, r6, LSL #16 michael@0: PKHTB r10,r10,r6, ASR #20 ; r10= t[1]-t[6]+8>>4 michael@0: STR r10,[r0, #92] ; y[6<<3] = t[1]-t[6]+8>>4 michael@0: MOV r10,r7, ASR #4 michael@0: MOV r7, r7, LSL #16 michael@0: PKHTB r10,r10,r7, ASR #20 ; r10= t[0]-t[7]+8>>4 michael@0: STR r10,[r0, #108] ; y[7<<3] = t[0]-t[7]+8>>4 michael@0: MOV PC,r14 michael@0: ENDP michael@0: ] michael@0: michael@0: [ OC_ARM_ASM_NEON michael@0: EXPORT oc_idct8x8_1_neon michael@0: EXPORT oc_idct8x8_neon michael@0: michael@0: ALIGN 16 michael@0: OC_IDCT_CONSTS_NEON michael@0: DCW 8 michael@0: DCW 64277 ; FB15 (C1S7) michael@0: DCW 60547 ; EC83 (C2S6) michael@0: DCW 54491 ; D4DB (C3S5) michael@0: DCW 46341 ; B505 (C4S4) michael@0: DCW 36410 ; 471D (C5S3) michael@0: DCW 25080 ; 30FC (C6S2) michael@0: DCW 12785 ; 31F1 (C7S1) michael@0: michael@0: oc_idct8x8_1_neon PROC michael@0: ; r0 = ogg_int16_t *_y michael@0: ; r1 = ogg_uint16_t _dc michael@0: VDUP.S16 Q0, r1 michael@0: VMOV Q1, Q0 michael@0: VST1.64 {D0, D1, D2, D3}, [r0@128]! michael@0: VST1.64 {D0, D1, D2, D3}, [r0@128]! michael@0: VST1.64 {D0, D1, D2, D3}, [r0@128]! michael@0: VST1.64 {D0, D1, D2, D3}, [r0@128] michael@0: MOV PC, r14 michael@0: ENDP michael@0: michael@0: oc_idct8x8_neon PROC michael@0: ; r0 = ogg_int16_t *_y michael@0: ; r1 = ogg_int16_t *_x michael@0: ; r2 = int _last_zzi michael@0: CMP r2, #10 michael@0: BLE oc_idct8x8_10_neon michael@0: oc_idct8x8_slow_neon michael@0: VPUSH {D8-D15} michael@0: MOV r2, r1 michael@0: ADR r3, OC_IDCT_CONSTS_NEON michael@0: ; Row transforms (input is pre-transposed) michael@0: VLD1.64 {D16,D17,D18,D19}, [r2@128]! michael@0: VLD1.64 {D20,D21,D22,D23}, [r2@128]! michael@0: VLD1.64 {D24,D25,D26,D27}, [r2@128]! michael@0: VSUB.S16 Q1, Q8, Q12 ; Q8 = x[0]-x[4] michael@0: VLD1.64 {D28,D29,D30,D31}, [r2@128] michael@0: VADD.S16 Q8, Q8, Q12 ; Q1 = x[0]+x[4] michael@0: VLD1.64 {D0,D1}, [r3@128] michael@0: MOV r12, r14 michael@0: BL oc_idct8x8_stage123_neon michael@0: ; Stage 4 michael@0: VSUB.S16 Q15,Q8, Q7 ; Q15 = y[7]=t[0]'-t[7]' michael@0: VADD.S16 Q8, Q8, Q7 ; Q8 = y[0]=t[0]'+t[7]' michael@0: VSUB.S16 Q14,Q9, Q3 ; Q14 = y[6]=t[1]'-t[6]'' michael@0: VADD.S16 Q9, Q9, Q3 ; Q9 = y[1]=t[1]'+t[6]'' michael@0: VSUB.S16 Q13,Q10,Q5 ; Q13 = y[5]=t[2]'-t[5]'' michael@0: VADD.S16 Q10,Q10,Q5 ; Q10 = y[2]=t[2]'+t[5]'' michael@0: VTRN.16 Q14,Q15 michael@0: VSUB.S16 Q12,Q11,Q4 ; Q12 = y[4]=t[3]'-t[4]' michael@0: VADD.S16 Q11,Q11,Q4 ; Q11 = y[3]=t[3]'+t[4]' michael@0: ; 8x8 Transpose michael@0: VTRN.16 Q8, Q9 michael@0: VTRN.16 Q10,Q11 michael@0: VTRN.16 Q12,Q13 michael@0: VTRN.32 Q8, Q10 michael@0: VTRN.32 Q9, Q11 michael@0: VTRN.32 Q12,Q14 michael@0: VTRN.32 Q13,Q15 michael@0: VSWP D17,D24 michael@0: VSUB.S16 Q1, Q8, Q12 ; Q8 = x[0]-x[4] michael@0: VSWP D19,D26 michael@0: VADD.S16 Q8, Q8, Q12 ; Q1 = x[0]+x[4] michael@0: VSWP D21,D28 michael@0: VSWP D23,D30 michael@0: ; Column transforms michael@0: BL oc_idct8x8_stage123_neon michael@0: CMP r0,r1 michael@0: ; We have to put the return address back in the LR, or the branch michael@0: ; predictor will not recognize the function return and mis-predict the michael@0: ; entire call stack. michael@0: MOV r14, r12 michael@0: ; Stage 4 michael@0: VSUB.S16 Q15,Q8, Q7 ; Q15 = y[7]=t[0]'-t[7]' michael@0: VADD.S16 Q8, Q8, Q7 ; Q8 = y[0]=t[0]'+t[7]' michael@0: VSUB.S16 Q14,Q9, Q3 ; Q14 = y[6]=t[1]'-t[6]'' michael@0: VADD.S16 Q9, Q9, Q3 ; Q9 = y[1]=t[1]'+t[6]'' michael@0: VSUB.S16 Q13,Q10,Q5 ; Q13 = y[5]=t[2]'-t[5]'' michael@0: VADD.S16 Q10,Q10,Q5 ; Q10 = y[2]=t[2]'+t[5]'' michael@0: VSUB.S16 Q12,Q11,Q4 ; Q12 = y[4]=t[3]'-t[4]' michael@0: VADD.S16 Q11,Q11,Q4 ; Q11 = y[3]=t[3]'+t[4]' michael@0: BEQ oc_idct8x8_slow_neon_noclear michael@0: VMOV.I8 Q2,#0 michael@0: VPOP {D8-D15} michael@0: VMOV.I8 Q3,#0 michael@0: VRSHR.S16 Q8, Q8, #4 ; Q8 = y[0]+8>>4 michael@0: VST1.64 {D4, D5, D6, D7}, [r1@128]! michael@0: VRSHR.S16 Q9, Q9, #4 ; Q9 = y[1]+8>>4 michael@0: VRSHR.S16 Q10,Q10,#4 ; Q10 = y[2]+8>>4 michael@0: VST1.64 {D4, D5, D6, D7}, [r1@128]! michael@0: VRSHR.S16 Q11,Q11,#4 ; Q11 = y[3]+8>>4 michael@0: VRSHR.S16 Q12,Q12,#4 ; Q12 = y[4]+8>>4 michael@0: VST1.64 {D4, D5, D6, D7}, [r1@128]! michael@0: VRSHR.S16 Q13,Q13,#4 ; Q13 = y[5]+8>>4 michael@0: VRSHR.S16 Q14,Q14,#4 ; Q14 = y[6]+8>>4 michael@0: VST1.64 {D4, D5, D6, D7}, [r1@128] michael@0: VRSHR.S16 Q15,Q15,#4 ; Q15 = y[7]+8>>4 michael@0: VSTMIA r0, {D16-D31} michael@0: MOV PC, r14 michael@0: michael@0: oc_idct8x8_slow_neon_noclear michael@0: VPOP {D8-D15} michael@0: VRSHR.S16 Q8, Q8, #4 ; Q8 = y[0]+8>>4 michael@0: VRSHR.S16 Q9, Q9, #4 ; Q9 = y[1]+8>>4 michael@0: VRSHR.S16 Q10,Q10,#4 ; Q10 = y[2]+8>>4 michael@0: VRSHR.S16 Q11,Q11,#4 ; Q11 = y[3]+8>>4 michael@0: VRSHR.S16 Q12,Q12,#4 ; Q12 = y[4]+8>>4 michael@0: VRSHR.S16 Q13,Q13,#4 ; Q13 = y[5]+8>>4 michael@0: VRSHR.S16 Q14,Q14,#4 ; Q14 = y[6]+8>>4 michael@0: VRSHR.S16 Q15,Q15,#4 ; Q15 = y[7]+8>>4 michael@0: VSTMIA r0, {D16-D31} michael@0: MOV PC, r14 michael@0: ENDP michael@0: michael@0: oc_idct8x8_stage123_neon PROC michael@0: ; Stages 1 & 2 michael@0: VMULL.S16 Q4, D18,D1[3] michael@0: VMULL.S16 Q5, D19,D1[3] michael@0: VMULL.S16 Q7, D30,D1[3] michael@0: VMULL.S16 Q6, D31,D1[3] michael@0: VMULL.S16 Q2, D30,D0[1] michael@0: VMULL.S16 Q3, D31,D0[1] michael@0: VSHRN.S32 D8, Q4, #16 michael@0: VSHRN.S32 D9, Q5, #16 ; Q4 = (OC_C7S1*x[1]>>16) michael@0: VSHRN.S32 D14,Q7, #16 michael@0: VSHRN.S32 D15,Q6, #16 ; Q7 = (OC_C7S1*x[7]>>16) michael@0: VSHRN.S32 D4, Q2, #16 michael@0: VSHRN.S32 D5, Q3, #16 ; Q2 = (OC_C1S7*x[7]>>16)-x[7] michael@0: VSUB.S16 Q4, Q4, Q15 michael@0: VADD.S16 Q7, Q7, Q9 michael@0: VSUB.S16 Q4, Q4, Q2 ; Q4 = t[4] michael@0: VMULL.S16 Q2, D18,D0[1] michael@0: VMULL.S16 Q9, D19,D0[1] michael@0: VMULL.S16 Q5, D26,D0[3] michael@0: VMULL.S16 Q3, D27,D0[3] michael@0: VMULL.S16 Q6, D22,D0[3] michael@0: VMULL.S16 Q12,D23,D0[3] michael@0: VSHRN.S32 D4, Q2, #16 michael@0: VSHRN.S32 D5, Q9, #16 ; Q2 = (OC_C1S7*x[1]>>16)-x[1] michael@0: VSHRN.S32 D10,Q5, #16 michael@0: VSHRN.S32 D11,Q3, #16 ; Q5 = (OC_C3S5*x[5]>>16)-x[5] michael@0: VSHRN.S32 D12,Q6, #16 michael@0: VSHRN.S32 D13,Q12,#16 ; Q6 = (OC_C3S5*x[3]>>16)-x[3] michael@0: VADD.S16 Q7, Q7, Q2 ; Q7 = t[7] michael@0: VSUB.S16 Q5, Q5, Q11 michael@0: VADD.S16 Q6, Q6, Q11 michael@0: VADD.S16 Q5, Q5, Q13 michael@0: VADD.S16 Q6, Q6, Q13 michael@0: VMULL.S16 Q9, D22,D1[1] michael@0: VMULL.S16 Q11,D23,D1[1] michael@0: VMULL.S16 Q15,D26,D1[1] michael@0: VMULL.S16 Q13,D27,D1[1] michael@0: VMULL.S16 Q2, D20,D1[2] michael@0: VMULL.S16 Q12,D21,D1[2] michael@0: VSHRN.S32 D18,Q9, #16 michael@0: VSHRN.S32 D19,Q11,#16 ; Q9 = (OC_C5S3*x[3]>>16)-x[3] michael@0: VSHRN.S32 D30,Q15,#16 michael@0: VSHRN.S32 D31,Q13,#16 ; Q15= (OC_C5S3*x[5]>>16)-x[5] michael@0: VSHRN.S32 D4, Q2, #16 michael@0: VSHRN.S32 D5, Q12,#16 ; Q2 = (OC_C6S2*x[2]>>16) michael@0: VSUB.S16 Q5, Q5, Q9 ; Q5 = t[5] michael@0: VADD.S16 Q6, Q6, Q15 ; Q6 = t[6] michael@0: VSUB.S16 Q2, Q2, Q14 michael@0: VMULL.S16 Q3, D28,D1[2] michael@0: VMULL.S16 Q11,D29,D1[2] michael@0: VMULL.S16 Q12,D28,D0[2] michael@0: VMULL.S16 Q9, D29,D0[2] michael@0: VMULL.S16 Q13,D20,D0[2] michael@0: VMULL.S16 Q15,D21,D0[2] michael@0: VSHRN.S32 D6, Q3, #16 michael@0: VSHRN.S32 D7, Q11,#16 ; Q3 = (OC_C6S2*x[6]>>16) michael@0: VSHRN.S32 D24,Q12,#16 michael@0: VSHRN.S32 D25,Q9, #16 ; Q12= (OC_C2S6*x[6]>>16)-x[6] michael@0: VSHRN.S32 D26,Q13,#16 michael@0: VSHRN.S32 D27,Q15,#16 ; Q13= (OC_C2S6*x[2]>>16)-x[2] michael@0: VSUB.S16 Q9, Q4, Q5 ; Q9 = t[4]-t[5] michael@0: VSUB.S16 Q11,Q7, Q6 ; Q11= t[7]-t[6] michael@0: VADD.S16 Q3, Q3, Q10 michael@0: VADD.S16 Q4, Q4, Q5 ; Q4 = t[4]'=t[4]+t[5] michael@0: VADD.S16 Q7, Q7, Q6 ; Q7 = t[7]'=t[7]+t[6] michael@0: VSUB.S16 Q2, Q2, Q12 ; Q2 = t[2] michael@0: VADD.S16 Q3, Q3, Q13 ; Q3 = t[3] michael@0: VMULL.S16 Q12,D16,D1[0] michael@0: VMULL.S16 Q13,D17,D1[0] michael@0: VMULL.S16 Q14,D2, D1[0] michael@0: VMULL.S16 Q15,D3, D1[0] michael@0: VMULL.S16 Q5, D18,D1[0] michael@0: VMULL.S16 Q6, D22,D1[0] michael@0: VSHRN.S32 D24,Q12,#16 michael@0: VSHRN.S32 D25,Q13,#16 michael@0: VSHRN.S32 D28,Q14,#16 michael@0: VSHRN.S32 D29,Q15,#16 michael@0: VMULL.S16 Q13,D19,D1[0] michael@0: VMULL.S16 Q15,D23,D1[0] michael@0: VADD.S16 Q8, Q8, Q12 ; Q8 = t[0] michael@0: VADD.S16 Q1, Q1, Q14 ; Q1 = t[1] michael@0: VSHRN.S32 D10,Q5, #16 michael@0: VSHRN.S32 D12,Q6, #16 michael@0: VSHRN.S32 D11,Q13,#16 michael@0: VSHRN.S32 D13,Q15,#16 michael@0: VADD.S16 Q5, Q5, Q9 ; Q5 = t[5]'=OC_C4S4*(t[4]-t[5])>>16 michael@0: VADD.S16 Q6, Q6, Q11 ; Q6 = t[6]'=OC_C4S4*(t[7]-t[6])>>16 michael@0: ; Stage 3 michael@0: VSUB.S16 Q11,Q8, Q3 ; Q11 = t[3]''=t[0]-t[3] michael@0: VADD.S16 Q8, Q8, Q3 ; Q8 = t[0]''=t[0]+t[3] michael@0: VADD.S16 Q9, Q1, Q2 ; Q9 = t[1]''=t[1]+t[2] michael@0: VADD.S16 Q3, Q6, Q5 ; Q3 = t[6]''=t[6]'+t[5]' michael@0: VSUB.S16 Q10,Q1, Q2 ; Q10 = t[2]''=t[1]-t[2] michael@0: VSUB.S16 Q5, Q6, Q5 ; Q5 = t[5]''=t[6]'-t[5]' michael@0: MOV PC, r14 michael@0: ENDP michael@0: michael@0: oc_idct8x8_10_neon PROC michael@0: ADR r3, OC_IDCT_CONSTS_NEON michael@0: VLD1.64 {D0,D1}, [r3@128] michael@0: MOV r2, r1 michael@0: ; Row transforms (input is pre-transposed) michael@0: ; Stage 1 michael@0: VLD1.64 {D16,D17,D18,D19},[r2@128]! michael@0: MOV r12, #16 michael@0: VMULL.S16 Q15,D16,D1[0] ; Q15= OC_C4S4*x[0]-(x[0]<<16) michael@0: VLD1.64 {D17}, [r2@64], r12 michael@0: VMULL.S16 Q2, D18,D0[1] ; Q2 = OC_C1S7*x[1]-(x[1]<<16) michael@0: VLD1.64 {D19}, [r2@64] michael@0: VMULL.S16 Q14,D17,D0[2] ; Q14= OC_C2S6*x[2]-(x[2]<<16) michael@0: VMULL.S16 Q3, D19,D0[3] ; Q3 = OC_C3S5*x[3]-(x[3]<<16) michael@0: VMULL.S16 Q13,D19,D1[1] ; Q13= OC_C5S3*x[3]-(x[3]<<16) michael@0: VMULL.S16 Q12,D18,D1[3] ; Q12= OC_C7S1*x[1] michael@0: VMULL.S16 Q1, D17,D1[2] ; Q1 = OC_C6S2*x[2] michael@0: VSHRN.S32 D30,Q15,#16 ; D30= t[0]-x[0] michael@0: VSHRN.S32 D4, Q2, #16 ; D4 = t[7]-x[1] michael@0: VSHRN.S32 D31,Q14,#16 ; D31= t[3]-x[2] michael@0: VSHRN.S32 D6, Q3, #16 ; D6 = t[6]-x[3] michael@0: VSHRN.S32 D7, Q13,#16 ; D7 = -t[5]-x[3] michael@0: VSHRN.S32 D5, Q12,#16 ; D5 = t[4] michael@0: VSHRN.S32 D2, Q1, #16 ; D2 = t[2] michael@0: VADD.S16 D4, D4, D18 ; D4 = t[7] michael@0: VADD.S16 D6, D6, D19 ; D6 = t[6] michael@0: VADD.S16 D7, D7, D19 ; D7 = -t[5] michael@0: VADD.S16 Q15,Q15,Q8 ; D30= t[0] michael@0: ; D31= t[3] michael@0: ; Stages 2 & 3 michael@0: VSUB.S16 Q12,Q2, Q3 ; D24= t[7]-t[6] michael@0: ; D25= t[4]'=t[4]+t[5] michael@0: VADD.S16 Q13,Q2, Q3 ; D26= t[7]'=t[7]+t[6] michael@0: ; D27= t[4]-t[5] michael@0: VMULL.S16 Q11,D24,D1[0] ; Q11= OC_C4S4*(t[7]-t[6]) michael@0: ; -(t[7]-t[6]<<16) michael@0: VMULL.S16 Q14,D27,D1[0] ; Q14= OC_C4S4*(t[4]-t[5]) michael@0: ; -(t[4]-t[5]<<16) michael@0: VADD.S16 D16,D30,D31 ; D16= t[0]'=t[0]+t[3] michael@0: VSUB.S16 D17,D30,D2 ; D17= t[2]'=t[0]-t[2] michael@0: VADD.S16 D18,D30,D2 ; D18= t[1]'=t[0]+t[2] michael@0: VSHRN.S32 D22,Q11,#16 ; D22= (OC_C4S4*(t[7]-t[6])>>16) michael@0: ; -(t[7]-t[6]) michael@0: VSHRN.S32 D23,Q14,#16 ; D23= (OC_C4S4*(t[4]-t[5])>>16) michael@0: ; -(t[4]-t[5]) michael@0: VSUB.S16 D19,D30,D31 ; D19= t[3]'=t[0]-t[3] michael@0: VADD.S16 D22,D22,D24 ; D22= t[6]'=OC_C4S4*(t[7]-t[6])>>16 michael@0: VADD.S16 D23,D23,D27 ; D23= t[5]'=OC_C4S4*(t[4]-t[5])>>16 michael@0: VSUB.S16 D27,D22,D23 ; D27= t[5]''=t[6]'-t[5]' michael@0: VADD.S16 D24,D22,D23 ; D24= t[6]''=t[6]'+t[5]' michael@0: ; Stage 4 michael@0: VSUB.S16 Q11,Q8, Q13 ; D22= y[7]=t[0]'-t[7]' michael@0: ; D23= y[5]=t[2]'-t[5]'' michael@0: VSUB.S16 Q10,Q9, Q12 ; D20= y[6]=t[1]'-t[6]' michael@0: ; D21= y[4]=t[3]'-t[4]'' michael@0: VADD.S16 Q8, Q8, Q13 ; D16= y[0]=t[0]'+t[7]' michael@0: ; D17= y[2]=t[2]'+t[5]'' michael@0: VADD.S16 Q9, Q9, Q12 ; D18= y[1]=t[1]'-t[6]' michael@0: ; D19= y[3]=t[3]'-t[4]'' michael@0: ; 8x4 transpose michael@0: VTRN.16 Q10,Q11 ; Q10= c5c4a5a4 c7c6a7a6 michael@0: ; Q11= d5d4b5b4 d7d6b7b6 michael@0: VTRN.16 Q8, Q9 ; Q8 = c3c2a3a2 c1c0a1a0 michael@0: ; Q9 = d3d2b3b2 d1d0b1b0 michael@0: VSWP D20,D21 ; Q10= c7c6a7a6 c5c4a5a4 michael@0: VSWP D22,D23 ; Q11= d7d6b7b6 d5d4b5b4 michael@0: VUZP.32 Q9, Q11 ; Q9 = b7b6b5b4 b3b2b1b0 michael@0: ; Q11= d7d6d5d4 d3d2d1d0 michael@0: VMULL.S16 Q15,D18,D0[1] michael@0: VMULL.S16 Q13,D22,D1[1] michael@0: VUZP.32 Q8, Q10 ; Q8 = a7a6a5a4 a3a2a1a0 michael@0: ; Q10= c7c6c5c4 c3c2c1c0 michael@0: ; Column transforms michael@0: ; Stages 1, 2, & 3 michael@0: VMULL.S16 Q14,D19,D0[1] ; Q14:Q15= OC_C1S7*x[1]-(x[1]<<16) michael@0: VMULL.S16 Q12,D23,D1[1] ; Q12:Q13= OC_C5S3*x[3]-(x[3]<<16) michael@0: VMULL.S16 Q3, D22,D0[3] michael@0: VMULL.S16 Q2, D23,D0[3] ; Q2:Q3 = OC_C3S5*x[3]-(x[3]<<16) michael@0: VSHRN.S32 D30,Q15,#16 michael@0: VSHRN.S32 D31,Q14,#16 ; Q15= (OC_C1S7*x[1]>>16)-x[1] michael@0: VSHRN.S32 D26,Q13,#16 michael@0: VSHRN.S32 D27,Q12,#16 ; Q13= (OC_C5S3*x[3]>>16)-x[3] michael@0: VSHRN.S32 D28,Q3, #16 michael@0: VSHRN.S32 D29,Q2, #16 ; Q14= (OC_C3S5*x[3]>>16)-x[3] michael@0: VADD.S16 Q15,Q15,Q9 ; Q15= t[7] michael@0: VADD.S16 Q13,Q13,Q11 ; Q13= -t[5] michael@0: VADD.S16 Q14,Q14,Q11 ; Q14= t[6] michael@0: VMULL.S16 Q12,D18,D1[3] michael@0: VMULL.S16 Q2, D19,D1[3] ; Q2:Q12= OC_C7S1*x[1] michael@0: VMULL.S16 Q1, D16,D1[0] michael@0: VMULL.S16 Q11,D17,D1[0] ; Q11:Q1 = OC_C4S4*x[0]-(x[0]<<16) michael@0: VMULL.S16 Q3, D20,D0[2] michael@0: VMULL.S16 Q9, D21,D0[2] ; Q9:Q3 = OC_C2S6*x[2]-(x[2]<<16) michael@0: VSHRN.S32 D24,Q12,#16 michael@0: VSHRN.S32 D25,Q2, #16 ; Q12= t[4] michael@0: VMULL.S16 Q2, D20,D1[2] michael@0: VSHRN.S32 D2, Q1, #16 michael@0: VSHRN.S32 D3, Q11,#16 ; Q1 = (OC_C4S4*x[0]>>16)-x[0] michael@0: VMULL.S16 Q11,D21,D1[2] ; Q2:Q11= OC_C6S2*x[2] michael@0: VSHRN.S32 D6, Q3, #16 michael@0: VSHRN.S32 D7, Q9, #16 ; Q3 = (OC_C2S6*x[2]>>16)-x[2] michael@0: VSUB.S16 Q9, Q15,Q14 ; Q9 = t[7]-t[6] michael@0: VADD.S16 Q15,Q15,Q14 ; Q15= t[7]'=t[7]+t[6] michael@0: VSHRN.S32 D4, Q2, #16 michael@0: VSHRN.S32 D5, Q11,#16 ; Q2 = t[2] michael@0: VADD.S16 Q1, Q1, Q8 ; Q1 = t[0] michael@0: VADD.S16 Q8, Q12,Q13 ; Q8 = t[4]-t[5] michael@0: VADD.S16 Q3, Q3, Q10 ; Q3 = t[3] michael@0: VMULL.S16 Q10,D16,D1[0] michael@0: VMULL.S16 Q11,D17,D1[0] ; Q11:Q10= OC_C4S4*(t[4]-t[5]) michael@0: ; -(t[4]-t[5]<<16) michael@0: VSUB.S16 Q12,Q12,Q13 ; Q12= t[4]'=t[4]+t[5] michael@0: VMULL.S16 Q14,D18,D1[0] michael@0: VMULL.S16 Q13,D19,D1[0] ; Q13:Q14= OC_C4S4*(t[6]-t[7]) michael@0: ; -(t[6]-t[7]<<16) michael@0: VSHRN.S32 D20,Q10,#16 michael@0: VSHRN.S32 D21,Q11,#16 ; Q10= (OC_C4S4*(t[4]-t[5])>>16) michael@0: ; -(t[4]-t[5]) michael@0: VADD.S16 Q11,Q1, Q3 ; Q11= t[0]'=t[0]+t[3] michael@0: VSUB.S16 Q3, Q1, Q3 ; Q3 = t[3]'=t[0]-t[3] michael@0: VSHRN.S32 D28,Q14,#16 michael@0: VSHRN.S32 D29,Q13,#16 ; Q14= (OC_C4S4*(t[7]-t[6])>>16) michael@0: ; -(t[7]-t[6]) michael@0: VADD.S16 Q10,Q10,Q8 ; Q10=t[5]' michael@0: VADD.S16 Q14,Q14,Q9 ; Q14=t[6]' michael@0: VSUB.S16 Q13,Q14,Q10 ; Q13=t[5]''=t[6]'-t[5]' michael@0: VADD.S16 Q14,Q14,Q10 ; Q14=t[6]''=t[6]'+t[5]' michael@0: VADD.S16 Q10,Q1, Q2 ; Q10= t[1]'=t[0]+t[2] michael@0: VSUB.S16 Q2, Q1, Q2 ; Q2 = t[2]'=t[0]-t[2] michael@0: ; Stage 4 michael@0: CMP r0, r1 michael@0: VADD.S16 Q8, Q11,Q15 ; Q8 = y[0]=t[0]'+t[7]' michael@0: VADD.S16 Q9, Q10,Q14 ; Q9 = y[1]=t[1]'+t[6]'' michael@0: VSUB.S16 Q15,Q11,Q15 ; Q15 = y[7]=t[0]'-t[7]' michael@0: VSUB.S16 Q14,Q10,Q14 ; Q14 = y[6]=t[1]'-t[6]'' michael@0: VADD.S16 Q10,Q2, Q13 ; Q10 = y[2]=t[2]'+t[5]'' michael@0: VADD.S16 Q11,Q3, Q12 ; Q11 = y[3]=t[3]'+t[4]' michael@0: VSUB.S16 Q12,Q3, Q12 ; Q12 = y[4]=t[3]'-t[4]' michael@0: VSUB.S16 Q13,Q2, Q13 ; Q13 = y[5]=t[2]'-t[5]'' michael@0: BEQ oc_idct8x8_10_neon_noclear michael@0: VMOV.I8 D2, #0 michael@0: VRSHR.S16 Q8, Q8, #4 ; Q8 = y[0]+8>>4 michael@0: VST1.64 {D2}, [r1@64], r12 michael@0: VRSHR.S16 Q9, Q9, #4 ; Q9 = y[1]+8>>4 michael@0: VRSHR.S16 Q10,Q10,#4 ; Q10 = y[2]+8>>4 michael@0: VST1.64 {D2}, [r1@64], r12 michael@0: VRSHR.S16 Q11,Q11,#4 ; Q11 = y[3]+8>>4 michael@0: VRSHR.S16 Q12,Q12,#4 ; Q12 = y[4]+8>>4 michael@0: VST1.64 {D2}, [r1@64], r12 michael@0: VRSHR.S16 Q13,Q13,#4 ; Q13 = y[5]+8>>4 michael@0: VRSHR.S16 Q14,Q14,#4 ; Q14 = y[6]+8>>4 michael@0: VST1.64 {D2}, [r1@64] michael@0: VRSHR.S16 Q15,Q15,#4 ; Q15 = y[7]+8>>4 michael@0: VSTMIA r0, {D16-D31} michael@0: MOV PC, r14 michael@0: michael@0: oc_idct8x8_10_neon_noclear michael@0: VRSHR.S16 Q8, Q8, #4 ; Q8 = y[0]+8>>4 michael@0: VRSHR.S16 Q9, Q9, #4 ; Q9 = y[1]+8>>4 michael@0: VRSHR.S16 Q10,Q10,#4 ; Q10 = y[2]+8>>4 michael@0: VRSHR.S16 Q11,Q11,#4 ; Q11 = y[3]+8>>4 michael@0: VRSHR.S16 Q12,Q12,#4 ; Q12 = y[4]+8>>4 michael@0: VRSHR.S16 Q13,Q13,#4 ; Q13 = y[5]+8>>4 michael@0: VRSHR.S16 Q14,Q14,#4 ; Q14 = y[6]+8>>4 michael@0: VRSHR.S16 Q15,Q15,#4 ; Q15 = y[7]+8>>4 michael@0: VSTMIA r0, {D16-D31} michael@0: MOV PC, r14 michael@0: ENDP michael@0: ] michael@0: michael@0: END