From patchwork Wed Jul 29 10:10:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiyou Yin X-Patchwork-Id: 21354 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id C22E044BD01 for ; Wed, 29 Jul 2020 13:11:17 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B05AF68BA2B; Wed, 29 Jul 2020 13:11:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EC91C68BA06 for ; Wed, 29 Jul 2020 13:11:07 +0300 (EEST) Received: from localhost (unknown [36.33.26.144]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxKMQ4SyFfKw0CAA--.1718S3; Wed, 29 Jul 2020 18:11:04 +0800 (CST) From: Shiyou Yin To: ffmpeg-devel@ffmpeg.org Date: Wed, 29 Jul 2020 18:10:58 +0800 Message-Id: <1596017461-9117-2-git-send-email-yinshiyou-hf@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1596017461-9117-1-git-send-email-yinshiyou-hf@loongson.cn> References: <1596017461-9117-1-git-send-email-yinshiyou-hf@loongson.cn> X-CM-TRANSID: AQAAf9DxKMQ4SyFfKw0CAA--.1718S3 X-Coremail-Antispam: 1UD129KBjvJXoWxAr4fuFyUGFyrWF1rGrW5GFg_yoW5KFW3pr WxGa17Ka1YgFsxuw1kCw1DCay5Gw4rZr97ury2gFW5twnxJr1UWFn3A345CF97WayUZF45 XrZ09r1DJan7Zr7anT9S1TB71UUUUj7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBIb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwV C2z280aVCY1x0267AKxVW0oVCq3wAaw2AFwI0_JF0_Jw1le2I262IYc4CY6c8Ij28IcVAa Y2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JF0_Jw1lYx0Ex4 A2jsIE14v26F4j6r4UJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7Cj xVAaw2AFwI0_JF0_Jw1lc2xSY4AK67AK6r4DMxAIw28IcxkI7VAKI48JMxC20s026xCaFV Cjc4AY6r1j6r4UMxCIbckI1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUJVWUXwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU5kfH7UUUUU== X-CM-SenderInfo: p1lq2x5l1r3gtki6z05rqj20fqof0/ Subject: [FFmpeg-devel] [PATCH 1/4] [mips]: Fix register constraint error reported by clang. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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. --- libavcodec/mips/aacdec_mips.c | 2 +- libavcodec/mips/aacsbr_mips.c | 2 +- libavcodec/mips/sbrdsp_mips.c | 19 ++++++++++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libavcodec/mips/aacdec_mips.c b/libavcodec/mips/aacdec_mips.c index 8e30652..7f24789 100644 --- a/libavcodec/mips/aacdec_mips.c +++ b/libavcodec/mips/aacdec_mips.c @@ -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; diff --git a/libavcodec/mips/aacsbr_mips.c b/libavcodec/mips/aacsbr_mips.c index 2e0cd72..5ef5e68 100644 --- a/libavcodec/mips/aacsbr_mips.c +++ b/libavcodec/mips/aacsbr_mips.c @@ -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) { diff --git a/libavcodec/mips/sbrdsp_mips.c b/libavcodec/mips/sbrdsp_mips.c index 83039fd..1c87c99 100644 --- a/libavcodec/mips/sbrdsp_mips.c +++ b/libavcodec/mips/sbrdsp_mips.c @@ -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"