[xiph-commits] r17219 - branches/lowmem-branch/Tremolo

robin at svn.xiph.org robin at svn.xiph.org
Sat May 15 16:36:52 PDT 2010


Author: robin
Date: 2010-05-15 16:36:52 -0700 (Sat, 15 May 2010)
New Revision: 17219

Added:
   branches/lowmem-branch/Tremolo/floor1ARM.s
   branches/lowmem-branch/Tremolo/floor1LARM.s
Modified:
   branches/lowmem-branch/Tremolo/Makefile.am
   branches/lowmem-branch/Tremolo/floor1.c
Log:
ARM implementation of floor1 render_line functions (normal and LOW_ACCURACY
versions).



Modified: branches/lowmem-branch/Tremolo/Makefile.am
===================================================================
--- branches/lowmem-branch/Tremolo/Makefile.am	2010-05-15 20:40:20 UTC (rev 17218)
+++ branches/lowmem-branch/Tremolo/Makefile.am	2010-05-15 23:36:52 UTC (rev 17219)
@@ -8,8 +8,9 @@
 lib_LTLIBRARIES = libvorbisidec.la
 
 if ARM_TARGET
-# Build 'em both and let God sort 'em out
-TARGET_SPECIFIC_SOURCES = mdctARM.s mdctLARM.s
+# Build both low and full accuracy versions and the linker will only
+# include the appropriate versions.
+TARGET_SPECIFIC_SOURCES = mdctARM.s mdctLARM.s floor1ARM.s floor1LARM.s
 else
 TARGET_SPECIFIC_SOURCES =
 endif

Modified: branches/lowmem-branch/Tremolo/floor1.c
===================================================================
--- branches/lowmem-branch/Tremolo/floor1.c	2010-05-15 20:40:20 UTC (rev 17218)
+++ branches/lowmem-branch/Tremolo/floor1.c	2010-05-15 23:36:52 UTC (rev 17219)
@@ -195,6 +195,13 @@
   }
 }
 
+#ifdef _ARM_ASSEM_
+void render_line_arm(int n, ogg_int32_t *d,const ogg_int32_t *floor,
+                     int base, int err, int adx, int ady);
+void render_line_arm_low(int n, ogg_int32_t *d,const ogg_int32_t *floor,
+                         int base, int err, int adx, int ady);
+#endif
+
 static void render_line(int n,int x0,int x1,int y0,int y1,ogg_int32_t *d){
   int dy;
   int adx;
@@ -231,6 +238,13 @@
     err = 0;
   }
 
+#ifdef _ARM_ASSEM_
+#ifdef _LOW_ACCURACY_
+  render_line_arm_low(n,d,floor,base,err,adx,ady);
+#else
+  render_line_arm(n,d,floor,base,err,adx,ady);
+#endif
+#else
   do{
     *d = MULT31_SHIFT15(*d,*floor);
     d++;
@@ -242,6 +256,7 @@
     }
     n--;
   } while(n>0);
+#endif
 }
 
 int floor1_memosize(vorbis_info_floor *i){

Added: branches/lowmem-branch/Tremolo/floor1ARM.s
===================================================================
--- branches/lowmem-branch/Tremolo/floor1ARM.s	                        (rev 0)
+++ branches/lowmem-branch/Tremolo/floor1ARM.s	2010-05-15 23:36:52 UTC (rev 17219)
@@ -0,0 +1,36 @@
+; Tremolo library
+; Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd
+
+	AREA	|.text|, CODE, READONLY
+
+	EXPORT	render_line_arm
+
+render_line_arm
+	; r0 = n
+	; r1 = d
+	; r2 = floor
+	; r3 = base
+	; <> = err
+	; <> = adx
+	; <> = ady
+	MOV	r12,r13
+	STMFD	r13!,{r4-r6,r11,r14}
+	LDMFD	r12,{r11,r12,r14}	; r11 = err
+					; r12 = adx
+					; r14 = ady
+rl_loop
+	LDR	r4,[r1]			; r4 = *d
+	LDR	r5,[r2],r3,LSL #2	; r5 = *floor    r2 = floor+base
+	SUBS	r11,r11,r14		; err -= ady
+	ADDLT	r11,r11,r12		; if (err < 0) err+=adx
+	SMULL	r6, r5, r4, r5		; (r6,r5) = *d * *floor
+	ADDLT	r2, r2, #4		;              floor+=1
+	MOVS	r6, r6, LSR #15
+	ADC	r5, r6, r5, LSL #17	; r5 = MULT31_SHIFT15
+	STR	r5,[r1],#4
+	SUBS	r0, r0, #1
+	BGT	rl_loop
+
+	LDMFD	r13!,{r4-r6,r11,PC}
+
+	END

Added: branches/lowmem-branch/Tremolo/floor1LARM.s
===================================================================
--- branches/lowmem-branch/Tremolo/floor1LARM.s	                        (rev 0)
+++ branches/lowmem-branch/Tremolo/floor1LARM.s	2010-05-15 23:36:52 UTC (rev 17219)
@@ -0,0 +1,35 @@
+; Tremolo library
+; Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd
+
+	AREA	|.text|, CODE, READONLY
+
+	EXPORT	render_line_arm_low
+
+render_line_arm_low
+	; r0 = n
+	; r1 = d
+	; r2 = floor
+	; r3 = base
+	; <> = err
+	; <> = adx
+	; <> = ady
+	MOV	r12,r13
+	STMFD	r13!,{r4-r6,r11,r14}
+	LDMFD	r12,{r11,r12,r14}	; r11 = err
+					; r12 = adx
+					; r14 = ady
+rl_loop
+	LDR	r4, [r1]		; r4 = *d
+	LDR	r5, [r2], r3,LSL #2	; r5 = *floor    r2 = floor+base
+	SUBS	r11,r11,r14		; err -= ady
+	MOV	r4, r4, ASR #6
+	MUL	r5, r4, r5		; r5 = MULT31_SHIFT15
+	ADDLT	r11,r11,r12		; if (err < 0) err+=adx
+	ADDLT	r2, r2, #4		;              floor+=1
+	SUBS	r0, r0, #1
+	STR	r5, [r1], #4
+	BGT	rl_loop
+
+	LDMFD	r13!,{r4-r6,r11,PC}
+
+	END



More information about the commits mailing list