Skip to content

SIMD Math tracking issue #666

Open
Open
@WhiteBlackGoose

Description

@WhiteBlackGoose

COMMUNITY-DRIVEN WORK TRACKING ISSUE

Tracks implementation of the SIMD Math Proposal.

It is being implemented in the feature/math-simd.

Tasks

API implementation

#665 (generator)

  • Create
  • Load
  • Add
  • Subtract
  • Multiply
  • Divide
  • Abs
  • Constants
  • And
  • Or
  • Xor
  • Not
  • AllBitsSet
  • IsHardwareAccelerated

#670

  • Equal
  • NotEqual
  • GreaterThan
  • GreaterOrEqual
  • LessThan
  • LessThanOrEqual
  • Min
  • Max

#684

  • IsFinite
  • IsInfinity
  • IsNaN
  • IsNegative
  • IsNegativeInfinity
  • IsNormal
  • IsPositiveInfinity
  • Sign

Arithmetics

  • Negate

Special

  • As
  • IEEERemainder

Trigonometry

  • Acos
  • Acosh
  • Asin
  • Asinh
  • Atan2
  • Atan
  • Atanh
  • Cos
  • Cosh
  • Sin
  • Sinh
  • Tan
  • Tanh

Powers

  • Exp
  • Cbrt
  • Sqrt
  • Pow
  • Log10
  • Log
  • Log of two args
  • Reciprocal

Rounding

  • Floor
  • Ceiling
  • Round
  • Round of two args
  • Truncate

Bit operations

  • ShiftLeft
  • ShiftRight
  • RotateLeft
  • RotateRight

Tests

For all bitnesses x for all types

#670

  • 4 arithmetic operators
  • Less/Greater Than (OrEqual)
  • Min, Max
  • (Not)Equal
  • Bitwise operations

#684

  • State of number

Other

  • Create, Load, Store
  • Regular trigonometry
  • Hyperbolic trigonometry
  • Inverse trigonometry
  • Inverse hyperbolic trigonometry
  • Power
  • Rounding
  • Bit operations

Benchmarks

For all bitnesses x for all types

#670

  • 4 arithmetic operators
  • Less/Greater Than (OrEqual)
  • Min, Max
  • (Not)Equal

#684

  • State of number
  • Bitwise operations
  • Abs

Other

  • Create, Load, Store
  • Regular trigonometry
  • Hyperbolic trigonometry
  • Inverse trigonometry
  • Inverse hyperbolic trigonometry
  • Power
  • Rounding
  • Bit operations

TODOs

#670

  • Make fallback to 128-bit if 256-bit is not supported
  • Use naive operations for 8-byte values on simd64

#684

  • The random feeder should be either static or without seed or anything, otherwise it fills both vectors with the same data

Other

  • Divide for integers to be done in a more efficient way link
  • Multiply for bytes to be done in a more efficient way link
  • Use intrinsic ShiftRight/ShiftLeft once proposal is impl
  • Remove unmanaged constraints where possible
  • Relax constraints to struct where possible
  • Hardware accelerated comparison operations for long and ulong

Far TODOs

  • Propose & add support for Simd512 (that requires runtime support)

To discuss

#678

  • AllBitsSet API for Scalar

#690

Other

  • MaxValueOver2 API for Simd and Scalar
  • IsHardwareAccelerated should be && IsSupported? Otherwise Simd128<MyAwesomeType>.IsHardwareAccelerated returns true on net5 on avx machine
  • Math.Abs throws on Math.Abs(int.MinValue). We can keep it, or we can have a faster version without this check
  • CopySign API

Metadata

Metadata

Type

No type

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions