@@ -1903,8 +1903,22 @@ vector<bool, N> __vectorEql<T, let N : int>(vector<T, N> left, vector<T, N> righ
1903
1903
__generic < T:__BuiltinIntegerType, let N : int >
1904
1904
extension vector< T,N> : IInteger
1905
1905
{
1906
- [__unsafeForceInlineEarly] bool lessThan(This other) { return this [0 ] < other [0 ]; }
1907
- [__unsafeForceInlineEarly] bool lessThanOrEquals(This other) { return this [0 ] <= other [0 ]; }
1906
+ [__unsafeForceInlineEarly] bool lessThan(This other)
1907
+ {
1908
+ [ForceUnroll]
1909
+ for (int i = 0 ; i < N; i++ )
1910
+ if (this [i] < other [i])
1911
+ return true ;
1912
+ return false ;
1913
+ }
1914
+ [__unsafeForceInlineEarly] bool lessThanOrEquals(This other)
1915
+ {
1916
+ [ForceUnroll]
1917
+ for (int i = 0 ; i < N; i++ )
1918
+ if (this [i] <= other [i])
1919
+ return true ;
1920
+ return false ;
1921
+ }
1908
1922
[__unsafeForceInlineEarly] bool equals(This other) { return all(__vectorEql(this , other)); }
1909
1923
__intrinsic_op($(kIROp_Add )) This add(This other);
1910
1924
__intrinsic_op($(kIROp_Sub )) This sub(This other);
@@ -2032,8 +2046,20 @@ extension vector<T,N> : IDifferentiable
2032
2046
__generic < T:__BuiltinFloatingPointType, let N : int , let M : int , let L : int >
2033
2047
extension matrix< T,N,M,L> : IFloat
2034
2048
{
2035
- [TreatAsDifferentiable][__unsafeForceInlineEarly] bool lessThan(This other) { return this < other; }
2036
- [TreatAsDifferentiable][__unsafeForceInlineEarly] bool lessThanOrEquals(This other) { return this <= other; }
2049
+ [TreatAsDifferentiable] [__unsafeForceInlineEarly] bool lessThan(This other)
2050
+ {
2051
+ [ForceUnroll]
2052
+ for (int i = 0 ; i < N; i++ )
2053
+ if (this [i].lessThan (other [i])) return true ;
2054
+ return false ;
2055
+ }
2056
+ [TreatAsDifferentiable] [__unsafeForceInlineEarly] bool lessThanOrEquals(This other)
2057
+ {
2058
+ [ForceUnroll]
2059
+ for (int i = 0 ; i < N; i++ )
2060
+ if (this [i].lessThanOrEquals (other [i])) return true ;
2061
+ return false ;
2062
+ }
2037
2063
[TreatAsDifferentiable][__unsafeForceInlineEarly] bool equals(This other) { return all(this == other); }
2038
2064
[TreatAsDifferentiable] __intrinsic_op($(kIROp_Add )) This add(This other);
2039
2065
[TreatAsDifferentiable] __intrinsic_op($(kIROp_Sub )) This sub(This other);
0 commit comments