blob: daf2937ba0e445fec89333bb8b4b373249bdab9c [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/* libs/opengles/iterators.S
2**
3** Copyright 2006, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9** http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18
19 .text
20 .align
21 .arm
22
23 .global iterators0032
24
25/*
26 * iterators0032
27 *
28 * MUST BE CALLED FROM ARM CODE
29 *
30 * r0: const compute_iterators_t* (this)
31 * r0 + 0: m_dx01
32 * r0 + 4: m_dy10
33 * r0 + 8: m_dx20
34 * r0 +12: m_dy02
35 * r0 +16: m_x0
36 * r0 +20: m_y0
37 * r0 +24: m_area
38 * r0 +28: m_scale
39 * r0 +29: m_area_scale;
40 * r1: int32_t* (out)
41 * r1 + 0: c
42 * r1 + 4: dcdx
43 * r1 + 8: dcdy
44 * r2: c0
45 * r3: c1
46 * [sp]: c2
47 */
48
49iterators0032:
50 stmfd sp!, {r4, r5, r6, r7, r8, lr}
51 ldr r4, [sp, #4*6]
52
53 ldrb r12, [r0, #29]
54 sub r3, r3, r2
55 sub r4, r4, r2
56 sub r12, r12, #16
57 mov r3, r3, asr r12
58 mov r4, r4, asr r12
59
60 ldr r5, [r0, #0]
61 ldr r12, [r0, #4]
62 smull r8, lr, r4, r5
63 ldr r5, [r0, #8]
64 smull r6, r7, r4, r12
65 ldr r12, [r0, #12]
66 smlal r8, lr, r3, r5
67 smlal r6, r7, r3, r12
68
69 ldr r3, [r0, #16] // m_x0
70 ldr r4, [r0, #20] // m_x1
71
72 str r6, [r1, #4]
73 str r8, [r1, #8]
74
75 umull r6, r5, r3, r6
76 umull r8, r0, r4, r8
77 mla r7, r3, r7, r5
78 mla lr, r4, lr, r0
79 adds r6, r6, r8
80 adc r7, r7, lr
81
82 movs r6, r6, lsr #4
83 adc r6, r6, r7, lsl #28
84 rsb r6, r6, r2, lsl #16
85 str r6, [r1, #0]
86
87 ldmfd sp!, {r4, r5, r6, r7, r8, pc}
88