Check vl first
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
Promote active SEW-wide vs2 elements to 2*SEW and sum them in increasing element order; wide vs1[0] is the seed, only wide vd[0] holds the reduction result, and other destination elements are tail.
VFWREDOSUM.VS is the RVV widening ordered floating-point reduction sum. It promotes active vs2 floating-point elements within vl from SEW to 2*SEW and adds them in increasing element order starting from wide vs1[0]; only wide vd[0] holds the reduction result, while other destination elements are tail managed by the current tail policy. Masked-off elements affect neither the result nor FP exception flags. With vl=0, no operation is performed and the destination is not updated; with nonzero vl but no active source elements, no addition is performed and the seed is written to vd[0].
A checkable FP32-to-FP64 reduction example; NaN, infinity, and exception flags are not simulated.
wide scalar result: element 0 of any v0-v31
SEW narrow source; cannot share a register with wide vs1
wide seed: element 0 of any register; not v0 when masked
finite FP64 demo value
exactly 4 values representable as finite FP32
exactly 4 0/1 bits
0xcc861257Active promoted elements: 1, 3, 4
Reduction trace:
Writeback
v4[0] = 9
This demo follows increasing active-element order.
Show the OP-V instruction encoding; invalid inputs produce no encoding.
VFWREDOSUM.VS promotes narrow vs2 elements and sums them in active-element order starting from wide vs1[0]; the reduction result is in wide vd[0], while other destination elements are tail.
When reading VFWREDOSUM.VS, do not stop at the mnemonic. Official V-extension semantics also depend on the current vl, vtype, and mask state. The suffix and operand form determine whether sources are vector, scalar, or immediate values.
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
The current vtype supplies SEW, LMUL, tail policy, and mask policy; these affect element width, register-group size, and inactive/tail destination elements.
For ordinary vector instructions with vm, vm=0 uses v0 as the execution mask and vm=1 is unmasked. A few forms such as VMERGE use v0 as data-selection input.
Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vfwredosum.vs v4, v8, v12, v0.t # vd[0] = (((vs1[0] + vs2[0]) + ...) + vs2[vl-1])».
Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vfwredosum.vs v4, v8, v12, v0.t # vd[0] = (((vs1[0] + vs2[0]) + ...) + vs2[vl-1])».
No. Ordinary RVV floating-point operations and FP conversions use floating-point frm or an instruction-specified fixed rounding mode; vxrm is for fixed-point rounding instructions.