Skip to content

MaxMath v1.1.0

Compare
Choose a tag to compare
@MrUnbelievable92 MrUnbelievable92 released this 05 Jan 06:23

Known Issues

  • half8 "equals" and "not equals" operators don't conform to the IEEE 754 standard - Unity has not yet reacted to my bug-report in regards to their "half" implementation.

Fixes

  • Fixed a bug where vshl-/vshr-ing a(n) (s)byte16 vector by 11 would return the vector itself

Changes

  • Changed the return type of count(boolx) to a uint instead of an int

Additions

RNG

  • Added/Modified 8, 16, 32 and 64 bit XOR-Shift pseudo random number generators:
  • They use the most efficient (Avx2) SIMD instructions to generate vectors with elements of the corresponding size in bytes. When compared to Unity.Mathematics, the performance is better since a) scalar multiplication of each generated value has been replaced by a single SIMD instruction and b) doubles are generated by Random64 instead of two 32-bit RNG iterations
  • Removed NextT(T max) from SIGNED integer and floating point types, since those will never generate negative numbers. One can either generate an unsigned integer and cast it to a signed value for free, or use the functions with min and max parameters, as both of these would be more clear in regards to what range the result will be in
  • Unity.Mathematics.Random is implicitly convertible to Random32 and vice versa. Safe and fast explicit type conversions between Random8, 16, 32 and 64 were added

Shuffle

  • Added bool8, bool16 and bool32 subvector getters

  • Added setters for half8 subvectors

  • Added (s)byte32 subvector getters

  • Added setters for (s)byte8 and s)byte16 subvectors

  • Added setters for (u)short8 subvectors

  • !!! Setters for (s)byte32, (u)short16, (u)int8 and float8 subvectors are implemented, but due to Unity.Burst related bugs, they are deactivated in the code. The issue has been forwarded a month ago and should be fixed with Burst 1.5

  • Slightly improved the performance of a select few (s)byte2/3/4 vector shuffle getters and setters