]> granicus.if.org Git - libjpeg-turbo/commitdiff
Fix MIPS DSPr2 build when using soft float ABI
authorDRC <information@libjpeg-turbo.org>
Tue, 4 Sep 2018 22:33:12 +0000 (17:33 -0500)
committerDRC <information@libjpeg-turbo.org>
Tue, 4 Sep 2018 23:03:00 +0000 (18:03 -0500)
(for instance, when passing -msoft-float to the compiler)

The instructions used by jsimd_quantize_float_dspr2() and
jsimd_convsamp_float_dspr2() don't work with the soft float ABI, so
disable those functions when soft float is enabled.

Based on:
https://github.com/libjpeg-turbo/libjpeg-turbo/pull/272/commits/129a739bfabe1568d078eb2719691a76db128185

Closes #272

ChangeLog.md
simd/mips/jsimd.c
simd/mips/jsimd_dspr2.S

index d3bb53f141f5e6d688c801609adfe7c447ac508f..3d998018b0c2ad1ec16bd187b140f67907293edc 100644 (file)
@@ -9,6 +9,11 @@ whereby jconfig.h could cause compiler warnings of the form
 projects that used `AC_CHECK_HEADERS()` to check for the existence of locale.h,
 stddef.h, or stdlib.h.
 
+2. The `jsimd_quantize_float_dspr2()` and `jsimd_convsamp_float_dspr2()`
+functions in the MIPS DSPr2 SIMD extensions are now disabled at compile time
+if the soft float ABI is enabled.  Those functions use instructions that are
+incompatible with the soft float ABI.
+
 
 2.0.0
 =====
index af886f60b6a5892252bf485bce9af4584e3f9c96..454cc99c6f20409fec4155e62edaacf6e5851822 100644 (file)
@@ -692,8 +692,10 @@ jsimd_can_convsamp_float(void)
   if (sizeof(ISLOW_MULT_TYPE) != 2)
     return 0;
 
+#ifndef __mips_soft_float
   if (simd_support & JSIMD_DSPR2)
     return 1;
+#endif
 
   return 0;
 }
@@ -709,7 +711,9 @@ GLOBAL(void)
 jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
                      FAST_FLOAT *workspace)
 {
+#ifndef __mips_soft_float
   jsimd_convsamp_float_dspr2(sample_data, start_col, workspace);
+#endif
 }
 
 GLOBAL(int)
@@ -805,8 +809,10 @@ jsimd_can_quantize_float(void)
   if (sizeof(ISLOW_MULT_TYPE) != 2)
     return 0;
 
+#ifndef __mips_soft_float
   if (simd_support & JSIMD_DSPR2)
     return 1;
+#endif
 
   return 0;
 }
@@ -821,7 +827,9 @@ GLOBAL(void)
 jsimd_quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
                      FAST_FLOAT *workspace)
 {
+#ifndef __mips_soft_float
   jsimd_quantize_float_dspr2(coef_block, divisors, workspace);
+#endif
 }
 
 GLOBAL(int)
index 2ec543e28ffd7cdba9319bdcb44aa6e42af77b1d..a28c11618c94d8dff88561c0eb374587c5ba0bd2 100644 (file)
@@ -2810,6 +2810,8 @@ LEAF_DSPR2(jsimd_quantize_dspr2)
 END(jsimd_quantize_dspr2)
 
 
+#ifndef __mips_soft_float
+
 /*****************************************************************************/
 LEAF_DSPR2(jsimd_quantize_float_dspr2)
 /*
@@ -2890,6 +2892,8 @@ LEAF_DSPR2(jsimd_quantize_float_dspr2)
 
 END(jsimd_quantize_float_dspr2)
 
+#endif
+
 
 /*****************************************************************************/
 LEAF_DSPR2(jsimd_idct_2x2_dspr2)
@@ -4110,6 +4114,8 @@ LEAF_DSPR2(jsimd_convsamp_dspr2)
 END(jsimd_convsamp_dspr2)
 
 
+#ifndef __mips_soft_float
+
 /*****************************************************************************/
 LEAF_DSPR2(jsimd_convsamp_float_dspr2)
 /*
@@ -4468,4 +4474,6 @@ LEAF_DSPR2(jsimd_convsamp_float_dspr2)
 
 END(jsimd_convsamp_float_dspr2)
 
+#endif
+
 /*****************************************************************************/