tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

0026-Bug-901208-Fix-ARM-v4t.patch (4409B)


      1 diff --git a/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp b/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
      2 --- a/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
      3 +++ b/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
      4 @@ -26,66 +26,78 @@ static void S32A_D565_Opaque(uint16_t* S
      5     asm volatile (
      6                   "1:                                   \n\t"
      7                   "ldr     r3, [%[src]], #4             \n\t"
      8                   "cmp     r3, #0xff000000              \n\t"
      9                   "blo     2f                           \n\t"
     10                   "and     r4, r3, #0x0000f8            \n\t"
     11                   "and     r5, r3, #0x00fc00            \n\t"
     12                   "and     r6, r3, #0xf80000            \n\t"
     13 +#ifdef SK_ARM_HAS_EDSP
     14                   "pld     [r1, #32]                    \n\t"
     15 +#endif
     16                   "lsl     r3, r4, #8                   \n\t"
     17                   "orr     r3, r3, r5, lsr #5           \n\t"
     18                   "orr     r3, r3, r6, lsr #19          \n\t"
     19                   "subs    %[count], %[count], #1       \n\t"
     20                   "strh    r3, [%[dst]], #2             \n\t"
     21                   "bne     1b                           \n\t"
     22                   "b       4f                           \n\t"
     23                   "2:                                   \n\t"
     24                   "lsrs    r7, r3, #24                  \n\t"
     25                   "beq     3f                           \n\t"
     26                   "ldrh    r4, [%[dst]]                 \n\t"
     27                   "rsb     r7, r7, #255                 \n\t"
     28                   "and     r6, r4, #0x001f              \n\t"
     29 -#if SK_ARM_ARCH == 6
     30 +#if SK_ARM_ARCH <= 6
     31                   "lsl     r5, r4, #21                  \n\t"
     32                   "lsr     r5, r5, #26                  \n\t"
     33 #else
     34                   "ubfx    r5, r4, #5, #6               \n\t"
     35 #endif
     36 +#ifdef SK_ARM_HAS_EDSP
     37                   "pld     [r0, #16]                    \n\t"
     38 +#endif
     39                   "lsr     r4, r4, #11                  \n\t"
     40 #ifdef SK_ARM_HAS_EDSP
     41                   "smulbb  r6, r6, r7                   \n\t"
     42                   "smulbb  r5, r5, r7                   \n\t"
     43                   "smulbb  r4, r4, r7                   \n\t"
     44 #else
     45                   "mul     r6, r6, r7                   \n\t"
     46                   "mul     r5, r5, r7                   \n\t"
     47                   "mul     r4, r4, r7                   \n\t"
     48 #endif
     49 +#if SK_ARM_ARCH >= 6
     50                   "uxtb    r7, r3, ROR #16              \n\t"
     51                   "uxtb    ip, r3, ROR #8               \n\t"
     52 +#else
     53 +                  "mov     ip, #0xff                    \n\t"
     54 +                  "and     r7, ip, r3, ROR #16          \n\t"
     55 +                  "and     ip, ip, r3, ROR #8           \n\t"
     56 +#endif
     57                   "and     r3, r3, #0xff                \n\t"
     58                   "add     r6, r6, #16                  \n\t"
     59                   "add     r5, r5, #32                  \n\t"
     60                   "add     r4, r4, #16                  \n\t"
     61                   "add     r6, r6, r6, lsr #5           \n\t"
     62                   "add     r5, r5, r5, lsr #6           \n\t"
     63                   "add     r4, r4, r4, lsr #5           \n\t"
     64                   "add     r6, r7, r6, lsr #5           \n\t"
     65                   "add     r5, ip, r5, lsr #6           \n\t"
     66                   "add     r4, r3, r4, lsr #5           \n\t"
     67                   "lsr     r6, r6, #3                   \n\t"
     68                   "and     r5, r5, #0xfc                \n\t"
     69                   "and     r4, r4, #0xf8                \n\t"
     70                   "orr     r6, r6, r5, lsl #3           \n\t"
     71                   "orr     r4, r6, r4, lsl #8           \n\t"
     72                   "strh    r4, [%[dst]], #2             \n\t"
     73 +#ifdef SK_ARM_HAS_EDSP
     74                   "pld     [r1, #32]                    \n\t"
     75 +#endif
     76                   "subs    %[count], %[count], #1       \n\t"
     77                   "bne     1b                           \n\t"
     78                   "b       4f                           \n\t"
     79                   "3:                                   \n\t"
     80                   "subs    %[count], %[count], #1       \n\t"
     81                   "add     %[dst], %[dst], #2           \n\t"
     82                   "bne     1b                           \n\t"
     83                   "4:                                   \n\t"