@@ -23,13 +23,14 @@ jobs:
2323 optimization : " debug"
2424 assert : " debug"
2525 coverage : " nocov"
26+ detectcpuflags : " ignore"
2627 boost : " --build-boost"
2728 icu : " "
2829 llvm : " "
2930 secp256k1 : " --build-secp256k1"
3031 cc : " clang-16"
3132 flags : " -Og -fPIE"
32- options : " --enable-isystem --enable-avx2 --enable-sse4 "
33+ options : " --enable-isystem --enable-avx2 --enable-sse41 "
3334 packager : " apt"
3435 packages : " "
3536
3940 optimization : " size"
4041 assert : " ndebug"
4142 coverage : " nocov"
43+ detectcpuflags : " ignore"
4244 boost : " --build-boost"
4345 icu : " --build-icu --with-icu"
4446 llvm : " "
@@ -55,27 +57,29 @@ jobs:
5557 optimization : " size"
5658 assert : " ndebug"
5759 coverage : " nocov"
60+ detectcpuflags : " ignore"
5861 boost : " --build-boost"
5962 icu : " "
6063 llvm : " "
6164 secp256k1 : " --build-secp256k1"
6265 cc : " gcc-12"
6366 flags : " -Os -fPIE"
64- options : " --enable-isystem --enable-sse4 "
67+ options : " --enable-isystem --enable-sse41 "
6568 packager : " apt"
6669 packages : " "
6770
6871 - os : ubuntu-24.04
69- cxx : " g++-12 "
72+ cxx : " g++"
7073 link : " static"
7174 optimization : " size"
7275 assert : " ndebug"
7376 coverage : " cov"
77+ detectcpuflags : " detect"
7478 boost : " --build-boost"
7579 icu : " --build-icu --with-icu"
7680 llvm : " "
7781 secp256k1 : " --build-secp256k1"
78- cc : " gcc-12 "
82+ cc : " gcc"
7983 flags : " -Os -g --coverage -fPIE"
8084 options : " --enable-isystem"
8185 packager : " apt"
8791 optimization : " size"
8892 assert : " ndebug"
8993 coverage : " nocov"
94+ detectcpuflags : " ignore"
9095 boost : " --build-boost"
9196 icu : " "
9297 llvm : " llvm@16"
@@ -103,6 +108,7 @@ jobs:
103108 optimization : " size"
104109 assert : " ndebug"
105110 coverage : " nocov"
111+ detectcpuflags : " ignore"
106112 boost : " --build-boost"
107113 icu : " "
108114 llvm : " llvm@16"
@@ -145,6 +151,29 @@ jobs:
145151 echo "PATH=/opt/homebrew/opt/${{ matrix.llvm }}/bin:$PATH" >> $GITHUB_ENV
146152 fi
147153
154+ - name : Determine CPU flags
155+ shell : bash
156+ run : |
157+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " sse4_1 ") ]]; then
158+ echo "CPU_SUPPORT_SSE41=--enable-sse41" >> $GITHUB_ENV
159+ fi
160+
161+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " avx " | grep " avx2 ") ]]; then
162+ echo "CPU_SUPPORT_AVX2=--enable-avx2" >> $GITHUB_ENV
163+ fi
164+
165+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " avx512bw ") ]]; then
166+ echo "CPU_SUPPORT_AVX512=--enable-avx512" >> $GITHUB_ENV
167+ fi
168+
169+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " sha_ni ") ]]; then
170+ echo "CPU_SUPPORT_SHANI=--enable-shani" >> $GITHUB_ENV
171+ fi
172+
173+ if [[ ${{ matrix.detectcpuflags }} == 'detect' ]]; then
174+ echo "CPU_SUPPORTED_FLAGS='$CPU_SUPPORT_SSE41 $CPU_SUPPORT_AVX2 $CPU_SUPPORT_AVX512 $CPU_SUPPORT_SHANI'" >> $GITHUB_ENV
175+ fi
176+
148177 - name : Denormalize parameterization
149178 shell : bash
150179 run : |
@@ -183,16 +212,17 @@ jobs:
183212 --prefix=${{ env.LIBBITCOIN_SRC_PATH }}prefix
184213 ${{ env.LINKAGE }}
185214 ${{ env.ASSERT_NDEBUG }}
215+ ${{ env.CPU_SUPPORTED_FLAGS }}
186216 ${{ matrix.boost }}
187217 ${{ matrix.icu }}
188218 ${{ matrix.secp256k1 }}
189219
190220 - name : Coveralls Calculation
191221 if : ${{ matrix.coverage == 'cov' }}
192222 run : |
193- lcov --directory . --capture --ignore-errors version --output-file coverage.info
194- lcov --remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/src/wallet/addresses/qrencode/*" --output-file --ignore-errors version coverage.info
195- lcov --list --ignore-errors version coverage.info
223+ lcov --ignore-errors version,gcov,mismatch --directory . --capture --output-file coverage.info
224+ lcov --ignore-errors unused -- remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/src/wallet/addresses/qrencode/*" --output-file coverage.info
225+ lcov --list coverage.info
196226
197227 - name : Coveralls.io Upload
198228 if : ${{ matrix.coverage == 'cov' }}
@@ -264,13 +294,14 @@ jobs:
264294 optimization : " debug"
265295 assert : " debug"
266296 coverage : " nocov"
297+ detectcpuflags : " ignore"
267298 boost : " --build-boost"
268299 icu : " "
269300 llvm : " "
270301 secp256k1 : " --build-secp256k1"
271302 cc : " clang-16"
272303 flags : " -Og -fPIE"
273- options : " -Denable-avx2=on -Denable-sse4 =on"
304+ options : " -Denable-avx2=on -Denable-sse41 =on"
274305 packager : " apt"
275306 packages : " "
276307
@@ -280,6 +311,7 @@ jobs:
280311 optimization : " size"
281312 assert : " ndebug"
282313 coverage : " nocov"
314+ detectcpuflags : " ignore"
283315 boost : " --build-boost"
284316 icu : " --build-icu --with-icu"
285317 llvm : " "
@@ -296,13 +328,14 @@ jobs:
296328 optimization : " size"
297329 assert : " ndebug"
298330 coverage : " nocov"
331+ detectcpuflags : " ignore"
299332 boost : " --build-boost"
300333 icu : " "
301334 llvm : " "
302335 secp256k1 : " --build-secp256k1"
303336 cc : " gcc-12"
304337 flags : " -Os -fPIE"
305- options : " -Denable-sse4 =on"
338+ options : " -Denable-sse41 =on"
306339 packager : " apt"
307340 packages : " "
308341
@@ -312,6 +345,7 @@ jobs:
312345 optimization : " size"
313346 assert : " ndebug"
314347 coverage : " nocov"
348+ detectcpuflags : " ignore"
315349 boost : " --build-boost"
316350 icu : " --build-icu --with-icu"
317351 llvm : " "
@@ -328,6 +362,7 @@ jobs:
328362 optimization : " size"
329363 assert : " ndebug"
330364 coverage : " nocov"
365+ detectcpuflags : " ignore"
331366 boost : " --build-boost"
332367 icu : " "
333368 llvm : " llvm@16"
@@ -344,6 +379,7 @@ jobs:
344379 optimization : " size"
345380 assert : " ndebug"
346381 coverage : " nocov"
382+ detectcpuflags : " ignore"
347383 boost : " --build-boost"
348384 icu : " "
349385 llvm : " llvm@16"
@@ -386,6 +422,29 @@ jobs:
386422 echo "PATH=/opt/homebrew/opt/${{ matrix.llvm }}/bin:$PATH" >> $GITHUB_ENV
387423 fi
388424
425+ - name : Determine CPU flags
426+ shell : bash
427+ run : |
428+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " sse4_1 ") ]]; then
429+ echo "CPU_SUPPORT_SSE41=-Denable-sse41=on" >> $GITHUB_ENV
430+ fi
431+
432+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " avx " | grep " avx2 ") ]]; then
433+ echo "CPU_SUPPORT_AVX2=-Denable-avx2=on" >> $GITHUB_ENV
434+ fi
435+
436+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " avx512bw ") ]]; then
437+ echo "CPU_SUPPORT_AVX512=-Denable-avx512=on" >> $GITHUB_ENV
438+ fi
439+
440+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " sha_ni ") ]]; then
441+ echo "CPU_SUPPORT_SHANI=-Denable-shani=on" >> $GITHUB_ENV
442+ fi
443+
444+ if [[ ${{ matrix.detectcpuflags }} == 'detect' ]]; then
445+ echo "CPU_SUPPORTED_FLAGS='$CPU_SUPPORT_SSE41 $CPU_SUPPORT_AVX2 $CPU_SUPPORT_AVX512 $CPU_SUPPORT_SHANI'" >> $GITHUB_ENV
446+ fi
447+
389448 - name : Denormalize parameterization
390449 shell : bash
391450 run : |
@@ -427,16 +486,17 @@ jobs:
427486 --prefix=${{ env.LIBBITCOIN_SRC_PATH }}prefix
428487 ${{ env.LINKAGE }}
429488 ${{ env.ASSERT_NDEBUG }}
489+ ${{ env.CPU_SUPPORTED_FLAGS }}
430490 ${{ matrix.boost }}
431491 ${{ matrix.icu }}
432492 ${{ matrix.secp256k1 }}
433493
434494 - name : Coveralls Calculation
435495 if : ${{ matrix.coverage == 'cov' }}
436496 run : |
437- lcov --directory . --capture --ignore-errors version --output-file coverage.info
438- lcov --remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/src/wallet/addresses/qrencode/*" --output-file --ignore-errors version coverage.info
439- lcov --list --ignore-errors version coverage.info
497+ lcov --ignore-errors version,gcov,mismatch --directory . --capture --output-file coverage.info
498+ lcov --ignore-errors unused -- remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/src/wallet/addresses/qrencode/*" --output-file coverage.info
499+ lcov --list coverage.info
440500
441501 - name : Coveralls.io Upload
442502 if : ${{ matrix.coverage == 'cov' }}
@@ -519,13 +579,14 @@ jobs:
519579 optimization : " debug"
520580 assert : " debug"
521581 coverage : " nocov"
582+ detectcpuflags : " ignore"
522583 boost : " --build-boost"
523584 icu : " "
524585 llvm : " "
525586 secp256k1 : " --build-secp256k1"
526587 cc : " clang-16"
527588 flags : " -Og -fPIE"
528- options : " -Denable-avx2=on -Denable-sse4 =on"
589+ options : " -Denable-avx2=on -Denable-sse41 =on"
529590 packager : " apt"
530591 packages : " "
531592
@@ -536,6 +597,7 @@ jobs:
536597 optimization : " size"
537598 assert : " ndebug"
538599 coverage : " nocov"
600+ detectcpuflags : " ignore"
539601 boost : " --build-boost"
540602 icu : " --build-icu --with-icu"
541603 llvm : " "
@@ -553,13 +615,14 @@ jobs:
553615 optimization : " size"
554616 assert : " ndebug"
555617 coverage : " nocov"
618+ detectcpuflags : " ignore"
556619 boost : " --build-boost"
557620 icu : " "
558621 llvm : " "
559622 secp256k1 : " --build-secp256k1"
560623 cc : " gcc-12"
561624 flags : " -Os -fPIE"
562- options : " -Denable-sse4 =on"
625+ options : " -Denable-sse41 =on"
563626 packager : " apt"
564627 packages : " "
565628
@@ -595,6 +658,29 @@ jobs:
595658 echo "PATH=/opt/homebrew/opt/${{ matrix.llvm }}/bin:$PATH" >> $GITHUB_ENV
596659 fi
597660
661+ - name : Determine CPU flags
662+ shell : bash
663+ run : |
664+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " sse4_1 ") ]]; then
665+ echo "CPU_SUPPORT_SSE41=-Denable-sse41=on" >> $GITHUB_ENV
666+ fi
667+
668+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " avx " | grep " avx2 ") ]]; then
669+ echo "CPU_SUPPORT_AVX2=-Denable-avx2=on" >> $GITHUB_ENV
670+ fi
671+
672+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " avx512bw ") ]]; then
673+ echo "CPU_SUPPORT_AVX512=-Denable-avx512=on" >> $GITHUB_ENV
674+ fi
675+
676+ if [[ -n $(cat /proc/cpuinfo | grep flags | grep " sha_ni ") ]]; then
677+ echo "CPU_SUPPORT_SHANI=-Denable-shani=on" >> $GITHUB_ENV
678+ fi
679+
680+ if [[ ${{ matrix.detectcpuflags }} == 'detect' ]]; then
681+ echo "CPU_SUPPORTED_FLAGS='$CPU_SUPPORT_SSE41 $CPU_SUPPORT_AVX2 $CPU_SUPPORT_AVX512 $CPU_SUPPORT_SHANI'" >> $GITHUB_ENV
682+ fi
683+
598684 - name : Denormalize parameterization
599685 shell : bash
600686 run : |
@@ -637,16 +723,17 @@ jobs:
637723 --preset=${{ matrix.preset }}
638724 ${{ env.LINKAGE }}
639725 ${{ env.ASSERT_NDEBUG }}
726+ ${{ env.CPU_SUPPORTED_FLAGS }}
640727 ${{ matrix.boost }}
641728 ${{ matrix.icu }}
642729 ${{ matrix.secp256k1 }}
643730
644731 - name : Coveralls Calculation
645732 if : ${{ matrix.coverage == 'cov' }}
646733 run : |
647- lcov --directory . --capture --ignore-errors version --output-file coverage.info
648- lcov --remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/src/wallet/addresses/qrencode/*" --output-file --ignore-errors version coverage.info
649- lcov --list --ignore-errors version coverage.info
734+ lcov --ignore-errors version,gcov,mismatch --directory . --capture --output-file coverage.info
735+ lcov --ignore-errors unused -- remove coverage.info "/usr/*" "${{ env.LIBBITCOIN_SRC_PATH }}prefix/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" "${{ github.workspace }}/src/wallet/addresses/qrencode/*" --output-file coverage.info
736+ lcov --list coverage.info
650737
651738 - name : Coveralls.io Upload
652739 if : ${{ matrix.coverage == 'cov' }}
0 commit comments