OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBlitRow.h" | 8 #include "SkBlitRow.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkDither.h" | 10 #include "SkDither.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 SkASSERT(255 == alpha); | 30 SkASSERT(255 == alpha); |
31 | 31 |
32 asm volatile ( | 32 asm volatile ( |
33 "1: \n\t" | 33 "1: \n\t" |
34 "ldr r3, [%[src]], #4 \n\t" | 34 "ldr r3, [%[src]], #4 \n\t" |
35 "cmp r3, #0xff000000 \n\t" | 35 "cmp r3, #0xff000000 \n\t" |
36 "blo 2f \n\t" | 36 "blo 2f \n\t" |
37 "and r4, r3, #0x0000f8 \n\t" | 37 "and r4, r3, #0x0000f8 \n\t" |
38 "and r5, r3, #0x00fc00 \n\t" | 38 "and r5, r3, #0x00fc00 \n\t" |
39 "and r6, r3, #0xf80000 \n\t" | 39 "and r6, r3, #0xf80000 \n\t" |
| 40 #ifdef SK_ARM_HAS_EDSP |
40 "pld [r1, #32] \n\t" | 41 "pld [r1, #32] \n\t" |
| 42 #endif |
41 "lsl r3, r4, #8 \n\t" | 43 "lsl r3, r4, #8 \n\t" |
42 "orr r3, r3, r5, lsr #5 \n\t" | 44 "orr r3, r3, r5, lsr #5 \n\t" |
43 "orr r3, r3, r6, lsr #19 \n\t" | 45 "orr r3, r3, r6, lsr #19 \n\t" |
44 "subs %[count], %[count], #1 \n\t" | 46 "subs %[count], %[count], #1 \n\t" |
45 "strh r3, [%[dst]], #2 \n\t" | 47 "strh r3, [%[dst]], #2 \n\t" |
46 "bne 1b \n\t" | 48 "bne 1b \n\t" |
47 "b 4f \n\t" | 49 "b 4f \n\t" |
48 "2: \n\t" | 50 "2: \n\t" |
49 "lsrs r7, r3, #24 \n\t" | 51 "lsrs r7, r3, #24 \n\t" |
50 "beq 3f \n\t" | 52 "beq 3f \n\t" |
51 "ldrh r4, [%[dst]] \n\t" | 53 "ldrh r4, [%[dst]] \n\t" |
52 "rsb r7, r7, #255 \n\t" | 54 "rsb r7, r7, #255 \n\t" |
53 "and r6, r4, #0x001f \n\t" | 55 "and r6, r4, #0x001f \n\t" |
54 #if SK_ARM_ARCH == 6 | 56 #if SK_ARM_ARCH <= 6 |
55 "lsl r5, r4, #21 \n\t" | 57 "lsl r5, r4, #21 \n\t" |
56 "lsr r5, r5, #26 \n\t" | 58 "lsr r5, r5, #26 \n\t" |
57 #else | 59 #else |
58 "ubfx r5, r4, #5, #6 \n\t" | 60 "ubfx r5, r4, #5, #6 \n\t" |
59 #endif | 61 #endif |
| 62 #ifdef SK_ARM_HAS_EDSP |
60 "pld [r0, #16] \n\t" | 63 "pld [r0, #16] \n\t" |
| 64 #endif |
61 "lsr r4, r4, #11 \n\t" | 65 "lsr r4, r4, #11 \n\t" |
62 #ifdef SK_ARM_HAS_EDSP | 66 #ifdef SK_ARM_HAS_EDSP |
63 "smulbb r6, r6, r7 \n\t" | 67 "smulbb r6, r6, r7 \n\t" |
64 "smulbb r5, r5, r7 \n\t" | 68 "smulbb r5, r5, r7 \n\t" |
65 "smulbb r4, r4, r7 \n\t" | 69 "smulbb r4, r4, r7 \n\t" |
66 #else | 70 #else |
67 "mul r6, r6, r7 \n\t" | 71 "mul r6, r6, r7 \n\t" |
68 "mul r5, r5, r7 \n\t" | 72 "mul r5, r5, r7 \n\t" |
69 "mul r4, r4, r7 \n\t" | 73 "mul r4, r4, r7 \n\t" |
70 #endif | 74 #endif |
| 75 #if SK_ARM_ARCH >= 6 |
71 "uxtb r7, r3, ROR #16 \n\t" | 76 "uxtb r7, r3, ROR #16 \n\t" |
72 "uxtb ip, r3, ROR #8 \n\t" | 77 "uxtb ip, r3, ROR #8 \n\t" |
| 78 #else |
| 79 "mov ip, #0xff \n\t" |
| 80 "and r7, ip, r3, ROR #16 \n\t" |
| 81 "and ip, ip, r3, ROR #8 \n\t" |
| 82 #endif |
73 "and r3, r3, #0xff \n\t" | 83 "and r3, r3, #0xff \n\t" |
74 "add r6, r6, #16 \n\t" | 84 "add r6, r6, #16 \n\t" |
75 "add r5, r5, #32 \n\t" | 85 "add r5, r5, #32 \n\t" |
76 "add r4, r4, #16 \n\t" | 86 "add r4, r4, #16 \n\t" |
77 "add r6, r6, r6, lsr #5 \n\t" | 87 "add r6, r6, r6, lsr #5 \n\t" |
78 "add r5, r5, r5, lsr #6 \n\t" | 88 "add r5, r5, r5, lsr #6 \n\t" |
79 "add r4, r4, r4, lsr #5 \n\t" | 89 "add r4, r4, r4, lsr #5 \n\t" |
80 "add r6, r7, r6, lsr #5 \n\t" | 90 "add r6, r7, r6, lsr #5 \n\t" |
81 "add r5, ip, r5, lsr #6 \n\t" | 91 "add r5, ip, r5, lsr #6 \n\t" |
82 "add r4, r3, r4, lsr #5 \n\t" | 92 "add r4, r3, r4, lsr #5 \n\t" |
83 "lsr r6, r6, #3 \n\t" | 93 "lsr r6, r6, #3 \n\t" |
84 "and r5, r5, #0xfc \n\t" | 94 "and r5, r5, #0xfc \n\t" |
85 "and r4, r4, #0xf8 \n\t" | 95 "and r4, r4, #0xf8 \n\t" |
86 "orr r6, r6, r5, lsl #3 \n\t" | 96 "orr r6, r6, r5, lsl #3 \n\t" |
87 "orr r4, r6, r4, lsl #8 \n\t" | 97 "orr r4, r6, r4, lsl #8 \n\t" |
88 "strh r4, [%[dst]], #2 \n\t" | 98 "strh r4, [%[dst]], #2 \n\t" |
| 99 #ifdef SK_ARM_HAS_EDSP |
89 "pld [r1, #32] \n\t" | 100 "pld [r1, #32] \n\t" |
| 101 #endif |
90 "subs %[count], %[count], #1 \n\t" | 102 "subs %[count], %[count], #1 \n\t" |
91 "bne 1b \n\t" | 103 "bne 1b \n\t" |
92 "b 4f \n\t" | 104 "b 4f \n\t" |
93 "3: \n\t" | 105 "3: \n\t" |
94 "subs %[count], %[count], #1 \n\t" | 106 "subs %[count], %[count], #1 \n\t" |
95 "add %[dst], %[dst], #2 \n\t" | 107 "add %[dst], %[dst], #2 \n\t" |
96 "bne 1b \n\t" | 108 "bne 1b \n\t" |
97 "4: \n\t" | 109 "4: \n\t" |
98 : [dst] "+r" (dst), [src] "+r" (src), [count] "+r" (count) | 110 : [dst] "+r" (dst), [src] "+r" (src), [count] "+r" (count) |
99 : | 111 : |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 383 |
372 /////////////////////////////////////////////////////////////////////////////// | 384 /////////////////////////////////////////////////////////////////////////////// |
373 #define Color32_arm NULL | 385 #define Color32_arm NULL |
374 SkBlitRow::ColorProc SkBlitRow::PlatformColorProc() { | 386 SkBlitRow::ColorProc SkBlitRow::PlatformColorProc() { |
375 return SK_ARM_NEON_WRAP(Color32_arm); | 387 return SK_ARM_NEON_WRAP(Color32_arm); |
376 } | 388 } |
377 | 389 |
378 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { | 390 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { |
379 return NULL; | 391 return NULL; |
380 } | 392 } |
OLD | NEW |