From 37156a4719a4734a3529d400c25c6622390ef2b1 Mon Sep 17 00:00:00 2001 From: Yuantao Feng Date: Fri, 26 Jan 2024 18:38:00 +0800 Subject: [PATCH] Merge pull request #24925 from fengyuentau:loongarch_handle_warnings Handle warnings in loongson-related code #24925 See https://github.com/fengyuentau/opencv/actions/runs/7665377694/job/20891162958#step:14:16 Warnings needs to be handled before we add the loongson server to our CI. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake --- modules/core/include/opencv2/core/hal/intrin_lsx.hpp | 2 ++ modules/dnn/src/layers/cpu_kernels/fast_gemm_kernels.simd.hpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/core/include/opencv2/core/hal/intrin_lsx.hpp b/modules/core/include/opencv2/core/hal/intrin_lsx.hpp index 4e3d2319ad..ef83a2e466 100644 --- a/modules/core/include/opencv2/core/hal/intrin_lsx.hpp +++ b/modules/core/include/opencv2/core/hal/intrin_lsx.hpp @@ -860,6 +860,7 @@ class v_lsx_palignr_u8_class public: inline __m128i operator()(const __m128i& a, const __m128i& b) const { + CV_UNUSED(b); return a; } }; @@ -880,6 +881,7 @@ class v_lsx_palignr_u8_class public: inline __m128i operator()(const __m128i& a, const __m128i& b) const { + CV_UNUSED(a); return b; } }; diff --git a/modules/dnn/src/layers/cpu_kernels/fast_gemm_kernels.simd.hpp b/modules/dnn/src/layers/cpu_kernels/fast_gemm_kernels.simd.hpp index 8e63d15137..39bf6800d7 100644 --- a/modules/dnn/src/layers/cpu_kernels/fast_gemm_kernels.simd.hpp +++ b/modules/dnn/src/layers/cpu_kernels/fast_gemm_kernels.simd.hpp @@ -313,8 +313,7 @@ static inline void fast_gemm12x16_f32(int k, const char *a_, const char *b_, cha const float* b = (const float*)b_; float* c = (float*)c_; - __m256i dummy; - __m256 s00 = (__m256)__lasx_xvxor_v(dummy, dummy), s01 = s00, + __m256 s00 = _v256_setall_ps(0), s01 = s00, s10 = s00, s11 = s00, s20 = s00, s21 = s00, s30 = s00, s31 = s00,