Handbook
Glossary
vfma ( a b c -- d )
Vocabulary
math
.
vectors
Inputs
a
a
sequence
b
a
sequence
c
a
sequence
Outputs
d
a
sequence
Word description
Computes a*b+c per lane with one rounding. SIMD float-4 and double-2 round at their lane precision; half-8 rounds once to binary16. The compiler does not implicitly fuse v* followed by v+.
Definition
IN:
math.vectors
GENERIC:
vfma
( a b c -- d )
Methods
USING:
math.libm
math.vectors
math.vectors.simd
sequences
;
M:
bfloat-8
vfma
[
ffmaf
]
3map
;
USING:
accessors
cpu.architecture
kernel
math.vectors
math.vectors.simd
math.vectors.simd.intrinsics
;
M::
double-2
vfma
( a b c -- d )
a
double-2?
b
double-2?
and
[
a
underlying>>
b
underlying>>
c
underlying>>
double-2-rep
(simd-vfma)
double-2
boa
]
[
b
bad-simd-vector
]
if
;
inline
USING:
accessors
cpu.architecture
kernel
math.vectors
math.vectors.simd
math.vectors.simd.intrinsics
;
M::
float-4
vfma
( a b c -- d )
a
float-4?
b
float-4?
and
[
a
underlying>>
b
underlying>>
c
underlying>>
float-4-rep
(simd-vfma)
float-4
boa
]
[
b
bad-simd-vector
]
if
;
inline
USING:
math.vectors
math.vectors.simd
math.vectors.simd.extensions
;
M:
half-8
vfma
half-fma
;
USING:
kernel
math.functions
math.vectors
sequences
;
M:
object
vfma
[
fma
]
3map
;
inline
USING:
kernel
math.vectors
math.vectors.simd
;
M:
simd-128
vfma
2drop
bad-simd-vector
;