Skip to content

Commit 2b041a1

Browse files
authored
Merge pull request #783 from cppalliance/develop
Merge to master for 3.0.0
2 parents 3df80be + 648609c commit 2b041a1

File tree

121 files changed

+3174
-2311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+3174
-2311
lines changed

.drone.jsonnet

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,16 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
202202
),
203203

204204
linux_pipeline(
205-
"Linux 24.04 GCC 13 GNU 32/64",
205+
"Linux 24.04 GCC 13 GNU 32",
206206
"cppalliance/droneubuntu2404:1",
207-
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,23', ADDRMD: '32,64', CXXFLAGS: "-fexcess-precision=fast", CXXSTDDIALECT: "gnu" },
207+
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,23', ADDRMD: '32', CXXFLAGS: "-fexcess-precision=fast", CXXSTDDIALECT: "gnu" },
208+
"g++-13-multilib",
209+
),
210+
211+
linux_pipeline(
212+
"Linux 24.04 GCC 13 GNU 64",
213+
"cppalliance/droneubuntu2404:1",
214+
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,23', ADDRMD: '64', CXXFLAGS: "-fexcess-precision=fast", CXXSTDDIALECT: "gnu" },
208215
"g++-13-multilib",
209216
),
210217

.github/workflows/ci.yml

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -226,32 +226,44 @@ jobs:
226226
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
227227
source_keys:
228228
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
229-
- name: UBSAN
230-
toolset: clang
231-
compiler: clang++-14
229+
- toolset: clang
230+
compiler: clang++-18
232231
cxxstd: "03,11,14,17,20,2b"
233-
cxxflags: -stdlib=libc++
234-
linkflags: -stdlib=libc++
235-
ubsan: 1
236-
os: ubuntu-22.04
232+
os: ubuntu-24.04
237233
install:
238-
- clang-14
239-
- libc++-14-dev
240-
- libc++abi-14-dev
241-
234+
- clang-18
235+
sources:
236+
- "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main"
237+
source_keys:
238+
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
242239
- toolset: clang
240+
compiler: clang++-19
243241
cxxstd: "03,11,14,17,20,2b"
244-
os: macos-12
242+
os: ubuntu-24.04
243+
install:
244+
- clang-19
245+
sources:
246+
- "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main"
247+
source_keys:
248+
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
249+
245250
- toolset: clang
246251
cxxstd: "03,11,14,17,20,2b"
247252
os: macos-13
248253
- toolset: clang
249254
cxxstd: "03,11,14,17,20,2b"
250255
os: macos-14
256+
- toolset: clang
257+
cxxstd: "03,11,14,17,20,2b"
258+
os: macos-15
251259

252260
timeout-minutes: 180
253261
runs-on: ${{matrix.os}}
254-
container: ${{matrix.container}}
262+
container:
263+
image: ${{matrix.container}}
264+
volumes:
265+
- /node20217:/node20217:rw,rshared
266+
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
255267

256268
steps:
257269
- name: Setup environment
@@ -275,9 +287,13 @@ jobs:
275287
fi
276288
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake
277289
fi
290+
if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
291+
# Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
292+
curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217
293+
fi
278294
fi
279295
git config --global pack.threads 0
280-
- uses: actions/checkout@v3
296+
- uses: actions/checkout@v4
281297

282298
- name: Install packages
283299
if: matrix.install
@@ -459,28 +475,26 @@ jobs:
459475
cxxstd: "14,17,20,latest"
460476
addrmd: "32"
461477
os: windows-2019
462-
# B2 does not work with MSVC 17.10. Once it's updated we can re-enable these tests
463-
# Still covered in drone
464-
#- toolset: msvc-14.3
465-
# cxxstd: "14,17,20,latest"
466-
# addrmd: "32"
467-
# os: windows-2022
478+
- toolset: msvc-14.3
479+
cxxstd: "14,17,20,latest"
480+
addrmd: "32"
481+
os: windows-2022
468482
- toolset: msvc-14.2
469483
cxxstd: "14,17,20,latest"
470484
addrmd: "64"
471485
os: windows-2019
472-
#- toolset: msvc-14.3
473-
# cxxstd: "14,17,20,latest"
474-
# addrmd: "64"
475-
# os: windows-2022
476-
#- toolset: clang-win
477-
# cxxstd: "14,17,latest"
478-
# addrmd: "32"
479-
# os: windows-2022
480-
#- toolset: clang-win
481-
# cxxstd: "14,17,latest"
482-
# addrmd: "64"
483-
# os: windows-2022
486+
- toolset: msvc-14.3
487+
cxxstd: "14,17,20,latest"
488+
addrmd: "64"
489+
os: windows-2022
490+
- toolset: clang-win
491+
cxxstd: "14,17,latest"
492+
addrmd: "32"
493+
os: windows-2022
494+
- toolset: clang-win
495+
cxxstd: "14,17,latest"
496+
addrmd: "64"
497+
os: windows-2022
484498
- toolset: gcc
485499
cxxstd: "03,11,14,17,2a"
486500
addrmd: "64"
@@ -489,7 +503,7 @@ jobs:
489503
runs-on: ${{matrix.os}}
490504

491505
steps:
492-
- uses: actions/checkout@v3
506+
- uses: actions/checkout@v4
493507

494508
- name: Setup Boost
495509
shell: cmd
@@ -526,18 +540,18 @@ jobs:
526540
include:
527541
- os: ubuntu-20.04
528542
- os: ubuntu-22.04
529-
- os: macos-12
530543
- os: macos-13
531544
- os: macos-14
545+
- os: macos-15
532546

533547
runs-on: ${{matrix.os}}
534548

535549
steps:
536-
- uses: actions/checkout@v3
550+
- uses: actions/checkout@v4
537551

538552
- name: Install packages
539553
if: matrix.install
540-
run: sudo apt install ${{matrix.install}}
554+
run: sudo apt-get -y install ${{matrix.install}}
541555

542556
- name: Setup Boost
543557
run: |
@@ -575,14 +589,14 @@ jobs:
575589
include:
576590
- os: ubuntu-20.04
577591
- os: ubuntu-22.04
578-
- os: macos-12
579592
- os: macos-13
580593
- os: macos-14
594+
- os: macos-15
581595

582596
runs-on: ${{matrix.os}}
583597

584598
steps:
585-
- uses: actions/checkout@v3
599+
- uses: actions/checkout@v4
586600

587601
- name: Install packages
588602
if: matrix.install
@@ -634,14 +648,14 @@ jobs:
634648
include:
635649
- os: ubuntu-20.04
636650
- os: ubuntu-22.04
637-
- os: macos-12
638651
- os: macos-13
639652
- os: macos-14
653+
- os: macos-15
640654

641655
runs-on: ${{matrix.os}}
642656

643657
steps:
644-
- uses: actions/checkout@v3
658+
- uses: actions/checkout@v4
645659

646660
- name: Install packages
647661
if: matrix.install
@@ -698,7 +712,7 @@ jobs:
698712
runs-on: windows-latest
699713

700714
steps:
701-
- uses: actions/checkout@v3
715+
- uses: actions/checkout@v4
702716

703717
- name: Setup MSYS2 environment
704718
uses: msys2/setup-msys2@v2
@@ -709,7 +723,7 @@ jobs:
709723
pacboy: gcc:p cmake:p ninja:p
710724

711725
- name: Fetch Boost.CI
712-
uses: actions/checkout@v3
726+
uses: actions/checkout@v4
713727
with:
714728
repository: boostorg/boost-ci
715729
ref: master
@@ -737,7 +751,7 @@ jobs:
737751
fail-fast: false
738752
matrix:
739753
compiler: [ intel ]
740-
standard: [ c++20 ]
754+
standard: [ 14, 17, 20, 23 ]
741755
steps:
742756
- uses: actions/checkout@v4
743757
with:
@@ -785,7 +799,12 @@ jobs:
785799
run: |
786800
cd ../boost-root
787801
mkdir __build__ && cd __build__
788-
cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..
802+
cmake -DCMAKE_C_COMPILER=icx \
803+
-DCMAKE_CXX_COMPILER=icpx \
804+
-DCMAKE_CXX_STANDARD=${{ matrix.standard }} \
805+
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
806+
-DBOOST_INCLUDE_LIBRARIES=$LIBRARY \
807+
-DBUILD_TESTING=ON ..
789808
790809
- name: Build tests
791810
run: |

.github/workflows/fuzz.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,26 @@ jobs:
8686
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
8787
source_keys:
8888
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
89+
- toolset: clang
90+
compiler: clang++-18
91+
cxxstd: "14,17,20,23"
92+
os: ubuntu-24.04
93+
install:
94+
- clang-18
95+
sources:
96+
- "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main"
97+
source_keys:
98+
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
99+
- toolset: clang
100+
compiler: clang++-19
101+
cxxstd: "14,17,20,23"
102+
os: ubuntu-24.04
103+
install:
104+
- clang-19
105+
sources:
106+
- "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main"
107+
source_keys:
108+
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
89109

90110

91111
timeout-minutes: 60

.github/workflows/metal.yml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------
2-
# Copyright Matt Borland 2023.
3-
# Copyright Christopher Kormanyos 2023.
2+
# Copyright Matt Borland 2023 - 2024.
3+
# Copyright Christopher Kormanyos 2023 - 2024.
44
# Distributed under the Boost Software License,
55
# Version 1.0. (See accompanying file LICENSE_1_0.txt
66
# or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -27,28 +27,44 @@ jobs:
2727
fetch-depth: '0'
2828
- name: update-tools
2929
run: |
30-
sudo apt install libncurses5 libpython2.7
30+
sudo apt update
31+
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
32+
sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
33+
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncursesw5_6.3-2ubuntu0.1_amd64.deb
34+
sudo apt install ./libncursesw5_6.3-2ubuntu0.1_amd64.deb
3135
mkdir -p emu_env && cd emu_env
32-
wget --no-check-certificate https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
33-
tar -xf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
34-
wget --no-check-certificate https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v7.1.0-1/xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz
35-
tar -xzf xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz
36+
wget --no-check-certificate https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
37+
tar -xf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
38+
wget --no-check-certificate https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v8.2.6-1/xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz
39+
tar -xzf xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz
3640
working-directory: ./test/metal/
3741
- name: build benchmark_single-stm32f429
3842
run: |
43+
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
44+
echo 'Query arm-none-eabi-g++ version'
45+
echo
46+
arm-none-eabi-g++ -v
47+
echo
3948
mkdir -p bin
40-
emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-g++ -std=c++17 -Wall -Wextra -Wpedantic -Os -g -gdwarf-2 -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -fno-inline-functions -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf
41-
emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-objcopy ./bin/app_benchmark_non_std_decimal.elf -O ihex ./bin/app_benchmark_non_std_decimal.hex
49+
arm-none-eabi-g++ -std=c++20 -Wall -Wextra -Wpedantic -Os -g -gdwarf-2 -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -fno-inline-functions -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf
50+
arm-none-eabi-objcopy ./bin/app_benchmark_non_std_decimal.elf -O ihex ./bin/app_benchmark_non_std_decimal.hex
4251
ls -la ./bin/app_benchmark_non_std_decimal.elf ./bin/app_benchmark_non_std_decimal.hex ./bin/app_benchmark_non_std_decimal.map
4352
working-directory: ./test/metal/
4453
- name: emulate-target stm32f429
4554
run: |
46-
./emu_env/xpack-qemu-arm-7.1.0-1/bin/qemu-system-gnuarmeclipse --verbose --mcu STM32F429ZI --nographic --gdb tcp::9999 -d unimp,guest_errors &
55+
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/xpack-qemu-arm-8.2.6-1/bin:$PATH"
56+
qemu-system-gnuarmeclipse --verbose --mcu STM32F429ZI --nographic --gdb tcp::9999 -d unimp,guest_errors &
57+
sleep 2
4758
working-directory: ./test/metal/
4859
- name: run-test-on-target
4960
run: |
50-
./emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb-py ./bin/app_benchmark_non_std_decimal.elf -x ./target/build/test_app_benchmarks_emulator.py
51-
qemu_result=$?
52-
echo "qemu_result" "$qemu_result"
53-
echo "qemu_result" "$qemu_result" | grep 'qemu_result 0'
61+
sleep 2
62+
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
63+
echo 'Run test on target'
64+
echo
65+
arm-none-eabi-gdb ./bin/app_benchmark_non_std_decimal.elf -x ./target/build/test_app_benchmarks_emulator.gdb > ./app_benchmark_non_std_decimal.txt
66+
cat ./app_benchmark_non_std_decimal.txt
67+
echo
68+
echo 'We will now grep for the right answer...'
69+
grep 'value 0xF00DCAFE' ./app_benchmark_non_std_decimal.txt
5470
working-directory: ./test/metal/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ test/metal/bin/
4242

4343
# Modules
4444
*.gcm
45+
gcm.cache/
4546

4647
# Mac option
4748
*.DS_Store

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ as well as emulated PPC64LE and STM32 using QEMU with the following compilers:
6161

6262
# Synopsis
6363

64-
Decimal provides 3 types:
64+
Decimal provides 3 IEEE-754 compliant types:
6565

6666
```cpp
6767
namespace boost {
@@ -75,6 +75,20 @@ class decimal128;
7575
} //namespace boost
7676
```
7777
78+
and also 3 similar but non-compliant types with improved runtime performance:
79+
80+
```cpp
81+
namespace boost {
82+
namespace decimal {
83+
84+
class decimal32_fast;
85+
class decimal64_fast;
86+
class decimal128_fast;
87+
88+
} //namespace decimal
89+
} //namespace boost
90+
```
91+
7892
These types operate like built-in floating point types.
7993
They have their own implementations of the Standard-Library functions
8094
(e.g. like those found in `<cmath>`, `<charconv>`, `<cstdlib>`, etc.).

0 commit comments

Comments
 (0)