message: test: Add tests for f{32,64}.max instructions
diff: @@ -279,6 +279,7 @@ TYPED_TEST(execute_floating_point_types, binop_nan_propagation)
  Instr::f32_add,
  Instr::f32_div,
  Instr::f32_min,
  + Instr::f32_max,
  };
  for (const auto op : opcodes)
  @@ -645,6 +646,53 @@ TYPED_TEST(execute_floating_point_types, min)
  }
  }
  +TYPED_TEST(execute_floating_point_types, max)
  +{
  + using Limits = typename FP<TypeParam>::Limits;
  +
  + auto instance = instantiate(parse(this->get_binop_code(Instr::f32_max)));
  + const auto exec = [&](auto arg1, auto arg2) { return execute(*instance, 0, {arg1, arg2}); };
  +
  + for (const auto z : this->ordered_special_values)
  + {
  + if (std::isnan(z))
  + continue;
  +
  + // fmax(+inf, z2) = +inf
  + EXPECT_THAT(exec(Limits::infinity(), z), Result(Limits::infinity()));
  +
  + // fmax(-inf, z2) = z2
  + EXPECT_THAT(exec(-Limits::infinity(), z), Result(z));
  +
  + // fmax(z1, +inf) = +inf
  + EXPECT_THAT(exec(z, Limits::infinity()), Result(Limits::infinity()));
  +
  + // fmax(z1, -inf) = z1
  + EXPECT_THAT(exec(z, -Limits::infinity()), Result(z));
  + }
  +
  + // fmax(+-0, -+0) = +0
  + EXPECT_THAT(execute(*instance, 0, {TypeParam{0}, -TypeParam{0}}), Result(TypeParam{0}));
  + EXPECT_THAT(execute(*instance, 0, {-TypeParam{0}, TypeParam{0}}), Result(TypeParam{0}));
  + EXPECT_THAT(execute(*instance, 0, {-TypeParam{0}, -TypeParam{0}}), Result(-TypeParam{0}));
  +
  + // Check every pair from cartesian product of the list of values.
  + // fmax(z1, z2) = z1 (if z1 >= z2)
  + // fmax(z1, z2) = z2 (if z2 >= z1)
  + for (size_t i = 0; i < std::size(this->ordered_special_values); ++i)
  + {
  + for (size_t j = 0; j < std::size(this->ordered_special_values); ++j)
  + {
  + const auto a = this->ordered_special_values[i];
  + const auto b = this->ordered_special_values[j];
  + if (!std::isnan(a) && !std::isnan(b))
  + {
  + EXPECT_THAT(execute(*instance, 0, {a, b}), Result(i > j ? a : b)) << a << ", " << b;
  + }
  + }
  + }
  +}
  +
  TYPED_TEST(execute_floating_point_types, copysign)
  {
  using FP = FP<TypeParam>;
  