Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6b28e2ca4eef
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fd2ab3a02bcf
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jun 1, 2021

  1. missed a test

    eggrobin committed Jun 1, 2021
    Copy the full SHA
    e4645c5 View commit details
  2. Merge pull request #3021 from eggrobin/no-vex

    Missed a test with an FMA
    eggrobin authored Jun 1, 2021
    Copy the full SHA
    fd2ab3a View commit details
Showing with 7 additions and 0 deletions.
  1. +7 −0 quantities/elementary_functions_test.cpp
7 changes: 7 additions & 0 deletions quantities/elementary_functions_test.cpp
Original file line number Diff line number Diff line change
@@ -26,11 +26,14 @@ using astronomy::Parsec;
using astronomy::JovianGravitationalParameter;
using astronomy::SolarGravitationalParameter;
using astronomy::TerrestrialGravitationalParameter;
using base::CPUFeatureFlags;
using base::HasCPUFeatures;
using constants::GravitationalConstant;
using constants::SpeedOfLight;
using constants::StandardGravity;
using constants::VacuumPermeability;
using constants::VacuumPermittivity;
using numerics::CanEmitFMAInstructions;
using si::Ampere;
using si::Coulomb;
using si::Day;
@@ -54,6 +57,10 @@ using ::testing::Lt;
class ElementaryFunctionsTest : public testing::Test {};

TEST_F(ElementaryFunctionsTest, FMA) {
if (!CanEmitFMAInstructions || !HasCPUFeatures(CPUFeatureFlags::FMA)) {
LOG(ERROR) << "Cannot test FMA on a machine without FMA";
return;
}
EXPECT_EQ(11 * Coulomb,
FusedMultiplyAdd(2 * Ampere, 3 * Second, 5 * Coulomb));
EXPECT_EQ(11 * Radian, FusedMultiplyAdd(2.0, 3 * Radian, 5 * Radian));