Source: simde
Version: 0.8.2-2
Severity: wishlist
Tags: patch FTBFS
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the plink2 failed(depends simde arch=all) for loong64 in the Debian Package Auto-Building environment.
The error log is as follows,
```
../include/SFMT.c: In function ‘mm_recursion’:
/usr/include/simde/../simde/x86/sse2.h:1447:22: error: type mismatch in conditional expression  1447 |   (((imm8)<=0) ? (a) : (((imm8)>15) ? simde_mm_setzero_si128() : simde__m128i_from_lsx_i8((v16i8)__lsx_vbsrl_v(simde__m128i_to_private(a).lsx_i64, (imm8)))))
      |                      ^
```

Same as the above build error when compiling minimap2 source package.
I have submitted bug and patch for minimap2.
Please check https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1099518.

Instead of submitting modification patches (involving public code) for each source package (e.g. plink2, minimap2, fermi-lite, fasta3), we should modify the libsimde-dev dependency package. Please check the upstream PR: https://github.com/simd-everywhere/simde/pull/1287.

Please consider the patch I attached.
Based on attached patch, I built simde and installed libsimde-dev_0.8.2-2+loong64_all.deb. And then, plink2 and minimap2 were built successfully on my local ENV (The above two compilation errors of obs-studio have been resolved).
```
   dh_md5sums -O--sourcedirectory=build_dynamic/
   dh_builddeb -O--sourcedirectory=build_dynamic/
dpkg-deb: building package 'plink2-dbgsym' in '../plink2-dbgsym_2.00~a6.9-250129+dfsg-1_loong64.deb'. dpkg-deb: building package 'plink2' in '../plink2_2.00~a6.9-250129+dfsg-1_loong64.deb'.
 dpkg-genbuildinfo -O../plink2_2.00~a6.9-250129+dfsg-1_loong64.buildinfo
 dpkg-genchanges -O../plink2_2.00~a6.9-250129+dfsg-1_loong64.changes
......
```

Could you add attached patch(Or upstream pr https://github.com/simd-everywhere/simde/pull/1287) for simde in the next upload?
You opinions are welcome.

Best regards,
Dandan Zhang

Description: x86 sse2 for loongarch: fix GCC build failure 
 .
 simde (0.8.2-2+loong64) unstable; urgency=medium
 .
   * x86 sse2 for loongarch: fix GCC build failure.
     - Applied-Upstream: https://github.com/simd-everywhere/simde/pull/1287
Author: Dandan Zhang <zhangdan...@loongson.cn>

---
Applied-Upstream: master, https://github.com/simd-everywhere/simde/pull/1287
Signed-Off-By: Jin Bo
Last-Update: 2025-03-10

--- simde-0.8.2.orig/simde/x86/sse2.h
+++ simde-0.8.2/simde/x86/sse2.h
@@ -1346,7 +1346,7 @@ simde_mm_bslli_si128 (simde__m128i a, co
   #define simde_mm_bslli_si128(a, imm8) _mm_slli_si128(a, imm8)
 #elif defined(SIMDE_LOONGARCH_LSX_NATIVE)
   #define simde_mm_bslli_si128(a, imm8) \
-  (((imm8)<=0) ? (a) : (((imm8)>15) ? simde_mm_setzero_si128() : simde__m128i_from_lsx_i8((v16i8)__lsx_vbsll_v(simde__m128i_to_private(a).lsx_i64, (imm8)))))
+  (((imm8)<=0) ? (simde__m128i)(a) : (((imm8)>15) ? simde_mm_setzero_si128() : simde__m128i_from_lsx_i8((v16i8)__lsx_vbsll_v(simde__m128i_to_private(a).lsx_i64, (imm8)))))
 #elif defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(__clang__)
   #define simde_mm_bslli_si128(a, imm8) \
   simde__m128i_from_neon_i8(((imm8) <= 0) ? simde__m128i_to_neon_i8(a) : (((imm8) > 15) ? (vdupq_n_s8(0)) : (vextq_s8(vdupq_n_s8(0), simde__m128i_to_neon_i8(a), 16 - (imm8)))))
@@ -1444,7 +1444,7 @@ simde_mm_bsrli_si128 (simde__m128i a, co
   #define simde_mm_bsrli_si128(a, imm8) _mm_srli_si128(a, imm8)
 #elif defined(SIMDE_LOONGARCH_LSX_NATIVE)
   #define simde_mm_bsrli_si128(a, imm8) \
-  (((imm8)<=0) ? (a) : (((imm8)>15) ? simde_mm_setzero_si128() : simde__m128i_from_lsx_i8((v16i8)__lsx_vbsrl_v(simde__m128i_to_private(a).lsx_i64, (imm8)))))
+  (((imm8)<=0) ? (simde__m128i)(a) : (((imm8)>15) ? simde_mm_setzero_si128() : simde__m128i_from_lsx_i8((v16i8)__lsx_vbsrl_v(simde__m128i_to_private(a).lsx_i64, (imm8)))))
 #elif defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(__clang__)
   #define simde_mm_bsrli_si128(a, imm8) \
   simde__m128i_from_neon_i8(((imm8 < 0) || (imm8 > 15)) ? vdupq_n_s8(0) : (vextq_s8(simde__m128i_to_private(a).neon_i8, vdupq_n_s8(0), ((imm8 & 15) != 0) ? imm8 : (imm8 & 15))))

Reply via email to