Changeset 103316 in vbox for trunk/src/libs/libpng-1.6.42/mips
- Timestamp:
- Feb 12, 2024 3:57:56 PM (13 months ago)
- svn:sync-xref-src-repo-rev:
- 161613
- Location:
- trunk/src/libs/libpng-1.6.42/mips
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/libpng-1.6.42/mips/filter_msa_intrinsics.c
r96425 r103316 2 2 /* filter_msa_intrinsics.c - MSA optimised filter functions 3 3 * 4 * Copyright (c) 2018 Cosmin Truta4 * Copyright (c) 2018-2024 Cosmin Truta 5 5 * Copyright (c) 2016 Glenn Randers-Pehrson 6 * Written by Mandar Sahastrabuddhe, August 2016 .6 * Written by Mandar Sahastrabuddhe, August 2016 7 7 * 8 8 * This code is released under the libpng license. … … 12 12 13 13 #include <stdio.h> 14 #include <stdint.h>15 14 #include "../pngpriv.h" 16 15 … … 21 20 22 21 #include <msa.h> 22 #include <stdint.h> 23 23 24 24 /* libpng row pointers are not necessarily aligned to any particular boundary, … … 380 380 pp += 64; 381 381 382 383 382 ADD4(src0, src4, src1, src5, src2, src6, src3, src7, 383 src0, src1, src2, src3); 384 384 385 385 ST_UB4(src0, src1, src2, src3, rp, 16); … … 401 401 402 402 ADD4(src0, src4, src1, src5, src2, src6, src3, src7, 403 403 src0, src1, src2, src3); 404 404 405 405 ST_UB4(src0, src1, src2, src3, rp, 16); … … 426 426 LD_UB2(pp, 16, src4, src5); 427 427 428 428 ADD2(src0, src4, src1, src5, src0, src1); 429 429 430 430 ST_UB2(src0, src1, rp, 16); -
trunk/src/libs/libpng-1.6.42/mips/mips_init.c
r96425 r103316 2 2 /* mips_init.c - MSA optimised filter functions 3 3 * 4 * Copyright (c) 2018 Cosmin Truta4 * Copyright (c) 2018-2024 Cosmin Truta 5 5 * Copyright (c) 2016 Glenn Randers-Pehrson 6 * Written by Mandar Sahastrabuddhe, 2016. 6 * Written by Mandar Sahastrabuddhe, 2016 7 * Updated by guxiwei, 2023 7 8 * 8 9 * This code is released under the libpng license. … … 21 22 #ifdef PNG_READ_SUPPORTED 22 23 23 #if PNG_MIPS_MSA_OPT > 0 24 #ifdef PNG_MIPS_MSA_CHECK_SUPPORTED /* Do run-time checks */ 24 #if PNG_MIPS_MSA_IMPLEMENTATION == 1 || PNG_MIPS_MMI_IMPLEMENTATION > 0 25 26 #ifdef PNG_MIPS_MSA_CHECK_SUPPORTED /* Do MIPS MSA run-time checks */ 25 27 /* WARNING: it is strongly recommended that you do not build libpng with 26 28 * run-time checks for CPU features if at all possible. In the case of the MIPS … … 52 54 #endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */ 53 55 56 #ifdef PNG_MIPS_MMI_CHECK_SUPPORTED /* Do MIPS MMI run-times checks */ 57 #ifndef PNG_MIPS_MMI_FILE 58 # ifdef __linux__ 59 # define PNG_MIPS_MMI_FILE "contrib/mips-mmi/linux.c" 60 # endif 61 #endif 62 63 #ifdef PNG_MIPS_MMI_FILE 64 65 #include <signal.h> /* for sig_atomic_t */ 66 static int png_have_mmi(); 67 #include PNG_MIPS_MMI_FILE 68 69 #else /* PNG_MIPS_MMI_FILE */ 70 # error "PNG_MIPS_MMI_FILE undefined: no support for run-time MIPS MMI checks" 71 #endif /* PNG_MIPS_MMI_FILE */ 72 #endif /* PNG_MIPS_MMI_CHECK_SUPPORTED*/ 73 54 74 #ifndef PNG_ALIGNED_MEMORY_SUPPORTED 55 75 # error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED" 56 76 #endif 57 77 78 /* MIPS supports two optimizations: MMI and MSA. The appropriate 79 * optimization is chosen at runtime 80 */ 58 81 void 59 png_init_filter_functions_m sa(png_structp pp, unsigned int bpp)82 png_init_filter_functions_mips(png_structp pp, unsigned int bpp) 60 83 { 84 #if PNG_MIPS_MMI_IMPLEMENTATION > 0 85 #ifdef PNG_MIPS_MMI_API_SUPPORTED 86 switch ((pp->options >> PNG_MIPS_MMI) & 3) 87 { 88 case PNG_OPTION_UNSET: 89 #endif /* PNG_MIPS_MMI_API_SUPPORTED */ 90 #ifdef PNG_MIPS_MMI_CHECK_SUPPORTED 91 { 92 static volatile sig_atomic_t no_mmi = -1; /* not checked */ 93 94 if (no_mmi < 0) 95 no_mmi = !png_have_mmi(); 96 97 if (no_mmi) 98 goto MIPS_MSA_INIT; 99 } 100 #ifdef PNG_MIPS_MMI_API_SUPPORTED 101 break; 102 #endif 103 #endif /* PNG_MIPS_MMI_CHECK_SUPPORTED */ 104 105 #ifdef PNG_MIPS_MMI_API_SUPPORTED 106 default: /* OFF or INVALID */ 107 goto MIPS_MSA_INIT; 108 109 case PNG_OPTION_ON: 110 /* Option turned on */ 111 break; 112 } 113 #endif 114 pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_mmi; 115 if (bpp == 3) 116 { 117 pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_mmi; 118 pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_mmi; 119 pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = 120 png_read_filter_row_paeth3_mmi; 121 } 122 else if (bpp == 4) 123 { 124 pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_mmi; 125 pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_mmi; 126 pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = 127 png_read_filter_row_paeth4_mmi; 128 } 129 #endif /* PNG_MIPS_MMI_IMPLEMENTATION > 0 */ 130 131 MIPS_MSA_INIT: 132 #if PNG_MIPS_MSA_IMPLEMENTATION == 1 61 133 /* The switch statement is compiled in for MIPS_MSA_API, the call to 62 134 * png_have_msa is compiled in for MIPS_MSA_CHECK. If both are defined … … 126 198 pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_msa; 127 199 } 200 #endif /* PNG_MIPS_MSA_IMPLEMENTATION == 1 */ 201 return; 128 202 } 129 #endif /* PNG_MIPS_MSA_ OPT> 0 */203 #endif /* PNG_MIPS_MSA_IMPLEMENTATION == 1 || PNG_MIPS_MMI_IMPLEMENTATION > 0 */ 130 204 #endif /* READ */
Note:
See TracChangeset
for help on using the changeset viewer.