Mojo function
fma
fma(a: Int, b: Int, c: Int) -> Int
Performs fma
(fused multiply-add) on the inputs.
The result is (a * b) + c
.
Args:
- a (
Int
): The first input. - b (
Int
): The second input. - c (
Int
): The third input.
Returns:
(a * b) + c
.
fma(a: UInt, b: UInt, c: UInt) -> UInt
Performs fma
(fused multiply-add) on the inputs.
The result is (a * b) + c
.
Args:
- a (
UInt
): The first input. - b (
UInt
): The second input. - c (
UInt
): The third input.
Returns:
(a * b) + c
.
fma[type: DType, simd_width: Int](a: SIMD[type, simd_width], b: SIMD[type, simd_width], c: SIMD[type, simd_width]) -> SIMD[type, simd_width]
Performs elementwise fma
(fused multiply-add) on the inputs.
Each element in the result SIMD vector is , where , and are elements at index in a, b, and c respectively.
Parameters:
- type (
DType
): Thedtype
of the input SIMD vector. - simd_width (
Int
): The width of the input and output SIMD vector.
Args:
- a (
SIMD[type, simd_width]
): The first vector of inputs. - b (
SIMD[type, simd_width]
): The second vector of inputs. - c (
SIMD[type, simd_width]
): The third vector of inputs.
Returns:
Elementwise fma
of a, b and c.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!