Skip to content

Commit e08e11e

Browse files
V2.2.0
### Known Issues - `half8` `==` and `!=` operators don't conform to the IEEE 754 standard - Unity has not yet reacted to my bug-report in regards to their "half" implementation - `(s)byte`, `(u)short` vector and `(U)Int128` multiplication, division and modulo operations by compile time constants are not optimal. For (U)Int128, it requires a new Burst feature à la `T Constant.ForceCompileTimeEvaluation<T, U>(Func<T, U> code)`(proposed); Currently work is being done on `(s)byte` and `(u)short` vectors in this regard, which will beat any compiler. The current (tested)state of all optimizations possible is currently included. - `pow` functions with compile time constant exponents currently do not handle many decimal numbers - `math.rsqrt` would often be used in those cases for optimal performance but it is actually slower when the `Unity.Burst.FloatMode` is set to anything but `FloatMode.Fast`. To guarantee optimal performance, compile time access to the current `FloatMode` would be needed (proposed) - double `(r)cbrt` and thus possibly (u)int `intcbrt` functions are currently not optimized ### Fixes - linked `float8` `rcp` and `rsqrt` functions to Bursts' `FloatMode` and `FloatPrecision` - `short.MinValue / -1` now correctly overflows to `short.MinValue` when dividing a `short16` vector by another `short16` vector when compiling for AVX or higher - fixed scalar `quarter` to `double` conversion for when the `quarter` value is negative - fixed scalar `half` to `quarter` conversion for when the `half` value is negative - fixed vector `quarter` to `ulong` conversion for when a `quarter` value is negative - fixed `(u)short8` to `quarter8` conversion ### Additions # Added saturation arithmetic to the library for all scalar- and vector types. Saturation arithmetic clamps the result of an operation to `type.MinValue` and `type.MaxValue` if under- or overflow occurs, respectively and has single-instruction hardware support for `(s)bytes` and `(u)shorts`. The included functions are: - `addsaturated` - `subsaturated` - `mulsaturated` - `divsaturated` (only clamps division of floating point types and signed division of, for instance, `sbyte.MinValue` ( = -128) `/ -1 to 127`, which would cause a hardware exception for `int`s and `longs`) - `castsaturated` (all types to all other types with a smaller range), - `csumsaturated` - `cprodsaturated` - added high performance `(U)Int128` types with full library support, meaning: all operators and type conversions aswell as all functions support these types. Most operations of both types, in Burst code, compile down to optimal machine code. Exceptions: 1) signed 64x64 bit to 128 bit multiplication 2) `*`, `/`, `%` and `divrem` functions with a scalar compile time constant argument (See: Known Issues #2) - added `Random128` XOR-Shift pseudo random number generator for generating `(U)Int128`s - added high performance & accuracy `(r)cbrt` - (reciprocal) cube root functions for scalar and vector `float`- and `double` types based on a research paper from 2021. An optional `bool` parameter allows the caller to decide whether or not negative input values should be handled correctly (which is not the case with `math.pow(x, 1f/3f)`), which is set to `false` by default - added high performance `intcbrt` - integer cube root functions for all scalar and vector integer types. For signed integer types, an optional `bool` parameter allows the caller to decide whether or not negative input values should be handled correctly (which is not the case with `math.pow(x, 1f/3f)`), which is set to `false` by default - added a `log` function to all scalar and vector `float`- and `double` types with a second parameter `b`, which is the logarithms' base - added `reversebytes` functions for all scalar- and vector types, which convert back and forth between big endian and little endian byte order, respectively. All of them (scalar, vector) compile down to single hardware instructions - added `pow` functions with scalar exponents for `float` and `double` scalars and vectors, with optimizations for selected constant exponents (not necessarily whole exponents) - added function overloads to all functions for scalar `(s)byte`s and `(u)short`s in order to resolve function call resolution ambiguity which was already present in `Unity.Mathematics`, which may also improve performance in some cases - added a static readonly `New` property to `RandomX` XOR-Shift pseudo random generators. It calls `Environment.TickCount` internally (and is thus seeded somewhat randomly), makes sure it is non-zero and can be called from Burst native code - added `fastrcp` functions for `float` scalars and vectors, faster (and substantially less accurate) than `FloatPrecision.Low`, `FloatMode.Fast` Burst implementations - added `fastrsqrt` functions for `float` scalars and vectors, faster (and substantially less accurate) than `FloatPrecision.Low`, `FloatMode.Fast` Burst implementations ### Improvements - added AVX and AVX2 code for `float8` `sin`, `cos`, `tan`, `sincos`, `asin`, `acos`, `atan`, `atan2`, `sinh`, `cosh`, `tanh`, `pow`, `exp`, `exp2`, `exp10`, `log`, `log2`, `log10` and `fmod` (and the "%" operator) - optimized many `/`, `%`, `*` and `divrem` operations with a scalar compile time constant argument for (s)byte vectors (see 'Known Issues #2'), which were previously not optimized (...optimally/at all) by Burst. - added SSE2 fallback code for converting AVX vector types to SSE vector types and vice versa(for example: `short16`(256 bit) to `byte16`(128 bit)) - scalar `(s)byte` and `(u)short` `rol` and `ror` functions now compile down to single hardware instructions - improved performance and/or reduced code size of nearly all vector comparison operations - improved performance of - and added SSE2 fallback code for bitfield to boolean vector conversion (`toboolX` and thus also `select(vector a, vector b, bitmask c)`); - improved performance of `intpow` functions in general and for when the exponent is a compile time constant - improved performance and reduced code size of `compareto` vector functions (especially for unsigned types) - added more optimizations to `isdivisible` - improved performance of `intsqrt` functions for `(u)long` and `(s)byte` scalar and vector types considerably - reduced code size of `ispow2` vector functions - reduced code size of (s)byte vector-by-vector division - improved performance of `Random64`'s `(u)long4` generation if compiling for AVX2 - improved performance of `(s)byte` matrix multiplication - reduced code size of `(u)short`- and up to `(s)byte8` vector by vector division and `divrem` functions(and improved performance if compiling for SSE2) - reduced code size and improved performance of `isinrange` functions for `(u)long` vector types - reduced code size of ushort vector `>=` and `<=` operators for SSE2 fallback code by ~75% - improved performance and reduced code size of SSE2 down-casting fallback code ### Changes - API BREAKING CHANGE: The various bool to integer/floating point conversion functions (`touint8`/`tof32` etc.) are now renamed to contain C# types in their names (`tobyte`/`tofloat` etc.) - API BREAKING CHANGE: If you use this library as intended, meaning you import it and `Unity.Mathematics.math` statically (`using static MaxMath.maxmath;`) and you use the `pow` functions with scalar bases and scalar exponents in those scripts, you will encounter the first ever function call resolution ambiguity. It is strongly recommended to always use the `maxmath.pow` function, because it optimizes any `pow` call enormously if the exponent is a compile time constant, which does NOT necessarily mean that such a call must declare the exponent as a literal value - the exponent may become a compile time constant due to constant propagation - `quarter` is now a readonly struct - `quarter` to `sbyte`, `short`, `int` and `long` coversions are now required to be declared explicitly - removed `countbits(void* ptr, ulong bytes)` from the library and added it to https://github.com/MrUnbelievable92/SIMD-Algorithms with more options ### Fixed Oversights - (Issue #3) added constructor wrappers to the maxmath class analogous to `Unity.Mathematics`(`byte4 myByte4 = (maxmath.)byte4(1, 2, 3, 4);`) - added `dsub` - fused divide-subtract function for scalar and vector `float` types - added an optional `bool fast = false` parameter to `dad`, `dsub`, `dadsub` and `dsubadd` functions - added `andnot` function overloads for scalar and vector `bool` types - added implicit type conversions of scalar `quarter` values to `half`, `float` and `double` vectors - added `all_eq` and `all_dif` functions for vectors of size 2 - added `all_eq` and `all_dif` functions for `float` and `double` vectors
1 parent 39f5b58 commit e08e11e

File tree

308 files changed

+84297
-26180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+84297
-26180
lines changed

Runtime/AssemblyInfo.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
[assembly: AssemblyTrademark("")]
1616
[assembly: AssemblyCulture("")]
1717
[assembly: InternalsVisibleTo("MaxMath.Tests")]
18-
[assembly: InternalsVisibleTo("NativeArrayExtensions")]
1918

2019
// Setting ComVisible to false makes the types in this assembly not visible
2120
// to COM components. If you need to access a type in this assembly from
@@ -32,8 +31,8 @@
3231
// Build Number
3332
// Revision
3433
//
35-
[assembly: AssemblyVersion("2.1.2")]
36-
[assembly: AssemblyFileVersion("2.1.2")]
37-
[assembly: AssemblyInformationalVersion("2.1 Release")]
34+
[assembly: AssemblyVersion("2.2.0")]
35+
[assembly: AssemblyFileVersion("2.2.0")]
36+
[assembly: AssemblyInformationalVersion("2.2 Release")]
3837

3938
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Unity.Mathematics API consistency")]

Runtime/Functions/Arithmetic/(Fused) Multiply-Add.cs

Lines changed: 75 additions & 33 deletions
Large diffs are not rendered by default.

Runtime/Functions/Arithmetic/Absolute.cs

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,27 @@ namespace MaxMath
88
{
99
unsafe public static partial class maxmath
1010
{
11-
/// <summary> Returns the componentwise absolute value of an sbyte2 vector. </summary>
11+
/// <summary> Returns the componentwise absolute value of an <see cref="Int128"/>. </summary>
12+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
13+
public static Int128 abs(Int128 x)
14+
{
15+
ulong mask = (ulong)((long)x.intern.hi >> 63);
16+
17+
ulong lo = x.intern.lo ^ mask;
18+
ulong hi = x.intern.hi ^ mask;
19+
20+
return new Int128(lo, hi) + ((ulong)-(long)mask);
21+
}
22+
23+
24+
/// <summary> Returns the componentwise absolute value of an <see cref="sbyte"/>. </summary>
25+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
26+
public static sbyte abs(sbyte x)
27+
{
28+
return (sbyte)math.abs(x);
29+
}
30+
31+
/// <summary> Returns the componentwise absolute value of an <see cref="MaxMath.sbyte2"/>. </summary>
1232
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1333
public static sbyte2 abs(sbyte2 x)
1434
{
@@ -18,7 +38,7 @@ public static sbyte2 abs(sbyte2 x)
1838
}
1939
else if (Sse2.IsSse2Supported)
2040
{
21-
v128 mask = Sse2.cmpgt_epi8(default(v128), x);
41+
v128 mask = Sse2.cmpgt_epi8(Sse2.setzero_si128(), x);
2242

2343
return (x + mask) ^ mask;
2444
}
@@ -28,7 +48,7 @@ public static sbyte2 abs(sbyte2 x)
2848
}
2949
}
3050

31-
/// <summary> Returns the componentwise absolute value of an sbyte3 vector. </summary>
51+
/// <summary> Returns the componentwise absolute value of an <see cref="MaxMath.sbyte3"/>. </summary>
3252
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3353
public static sbyte3 abs(sbyte3 x)
3454
{
@@ -38,7 +58,7 @@ public static sbyte3 abs(sbyte3 x)
3858
}
3959
else if (Sse2.IsSse2Supported)
4060
{
41-
v128 mask = Sse2.cmpgt_epi8(default(v128), x);
61+
v128 mask = Sse2.cmpgt_epi8(Sse2.setzero_si128(), x);
4262

4363
return (x + mask) ^ mask;
4464
}
@@ -48,7 +68,7 @@ public static sbyte3 abs(sbyte3 x)
4868
}
4969
}
5070

51-
/// <summary> Returns the componentwise absolute value of an sbyte4 vector. </summary>
71+
/// <summary> Returns the componentwise absolute value of an <see cref="MaxMath.sbyte4"/>. </summary>
5272
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5373
public static sbyte4 abs(sbyte4 x)
5474
{
@@ -58,7 +78,7 @@ public static sbyte4 abs(sbyte4 x)
5878
}
5979
else if (Sse2.IsSse2Supported)
6080
{
61-
v128 mask = Sse2.cmpgt_epi8(default(v128), x);
81+
v128 mask = Sse2.cmpgt_epi8(Sse2.setzero_si128(), x);
6282

6383
return (x + mask) ^ mask;
6484
}
@@ -68,7 +88,7 @@ public static sbyte4 abs(sbyte4 x)
6888
}
6989
}
7090

71-
/// <summary> Returns the componentwise absolute value of an sbyte8 vector. </summary>
91+
/// <summary> Returns the componentwise absolute value of an <see cref="MaxMath.sbyte8"/>. </summary>
7292
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7393
public static sbyte8 abs(sbyte8 x)
7494
{
@@ -78,7 +98,7 @@ public static sbyte8 abs(sbyte8 x)
7898
}
7999
else if (Sse2.IsSse2Supported)
80100
{
81-
v128 mask = Sse2.cmpgt_epi8(default(v128), x);
101+
v128 mask = Sse2.cmpgt_epi8(Sse2.setzero_si128(), x);
82102

83103
return (x + mask) ^ mask;
84104
}
@@ -88,7 +108,7 @@ public static sbyte8 abs(sbyte8 x)
88108
}
89109
}
90110

91-
/// <summary> Returns the componentwise absolute value of an sbyte16 vector. </summary>
111+
/// <summary> Returns the componentwise absolute value of an <see cref="MaxMath.sbyte16"/>. </summary>
92112
[MethodImpl(MethodImplOptions.AggressiveInlining)]
93113
public static sbyte16 abs(sbyte16 x)
94114
{
@@ -98,7 +118,7 @@ public static sbyte16 abs(sbyte16 x)
98118
}
99119
else if (Sse2.IsSse2Supported)
100120
{
101-
v128 mask = Sse2.cmpgt_epi8(default(v128), x);
121+
v128 mask = Sse2.cmpgt_epi8(Sse2.setzero_si128(), x);
102122

103123
return (x + mask) ^ mask;
104124
}
@@ -108,7 +128,7 @@ public static sbyte16 abs(sbyte16 x)
108128
}
109129
}
110130

111-
/// <summary> Returns the componentwise absolute value of an sbyte32 vector. </summary>
131+
/// <summary> Returns the componentwise absolute value of an <see cref="MaxMath.sbyte32"/>. </summary>
112132
[MethodImpl(MethodImplOptions.AggressiveInlining)]
113133
public static sbyte32 abs(sbyte32 x)
114134
{
@@ -123,7 +143,14 @@ public static sbyte32 abs(sbyte32 x)
123143
}
124144

125145

126-
/// <summary> Returns the componentwise absolute value of a short2 vector. </summary>
146+
/// <summary> Returns the componentwise absolute value of a <see cref="short"/>. </summary>
147+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
148+
public static short abs(short x)
149+
{
150+
return (short)math.abs(x);
151+
}
152+
153+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.short2"/>. </summary>
127154
[MethodImpl(MethodImplOptions.AggressiveInlining)]
128155
public static short2 abs(short2 x)
129156
{
@@ -133,17 +160,15 @@ public static short2 abs(short2 x)
133160
}
134161
else if (Sse2.IsSse2Supported)
135162
{
136-
v128 mask = Sse2.cmpgt_epi16(default(v128), x);
137-
138-
return (x + mask) ^ mask;
163+
return Sse2.max_epi16(Sse2.sub_epi16(Sse2.setzero_si128(), x), x);
139164
}
140165
else
141166
{
142167
return new short2((short)math.abs(x.x), (short)math.abs(x.y));
143168
}
144169
}
145170

146-
/// <summary> Returns the componentwise absolute value of a short3 vector. </summary>
171+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.short3"/>. </summary>
147172
[MethodImpl(MethodImplOptions.AggressiveInlining)]
148173
public static short3 abs(short3 x)
149174
{
@@ -153,17 +178,15 @@ public static short3 abs(short3 x)
153178
}
154179
else if (Sse2.IsSse2Supported)
155180
{
156-
v128 mask = Sse2.cmpgt_epi16(default(v128), x);
157-
158-
return (x + mask) ^ mask;
181+
return Sse2.max_epi16(Sse2.sub_epi16(Sse2.setzero_si128(), x), x);
159182
}
160183
else
161184
{
162185
return new short3((short)math.abs(x.x), (short)math.abs(x.y), (short)math.abs(x.z));
163186
}
164187
}
165188

166-
/// <summary> Returns the componentwise absolute value of a short4 vector. </summary>
189+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.short4"/>. </summary>
167190
[MethodImpl(MethodImplOptions.AggressiveInlining)]
168191
public static short4 abs(short4 x)
169192
{
@@ -173,17 +196,15 @@ public static short4 abs(short4 x)
173196
}
174197
else if (Sse2.IsSse2Supported)
175198
{
176-
v128 mask = Sse2.cmpgt_epi16(default(v128), x);
177-
178-
return (x + mask) ^ mask;
199+
return Sse2.max_epi16(Sse2.sub_epi16(Sse2.setzero_si128(), x), x);
179200
}
180201
else
181202
{
182203
return new short4((short)math.abs(x.x), (short)math.abs(x.y), (short)math.abs(x.z), (short)math.abs(x.w));
183204
}
184205
}
185206

186-
/// <summary> Returns the componentwise absolute value of a short8 vector. </summary>
207+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.short8"/>. </summary>
187208
[MethodImpl(MethodImplOptions.AggressiveInlining)]
188209
public static short8 abs(short8 x)
189210
{
@@ -193,17 +214,15 @@ public static short8 abs(short8 x)
193214
}
194215
else if (Sse2.IsSse2Supported)
195216
{
196-
v128 mask = Sse2.cmpgt_epi16(default(v128), x);
197-
198-
return (x + mask) ^ mask;
217+
return Sse2.max_epi16(Sse2.sub_epi16(Sse2.setzero_si128(), x), x);
199218
}
200219
else
201220
{
202221
return new short8((short)math.abs(x.x0), (short)math.abs(x.x1), (short)math.abs(x.x2), (short)math.abs(x.x3), (short)math.abs(x.x4), (short)math.abs(x.x5), (short)math.abs(x.x6), (short)math.abs(x.x7));
203222
}
204223
}
205224

206-
/// <summary> Returns the componentwise absolute value of a short16 vector. </summary>
225+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.short16"/>. </summary>
207226
[MethodImpl(MethodImplOptions.AggressiveInlining)]
208227
public static short16 abs(short16 x)
209228
{
@@ -218,7 +237,7 @@ public static short16 abs(short16 x)
218237
}
219238

220239

221-
/// <summary> Returns the componentwise absolute value of an int8 vector. </summary>
240+
/// <summary> Returns the componentwise absolute value of an <see cref="MaxMath.int8"/>. </summary>
222241
[MethodImpl(MethodImplOptions.AggressiveInlining)]
223242
public static int8 abs(int8 x)
224243
{
@@ -233,13 +252,13 @@ public static int8 abs(int8 x)
233252
}
234253

235254

236-
/// <summary> Returns the componentwise absolute value of a long2 vector. </summary>
255+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.long2"/>. </summary>
237256
[MethodImpl(MethodImplOptions.AggressiveInlining)]
238257
public static long2 abs(long2 x)
239258
{
240259
if (Sse2.IsSse2Supported)
241260
{
242-
long2 mask = Operator.greater_mask_long(default(v128), x);
261+
long2 mask = Operator.greater_mask_long(Sse2.setzero_si128(), x);
243262

244263
return (x + mask) ^ mask;
245264
}
@@ -249,7 +268,7 @@ public static long2 abs(long2 x)
249268
}
250269
}
251270

252-
/// <summary> Returns the componentwise absolute value of a long3 vector. </summary>
271+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.long3"/>. </summary>
253272
[MethodImpl(MethodImplOptions.AggressiveInlining)]
254273
public static long3 abs(long3 x)
255274
{
@@ -265,7 +284,7 @@ public static long3 abs(long3 x)
265284
}
266285
}
267286

268-
/// <summary> Returns the componentwise absolute value of a long4 vector. </summary>
287+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.long4"/>. </summary>
269288
[MethodImpl(MethodImplOptions.AggressiveInlining)]
270289
public static long4 abs(long4 x)
271290
{
@@ -282,79 +301,79 @@ public static long4 abs(long4 x)
282301
}
283302

284303

285-
/// <summary> Returns the absolute value of a quarter value. </summary>
304+
/// <summary> Returns the absolute value of a <see cref="quarter"/>. </summary>
286305
[MethodImpl(MethodImplOptions.AggressiveInlining)]
287306
public static quarter abs(quarter x)
288307
{
289308
return asquarter((byte)(asbyte(x) & 0b0111_1111));
290309
}
291310

292-
/// <summary> Returns the componentwise absolute value of a quarter2 vector. </summary>
311+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.quarter2"/>. </summary>
293312
[MethodImpl(MethodImplOptions.AggressiveInlining)]
294313
public static quarter2 abs(quarter2 x)
295314
{
296315
return asquarter(asbyte(x) & 0b0111_1111);
297316
}
298317

299-
/// <summary> Returns the componentwise absolute value of a quarter3 vector. </summary>
318+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.quarter3"/>. </summary>
300319
[MethodImpl(MethodImplOptions.AggressiveInlining)]
301320
public static quarter3 abs(quarter3 x)
302321
{
303322
return asquarter(asbyte(x) & 0b0111_1111);
304323
}
305324

306-
/// <summary> Returns the componentwise absolute value of a quarter4 vector. </summary>
325+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.quarter4"/>. </summary>
307326
[MethodImpl(MethodImplOptions.AggressiveInlining)]
308327
public static quarter4 abs(quarter4 x)
309328
{
310329
return asquarter(asbyte(x) & 0b0111_1111);
311330
}
312331

313-
/// <summary> Returns the componentwise absolute value of a quarter8 vector. </summary>
332+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.quarter8"/>. </summary>
314333
[MethodImpl(MethodImplOptions.AggressiveInlining)]
315334
public static quarter8 abs(quarter8 x)
316335
{
317336
return asquarter(asbyte(x) & 0b0111_1111);
318337
}
319338

320339

321-
/// <summary> Returns the absolute value of a half value. </summary>
340+
/// <summary> Returns the absolute value of a <see cref="half"/>. </summary>
322341
[MethodImpl(MethodImplOptions.AggressiveInlining)]
323342
public static half abs(half x)
324343
{
325344
return new half { value = ((ushort)(x.value & 0x7FFF)) };
326345
}
327346

328-
/// <summary> Returns the componentwise absolute value of a half2 vector. </summary>
347+
/// <summary> Returns the componentwise absolute value of a <see cref="half2"/>. </summary>
329348
[MethodImpl(MethodImplOptions.AggressiveInlining)]
330349
public static half2 abs(half2 x)
331350
{
332351
return ashalf(asushort(x) & 0x7FFF);
333352
}
334353

335-
/// <summary> Returns the componentwise absolute value of a half3 vector. </summary>
354+
/// <summary> Returns the componentwise absolute value of a <see cref="half3"/>. </summary>
336355
[MethodImpl(MethodImplOptions.AggressiveInlining)]
337356
public static half3 abs(half3 x)
338357
{
339358
return ashalf(asushort(x) & 0x7FFF);
340359
}
341360

342-
/// <summary> Returns the componentwise absolute value of a half4 vector. </summary>
361+
/// <summary> Returns the componentwise absolute value of a <see cref="half4"/>. </summary>
343362
[MethodImpl(MethodImplOptions.AggressiveInlining)]
344363
public static half4 abs(half4 x)
345364
{
346365
return ashalf(asushort(x) & 0x7FFF);
347366
}
348367

349-
/// <summary> Returns the componentwise absolute value of a half8 vector. </summary>
368+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.half8"/>. </summary>
350369
[MethodImpl(MethodImplOptions.AggressiveInlining)]
351370
public static half8 abs(half8 x)
352371
{
353372
return ashalf(asushort(x) & 0x7FFF);
354373
}
355374

356375

357-
/// <summary> Returns the componentwise absolute value of a float8 vector. </summary>
376+
/// <summary> Returns the componentwise absolute value of a <see cref="MaxMath.float8"/>. </summary>
358377
[MethodImpl(MethodImplOptions.AggressiveInlining)]
359378
public static float8 abs(float8 x)
360379
{

0 commit comments

Comments
 (0)