   @_alwaysEmitIntoClient
   public static var one: Self {
     return Self(repeating: 1)
+  }
+  
+  /// The lanewise minimum of two vectors.
+  ///
+  /// Each element of the result is the minimum of the corresponding elements
+  /// of the inputs.
+  @_alwaysEmitIntoClient
+  public static func min(_ a: Self, _ b: Self) -> Self {
+    var result = Self()
+    for i in result.indices {
+      result[i] = Scalar.minimum(a[i], b[i])
+    }
+    return result
+  }
+  
+  /// The lanewise maximum of two vectors.
+  ///
+  /// Each element of the result is the minimum of the corresponding elements
+  /// of the inputs.
+  @_alwaysEmitIntoClient
+  public static func max(_ a: Self, _ b: Self) -> Self {
+    var result = Self()
+    for i in result.indices {
+      result[i] = Scalar.maximum(a[i], b[i])
+    }
+    return result
+  }
+  
+  @_alwaysEmitIntoClient
+  public mutating func clamp(lowerBound: Self, upperBound: Self) {
+    self = self.clamped(lowerBound: lowerBound, upperBound: upperBound)
+  }
+
+  @_alwaysEmitIntoClient
+  public func clamped(lowerBound: Self, upperBound: Self) -> Self {
+    return pointwiseMin(upperBound, pointwiseMax(lowerBound, self))
   }
 }
 


  @_alwaysEmitIntoClient
  public func clamped(lowerBound: Self, upperBound: Self) -> Self {
    return Swift.min(upperBound, Swift.max(lowerBound, self))
  }
  */
}

extension SIMD where Scalar: FixedWidthInteger {

  return mask._storage.max() < 0
}

/// The lanewise minimum of two vectors.
///
/// Each element of the result is the minimum of the corresponding elements
/// of the inputs.
@_alwaysEmitIntoClient
public func pointwiseMin<T>(_ a: T, _ b: T) -> T
where T: SIMD, T.Scalar: Comparable {
  var result = T()
  for i in result.indices {
    result[i] = min(a[i], b[i])
  }
  return result
}

/// The lanewise maximum of two vectors.
///
/// Each element of the result is the minimum of the corresponding elements
/// of the inputs.
@_alwaysEmitIntoClient
public func pointwiseMax<T>(_ a: T, _ b: T) -> T
where T: SIMD, T.Scalar: Comparable {
  var result = T()
  for i in result.indices {
    result[i] = max(a[i], b[i])
  }
  return result
}


/// The lanewise minimum of two vectors.
///
/// Each element of the result is the minimum of the corresponding elements
/// of the inputs.
@_alwaysEmitIntoClient
public func pointwiseMin<T>(_ a: T, _ b: T) -> T
where T: SIMD, T.Scalar: FloatingPoint {
  var result = T()
  for i in result.indices {
    result[i] = T.Scalar.minimum(a[i], b[i])
  }
  return result
}
