Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions azure-devops/cmake-configure-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ parameters:
- '--order=lexical'
- '--num-shards=$(System.TotalJobsInPhase)'
- '--run-shard=$(System.JobPositionInPhase)'
- '--filter=P0811R3_midpoint_lerp'

steps:
- task: PowerShell@2
Expand Down
194 changes: 2 additions & 192 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,160 +10,8 @@ pr:
drafts: false

stages:
##### Phase 1: Initial Builds #####
- stage: Code_Format
dependsOn: []
displayName: 'Code Format'
pool:
name: ${{ variables.x64MediumPoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(x64MediumPoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/format-validation.yml

- stage: Build_x64
dependsOn: []
displayName: 'Build x64'
pool:
name: ${{ variables.x64MediumPoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(x64MediumPoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/build-and-test.yml
parameters:
hostArch: x64
targetArch: x64
targetPlatform: x64
analyzeBuild: true
buildBenchmarks: true
numShards: 1
configureTesting: false
runTesting: false

- stage: Build_x86
dependsOn: []
displayName: 'Build x86'
pool:
name: ${{ variables.x64MediumPoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(x64MediumPoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/build-and-test.yml
parameters:
hostArch: x86
targetArch: x86
targetPlatform: x86
analyzeBuild: true
buildBenchmarks: true
numShards: 1
configureTesting: false
runTesting: false

- stage: Build_ARM64
dependsOn: []
displayName: 'Build ARM64'
pool:
name: ${{ variables.arm64PoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(arm64PoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/build-and-test.yml
parameters:
hostArch: arm64
targetArch: arm64
targetPlatform: arm64
analyzeBuild: true
buildBenchmarks: true
numShards: 1
configureTesting: false
runTesting: false

- stage: Build_ARM64EC
dependsOn: []
displayName: 'Build ARM64EC'
pool:
name: ${{ variables.arm64PoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(arm64PoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/build-and-test.yml
parameters:
hostArch: arm64
targetArch: arm64
targetPlatform: arm64ec
analyzeBuild: true
buildBenchmarks: true
numShards: 1
configureTesting: false
runTesting: false

- stage: Configure_Tests
dependsOn: []
displayName: 'Configure Tests'
pool:
name: ${{ variables.x64MediumPoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(x64MediumPoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/build-and-test.yml
parameters:
hostArch: x64
targetArch: x64
targetPlatform: x64
numShards: 1
buildStl: false
runTesting: false

##### Phase 2: Primary Test Architectures #####
- stage: Test_x64
dependsOn:
- Code_Format
- Build_x64
- Build_x86
- Build_ARM64
- Build_ARM64EC
- Configure_Tests
displayName: 'Test x64'
pool:
name: ${{ variables.x64FastPoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(x64FastPoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/build-and-test.yml
parameters:
hostArch: x64
targetArch: x64
targetPlatform: x64

- stage: Test_ARM64
dependsOn:
- Code_Format
- Build_x64
- Build_x86
- Build_ARM64
- Build_ARM64EC
- Configure_Tests
dependsOn: []
displayName: 'Test ARM64'
pool:
name: ${{ variables.arm64PoolName }}
Expand All @@ -178,42 +26,4 @@ stages:
hostArch: arm64
targetArch: arm64
targetPlatform: arm64

##### Phase 3: Secondary Test Architectures #####
- stage: Test_x86
dependsOn:
- Test_x64
- Test_ARM64
displayName: 'Test x86'
pool:
name: ${{ variables.x64SlowPoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(x64SlowPoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/build-and-test.yml
parameters:
hostArch: x86
targetArch: x86
targetPlatform: x86

- stage: Test_ARM64EC
dependsOn:
- Test_x64
- Test_ARM64
displayName: 'Test ARM64EC'
pool:
name: ${{ variables.arm64PoolName }}
demands: ${{ variables.poolDemands }}
variables:
- name: workRoot
value: '$(arm64PoolWorkRoot)'
readonly: true
jobs:
- template: azure-devops/build-and-test.yml
parameters:
hostArch: arm64
targetArch: arm64
targetPlatform: arm64ec
numShards: 2
42 changes: 38 additions & 4 deletions tests/std/tests/P0811R3_midpoint_lerp/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <limits>
#include <numeric>
#include <optional>
#include <random>
#include <type_traits>

using namespace std;
Expand Down Expand Up @@ -91,11 +92,7 @@ constexpr int fe_major_except = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW;

bool check_feexcept(
[[maybe_unused]] const int expected_excepts, [[maybe_unused]] const int except_mask = fe_major_except) {
#if defined(_M_ARM64) || defined(_M_ARM64EC) // TRANSITION, GH-5685
return true;
#else // ^^^ workaround / no workaround vvv
return fetestexcept(except_mask) == (expected_excepts & except_mask);
#endif // ^^^ no workaround ^^^
}
#else // ^^^ defined(_M_FP_STRICT) / !defined(_M_FP_STRICT) vvv
class ExceptGuard {
Expand Down Expand Up @@ -1133,6 +1130,38 @@ constexpr bool test_gh_2112() {
return true;
}

#ifdef _M_FP_STRICT
template <typename Ty>
void test_lerp_exception() {
mt19937_64 rng(20260802'064821);
uniform_int_distribution<long long> dist_ab(-1LL << 58, (1LL << 58) - 1);
uniform_int_distribution<long long> dist_t(-3LL << 52, (5LL << 52) - 1);

for (int i = 0; i < 1'000'000; ++i) {
const long long ia = dist_ab(rng);
const long long ib = dist_ab(rng);
const long long it = dist_t(rng);
const Ty a = static_cast<Ty>(_Bit_cast<double>(ia ^ (ia >> 63)) * 0x1p+991);
const Ty b = static_cast<Ty>(_Bit_cast<double>(ib ^ (ib >> 63)) * 0x1p+991);
const Ty t = static_cast<Ty>(it * 0x1p-53);

feclearexcept(FE_ALL_EXCEPT);
const Ty result = lerp(a, b, t);
const int exceptions = fetestexcept(FE_ALL_EXCEPT);

if ((exceptions & ~FE_INEXACT) != 0) {
constexpr int hex_precision = (numeric_limits<Ty>::digits - 1 + 3) / 4;
printf(" a: %+.*a\n", hex_precision, a);
printf(" b: %+.*a\n", hex_precision, b);
printf(" t: %+.*a\n", hex_precision, t);
printf(" result: %+.*a\n", hex_precision, result);
printf("exceptions: %#x\n", exceptions);
exit(1);
}
}
}
#endif // _M_FP_STRICT

int main() {
test_constants<float>();
test_constants<double>();
Expand Down Expand Up @@ -1207,4 +1236,9 @@ int main() {
test_gh_1917();
test_gh_2112();
STATIC_ASSERT(test_gh_2112());

#ifdef _M_FP_STRICT
test_lerp_exception<float>();
test_lerp_exception<double>();
#endif // _M_FP_STRICT
}