iterators.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* 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. .text
  18. .align 2
  19. .arm
  20. .global iterators0032
  21. .type iterators0032, %function
  22. /*
  23. * iterators0032
  24. *
  25. * MUST BE CALLED FROM ARM CODE
  26. *
  27. * r0: const compute_iterators_t* (this)
  28. * r0 + 0: m_dx01
  29. * r0 + 4: m_dy10
  30. * r0 + 8: m_dx20
  31. * r0 +12: m_dy02
  32. * r0 +16: m_x0
  33. * r0 +20: m_y0
  34. * r0 +24: m_area
  35. * r0 +28: m_scale
  36. * r0 +29: m_area_scale;
  37. * r1: int32_t* (out)
  38. * r1 + 0: c
  39. * r1 + 4: dcdx
  40. * r1 + 8: dcdy
  41. * r2: c0
  42. * r3: c1
  43. * [sp]: c2
  44. */
  45. iterators0032:
  46. stmfd sp!, {r4, r5, r6, r7, r8, lr}
  47. ldr r4, [sp, #4*6]
  48. ldrb r12, [r0, #29]
  49. sub r3, r3, r2
  50. sub r4, r4, r2
  51. sub r12, r12, #16
  52. mov r3, r3, asr r12
  53. mov r4, r4, asr r12
  54. ldr r5, [r0, #0]
  55. ldr r12, [r0, #4]
  56. smull r8, lr, r4, r5
  57. ldr r5, [r0, #8]
  58. smull r6, r7, r4, r12
  59. ldr r12, [r0, #12]
  60. smlal r8, lr, r3, r5
  61. smlal r6, r7, r3, r12
  62. ldr r3, [r0, #16] // m_x0
  63. ldr r4, [r0, #20] // m_x1
  64. str r6, [r1, #4]
  65. str r8, [r1, #8]
  66. umull r6, r5, r3, r6
  67. umull r8, r0, r4, r8
  68. mla r7, r3, r7, r5
  69. mla lr, r4, lr, r0
  70. adds r6, r6, r8
  71. adc r7, r7, lr
  72. movs r6, r6, lsr #4
  73. adc r6, r6, r7, lsl #28
  74. rsb r6, r6, r2, lsl #16
  75. str r6, [r1, #0]
  76. ldmfd sp!, {r4, r5, r6, r7, r8, pc}