• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@ Tremolo library
2@-----------------------------------------------------------------------
3@ Copyright (C) 2002-2009, Xiph.org Foundation
4@ Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
5@ All rights reserved.
6
7@ Redistribution and use in source and binary forms, with or without
8@ modification, are permitted provided that the following conditions
9@ are met:
10
11@     * Redistributions of source code must retain the above copyright
12@ notice, this list of conditions and the following disclaimer.
13@     * Redistributions in binary form must reproduce the above
14@ copyright notice, this list of conditions and the following disclaimer
15@ in the documentation and/or other materials provided with the
16@ distribution.
17@     * Neither the names of the Xiph.org Foundation nor Pinknoise
18@ Productions Ltd nor the names of its contributors may be used to
19@ endorse or promote products derived from this software without
20@ specific prior written permission.
21@
22@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23@ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24@ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26@ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27@ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33@ ----------------------------------------------------------------------
34
35    .text
36
37	.global	render_lineARM
38	.type render_lineARM, %function
39
40render_lineARM:
41	@ r0 = n
42	@ r1 = d
43	@ r2 = floor
44	@ r3 = base
45	@ <> = err
46	@ <> = adx
47	@ <> = ady
48	MOV	r12,r13
49	STMFD	r13!,{r4-r6,r11,r14}
50	LDMFD	r12,{r11,r12,r14}	@ r11 = err
51					@ r12 = adx
52					@ r14 = ady
53rl_loop:
54	LDR	r4,[r1]			@ r4 = *d
55	LDR	r5,[r2],r3,LSL #2	@ r5 = *floor    r2 = floor+base
56	SUBS	r11,r11,r14		@ err -= ady
57	ADDLT	r11,r11,r12		@ if (err < 0) err+=adx
58	SMULL	r6, r5, r4, r5		@ (r6,r5) = *d * *floor
59	ADDLT	r2, r2, #4		@              floor+=1
60	MOVS	r6, r6, LSR #15
61	ADC	r5, r6, r5, LSL #17	@ r5 = MULT31_SHIFT15
62	STR	r5,[r1],#4
63	SUBS	r0, r0, #1
64	BGT	rl_loop
65
66	LDMFD	r13!,{r4-r6,r11,PC}
67
68	@ END
69