]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mips: Fix register constraint error reported by clang.
authorShiyou Yin <yinshiyou-hf@loongson.cn>
Wed, 29 Jul 2020 10:10:58 +0000 (18:10 +0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 29 Jul 2020 22:23:45 +0000 (00:23 +0200)
Clang report following error in aacsbr_mips.c,ac3dsp_mips.c and aacdec_mips.c:
"couldn't allocate output register for constraint 'r'"

Use 'f' constraint for float variable.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mips/aacdec_mips.c
libavcodec/mips/aacsbr_mips.c
libavcodec/mips/sbrdsp_mips.c

index 8e3065293510ad09fa6d9b6f9b53e9168d99899f..7f2478957f813881468b2182a48f393ab2f981c6 100644 (file)
@@ -340,7 +340,7 @@ static void update_ltp_mips(AACContext *ac, SingleChannelElement *sce)
     float *saved_ltp = sce->coeffs;
     const float *lwindow = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
     const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
-    float temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
+    uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
 
     if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
         float *p_saved_ltp = saved_ltp + 576;
index 2e0cd723d7e1573335a1bba9bd8b9b4a6051290c..5ef5e68371b4bc52e88557b8504809d7403fe765 100644 (file)
@@ -333,7 +333,7 @@ static void sbr_hf_assemble_mips(float Y1[38][64][2],
     int indexnoise = ch_data->f_indexnoise;
     int indexsine  = ch_data->f_indexsine;
     float *g_temp1, *q_temp1, *pok, *pok1;
-    float temp1, temp2, temp3, temp4;
+    uint32_t temp1, temp2, temp3, temp4;
     int size = m_max;
 
     if (sbr->reset) {
index 83039fd802aae05692e3ee6905f792724cb0ca70..1c87c992510ecbf599740777393ecaa45407102b 100644 (file)
@@ -796,9 +796,9 @@ static void sbr_hf_apply_noise_2_mips(float (*Y)[2], const float *s_m,
                                  const float *q_filt, int noise,
                                  int kx, int m_max)
 {
-    int m;
+    int m, temp0, temp1;
     float *ff_table;
-    float y0,y1, temp0, temp1, temp2, temp3, temp4, temp5;
+    float y0, y1, temp2, temp3, temp4, temp5;
 
     for (m = 0; m < m_max; m++) {
 
@@ -808,14 +808,14 @@ static void sbr_hf_apply_noise_2_mips(float (*Y)[2], const float *s_m,
 
         __asm__ volatile(
             "lwc1   %[y0],       0(%[Y1])                                  \n\t"
-            "lwc1   %[temp1],    0(%[s_m1])                                \n\t"
+            "lwc1   %[temp3],    0(%[s_m1])                                \n\t"
             "addiu  %[noise],    %[noise],              1                  \n\t"
             "andi   %[noise],    %[noise],              0x1ff              \n\t"
             "sll    %[temp0],    %[noise],              3                  \n\t"
             PTR_ADDU "%[ff_table],%[ff_sbr_noise_table],%[temp0]           \n\t"
-            "sub.s  %[y0],       %[y0],                 %[temp1]           \n\t"
-            "mfc1   %[temp3],    %[temp1]                                  \n\t"
-            "bne    %[temp3],    $0,                    1f                 \n\t"
+            "sub.s  %[y0],       %[y0],                 %[temp3]           \n\t"
+            "mfc1   %[temp1],    %[temp3]                                  \n\t"
+            "bne    %[temp1],    $0,                    1f                 \n\t"
             "lwc1   %[y1],       4(%[Y1])                                  \n\t"
             "lwc1   %[temp2],    0(%[q_filt1])                             \n\t"
             "lwc1   %[temp4],    0(%[ff_table])                            \n\t"
@@ -826,9 +826,10 @@ static void sbr_hf_apply_noise_2_mips(float (*Y)[2], const float *s_m,
         "1:                                                                \n\t"
             "swc1   %[y0],       0(%[Y1])                                  \n\t"
 
-            : [temp0]"=&r"(temp0), [ff_table]"=&r"(ff_table), [y0]"=&f"(y0),
-              [y1]"=&f"(y1), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
-              [temp3]"=&r"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5)
+            : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [y0]"=&f"(y0),
+              [y1]"=&f"(y1), [ff_table]"=&r"(ff_table),
+              [temp2]"=&f"(temp2), [temp3]"=&f"(temp3),
+              [temp4]"=&f"(temp4), [temp5]"=&f"(temp5)
             : [ff_sbr_noise_table]"r"(ff_sbr_noise_table), [noise]"r"(noise),
               [Y1]"r"(Y1), [s_m1]"r"(s_m1), [q_filt1]"r"(q_filt1)
             : "memory"