Skip to content

Commit

Permalink
Test x87 FPU build in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Maratyszcza committed May 28, 2024
1 parent 7b7b039 commit 11a6655
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --parallel
run: ctest --test-dir build --parallel --output-on-failure
cmake-macos-x86_64:
runs-on: macos-12
timeout-minutes: 15
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Build
run: cmake --build build --config Release --parallel -- -quiet
- name: Test
run: ctest --test-dir build --build-config Release --parallel
run: ctest --test-dir build --build-config Release --parallel --output-on-failure
cmake-macos-arm64:
runs-on: macos-14
timeout-minutes: 15
Expand All @@ -47,18 +47,20 @@ jobs:
- name: Build
run: cmake --build build --config Release --parallel -- -quiet
- name: Test
run: ctest --test-dir build --build-config Release --parallel
run: ctest --test-dir build --build-config Release --parallel --output-on-failure
cmake-windows-x86:
runs-on: windows-2019
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Configure
run: cmake -Bbuild -S. -G "Visual Studio 16 2019" -A Win32 -DFP16_BUILD_COMPARATIVE_BENCHMARKS=ON
env:
CXXFLAGS: "/arch:IA32"
- name: Build
run: cmake --build build --config Release --parallel
- name: Test
run: ctest --test-dir build --build-config Release --parallel
run: ctest --test-dir build --build-config Release --parallel --output-on-failure
cmake-windows-x64:
runs-on: windows-2019
timeout-minutes: 15
Expand All @@ -69,7 +71,7 @@ jobs:
- name: Build
run: cmake --build build --config Release --parallel
- name: Test
run: ctest --test-dir build --build-config Release --parallel
run: ctest --test-dir build --build-config Release --parallel --output-on-failure
cmake-windows-arm64:
runs-on: windows-2019
timeout-minutes: 15
Expand Down
3 changes: 2 additions & 1 deletion include/fp16/fp16.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ static inline uint16_t fp16_ieee_from_fp32_value(float f) {
const float scale_to_inf = fp32_from_bits(UINT32_C(0x77800000));
const float scale_to_zero = fp32_from_bits(UINT32_C(0x08800000));
#endif
float base = (fabsf(f) * scale_to_inf) * scale_to_zero;
const float saturated_f = fabsf(f) * scale_to_inf;
float base = saturated_f * scale_to_zero;

const uint32_t w = fp32_to_bits(f);
const uint32_t shl1_w = w + w;
Expand Down

0 comments on commit 11a6655

Please sign in to comment.