OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Android Open Source Project | 2 * Copyright 2014 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 "SkBlitMask.h" | 9 #include "SkBlitMask.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 "2: \n\t" | 801 "2: \n\t" |
802 ".set pop \n\t" | 802 ".set pop \n\t" |
803 : [src]"+r"(src), [dst]"+r"(dst), [count]"+r"(count), | 803 : [src]"+r"(src), [dst]"+r"(dst), [count]"+r"(count), |
804 [t0]"=&r"(t0), [t1]"=&r"(t1), [t2]"=&r"(t2), [t3]"=&r"(t3), | 804 [t0]"=&r"(t0), [t1]"=&r"(t1), [t2]"=&r"(t2), [t3]"=&r"(t3), |
805 [t4]"=&r"(t4), [t5]"=&r"(t5), [t6]"=&r"(t6), [t7]"=&r"(t7) | 805 [t4]"=&r"(t4), [t5]"=&r"(t5), [t6]"=&r"(t6), [t7]"=&r"(t7) |
806 : [alpha]"r"(alpha) | 806 : [alpha]"r"(alpha) |
807 : "memory", "hi", "lo" | 807 : "memory", "hi", "lo" |
808 ); | 808 ); |
809 } | 809 } |
810 | 810 |
| 811 void blitmask_d565_opaque_mips(int width, int height, uint16_t* device, |
| 812 unsigned deviceRB, const uint8_t* alpha, |
| 813 uint32_t expanded32, unsigned maskRB) { |
| 814 register uint32_t s0, s1, s2, s3; |
| 815 |
| 816 __asm__ volatile ( |
| 817 ".set push \n\t" |
| 818 ".set noreorder \n\t" |
| 819 ".set noat \n\t" |
| 820 "li $t9, 0x7E0F81F \n\t" |
| 821 "1: \n\t" |
| 822 "move $t8, %[width] \n\t" |
| 823 "addiu %[height], %[height], -1 \n\t" |
| 824 "2: \n\t" |
| 825 "beqz $t8, 4f \n\t" |
| 826 " addiu $t0, $t8, -4 \n\t" |
| 827 "bltz $t0, 3f \n\t" |
| 828 " nop \n\t" |
| 829 "addiu $t8, $t8, -4 \n\t" |
| 830 "lhu $t0, 0(%[device]) \n\t" |
| 831 "lhu $t1, 2(%[device]) \n\t" |
| 832 "lhu $t2, 4(%[device]) \n\t" |
| 833 "lhu $t3, 6(%[device]) \n\t" |
| 834 "lbu $t4, 0(%[alpha]) \n\t" |
| 835 "lbu $t5, 1(%[alpha]) \n\t" |
| 836 "lbu $t6, 2(%[alpha]) \n\t" |
| 837 "lbu $t7, 3(%[alpha]) \n\t" |
| 838 "replv.ph $t0, $t0 \n\t" |
| 839 "replv.ph $t1, $t1 \n\t" |
| 840 "replv.ph $t2, $t2 \n\t" |
| 841 "replv.ph $t3, $t3 \n\t" |
| 842 "addiu %[s0], $t4, 1 \n\t" |
| 843 "addiu %[s1], $t5, 1 \n\t" |
| 844 "addiu %[s2], $t6, 1 \n\t" |
| 845 "addiu %[s3], $t7, 1 \n\t" |
| 846 "srl %[s0], %[s0], 3 \n\t" |
| 847 "srl %[s1], %[s1], 3 \n\t" |
| 848 "srl %[s2], %[s2], 3 \n\t" |
| 849 "srl %[s3], %[s3], 3 \n\t" |
| 850 "and $t0, $t0, $t9 \n\t" |
| 851 "and $t1, $t1, $t9 \n\t" |
| 852 "and $t2, $t2, $t9 \n\t" |
| 853 "and $t3, $t3, $t9 \n\t" |
| 854 "subu $t4, %[expanded32], $t0 \n\t" |
| 855 "subu $t5, %[expanded32], $t1 \n\t" |
| 856 "subu $t6, %[expanded32], $t2 \n\t" |
| 857 "subu $t7, %[expanded32], $t3 \n\t" |
| 858 "mul $t4, $t4, %[s0] \n\t" |
| 859 "mul $t5, $t5, %[s1] \n\t" |
| 860 "mul $t6, $t6, %[s2] \n\t" |
| 861 "mul $t7, $t7, %[s3] \n\t" |
| 862 "addiu %[alpha], %[alpha], 4 \n\t" |
| 863 "srl $t4, $t4, 5 \n\t" |
| 864 "srl $t5, $t5, 5 \n\t" |
| 865 "srl $t6, $t6, 5 \n\t" |
| 866 "srl $t7, $t7, 5 \n\t" |
| 867 "addu $t4, $t0, $t4 \n\t" |
| 868 "addu $t5, $t1, $t5 \n\t" |
| 869 "addu $t6, $t2, $t6 \n\t" |
| 870 "addu $t7, $t3, $t7 \n\t" |
| 871 "and $t4, $t4, $t9 \n\t" |
| 872 "and $t5, $t5, $t9 \n\t" |
| 873 "and $t6, $t6, $t9 \n\t" |
| 874 "and $t7, $t7, $t9 \n\t" |
| 875 "srl $t0, $t4, 16 \n\t" |
| 876 "srl $t1, $t5, 16 \n\t" |
| 877 "srl $t2, $t6, 16 \n\t" |
| 878 "srl $t3, $t7, 16 \n\t" |
| 879 "or %[s0], $t0, $t4 \n\t" |
| 880 "or %[s1], $t1, $t5 \n\t" |
| 881 "or %[s2], $t2, $t6 \n\t" |
| 882 "or %[s3], $t3, $t7 \n\t" |
| 883 "sh %[s0], 0(%[device]) \n\t" |
| 884 "sh %[s1], 2(%[device]) \n\t" |
| 885 "sh %[s2], 4(%[device]) \n\t" |
| 886 "sh %[s3], 6(%[device]) \n\t" |
| 887 "b 2b \n\t" |
| 888 " addiu %[device], %[device], 8 \n\t" |
| 889 "3: \n\t" |
| 890 "lhu $t0, 0(%[device]) \n\t" |
| 891 "lbu $t1, 0(%[alpha]) \n\t" |
| 892 "addiu $t8, $t8, -1 \n\t" |
| 893 "replv.ph $t2, $t0 \n\t" |
| 894 "and $t2, $t2, $t9 \n\t" |
| 895 "addiu $t0, $t1, 1 \n\t" |
| 896 "srl $t0, $t0, 3 \n\t" |
| 897 "subu $t3, %[expanded32], $t2 \n\t" |
| 898 "mul $t3, $t3, $t0 \n\t" |
| 899 "addiu %[alpha], %[alpha], 1 \n\t" |
| 900 "srl $t3, $t3, 5 \n\t" |
| 901 "addu $t3, $t2, $t3 \n\t" |
| 902 "and $t3, $t3, $t9 \n\t" |
| 903 "srl $t4, $t3, 16 \n\t" |
| 904 "or %[s0], $t4, $t3 \n\t" |
| 905 "sh %[s0], 0(%[device]) \n\t" |
| 906 "bnez $t8, 3b \n\t" |
| 907 "addiu %[device], %[device], 2 \n\t" |
| 908 "4: \n\t" |
| 909 "addu %[device], %[device], %[deviceRB] \n\t" |
| 910 "bgtz %[height], 1b \n\t" |
| 911 " addu %[alpha], %[alpha], %[maskRB] \n\t" |
| 912 ".set pop \n\t" |
| 913 : [height]"+r"(height), [alpha]"+r"(alpha), [device]"+r"(device), |
| 914 [deviceRB]"+r"(deviceRB), [maskRB]"+r"(maskRB), [s0]"=&r"(s0), |
| 915 [s1]"=&r"(s1), [s2]"=&r"(s2), [s3]"=&r"(s3) |
| 916 : [expanded32] "r" (expanded32), [width] "r" (width) |
| 917 : "memory", "hi", "lo", "t0", "t1", "t2", "t3", |
| 918 "t4", "t5", "t6", "t7", "t8", "t9" |
| 919 ); |
| 920 } |
| 921 |
811 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 922 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
812 | 923 |
813 const SkBlitRow::Proc platform_565_procs_mips_dsp[] = { | 924 const SkBlitRow::Proc platform_565_procs_mips_dsp[] = { |
814 // no dither | 925 // no dither |
815 NULL, | 926 NULL, |
816 S32_D565_Blend_mips_dsp, | 927 S32_D565_Blend_mips_dsp, |
817 S32A_D565_Opaque_mips_dsp, | 928 S32A_D565_Opaque_mips_dsp, |
818 S32A_D565_Blend_mips_dsp, | 929 S32A_D565_Blend_mips_dsp, |
819 | 930 |
820 // dither | 931 // dither |
(...skipping 18 matching lines...) Expand all Loading... |
839 return platform_32_procs_mips_dsp[flags]; | 950 return platform_32_procs_mips_dsp[flags]; |
840 } | 951 } |
841 | 952 |
842 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { | 953 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { |
843 return NULL; | 954 return NULL; |
844 } | 955 } |
845 | 956 |
846 SkBlitRow::ColorProc SkBlitRow::PlatformColorProc() { | 957 SkBlitRow::ColorProc SkBlitRow::PlatformColorProc() { |
847 return NULL; | 958 return NULL; |
848 } | 959 } |
OLD | NEW |