You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to emit fast target implementations of some Metal-based
functions (fmin(), fmax(), fmin3(), fmax3(), fmedian3()) on all
targets, remove some specification regarding the handling of NaNs,
and also remove the enforcement of the specification.
These functions are now documented to be basically undefined now
in the presence of NaN input, to make the common "is a number"
case fast.
Also, clarify that powr() is undefined when given a non-positive
base input value, allowing us to remove an additional abs()
operation that was unnecessarily coercing results to be predictable
on non-Metal targets.
Closes#5580Closes#5581Closes#5587
/// @return The larger of the two values, element-wise if vector typed, considering NaN.
10282
-
/// @remarks For metal, if either value is NaN, the other value is returned. If both values are NaN, NaN is returned.
10283
-
/// For other targets, if `x` is NaN, `y` is returned, otherwise the larger of `x` and `y` is returned.
10281
+
/// @return The larger of the two values, element-wise if vector typed.
10282
+
/// @remarks Result is `y` if `x` < `y`, either `x` or `y` if both `x` and `y` are zeros, otherwise `x`. Which operand is the result is undefined if one of the operands is a NaN.
/// Floating-point maximum of 3 inputs, considering NaN.
10310
+
/// Floating-point maximum of 3 inputs.
10313
10311
/// @param x The first value to compare.
10314
10312
/// @param y The second value to compare.
10315
10313
/// @param z The third value to compare.
10316
-
/// @return The largest of the three values, element-wise if vector typed, considering NaN. If all three values are NaN, NaN is returned. If any value is NaN, the largest is returned.
10314
+
/// @return The largest of the three values, element-wise if vector typed.
10315
+
/// @remarks If any operand in the 3-way comparison is NaN, it is undefined which operand is returned.
/// @return The smaller of the two values, element-wise if vector typed, considering NaN.
10529
-
/// @remarks For metal, if either value is NaN, the other value is returned. If both values are NaN, NaN is returned.
10530
-
/// For other targets, if `x` is NaN, `y` is returned, otherwise the smaller of `x` and `y` is returned.
10508
+
/// @return The smaller of the two values, element-wise if vector typed.
10509
+
/// @remarks Result is `x` if `x` < `y`, either `x` or `y` if both `x` and `y` are zeros, otherwise `y`. Which operand is the result is undefined if one of the operands is a NaN.
/// Floating-point minimum of 3 inputs, considering NaN.
10537
+
/// Floating-point minimum of 3 inputs.
10560
10538
/// @param x The first value to compare.
10561
10539
/// @param y The second value to compare.
10562
10540
/// @param z The third value to compare.
10563
-
/// @return The smallest of the three values, element-wise if vector typed, considering NaN. If all three values are NaN, NaN is returned. If any value is NaN, the smallest non-NaN value is returned.
10541
+
/// @return The smallest of the three values, element-wise if vector typed.
10542
+
/// @remarks If any operand in the 3-way comparison is NaN, it is undefined which operand is returned.
/// @return The median of the three values, element-wise if vector typed, considering NaN. If no value is NaN, the median is returned. If any value is NaN, one of the non-NaN values is returned.
10631
+
/// @return The median of the three values, element-wise if vector typed.
10672
10632
/// @remarks For metal, this is implemented with the fmedian3 intrinsic.
10633
+
/// If any value is NaN, it is unspecified which operand is returned.
10673
10634
/// @category math
10674
10635
__generic<T : __BuiltinFloatingPointType>
10675
10636
[__readNone]
@@ -10681,20 +10642,6 @@ T fmedian3(T x, T y, T z)
0 commit comments