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 floating-point elements to 2*SEW and reduce them with wide vs1[0] in an unordered sum; only wide vd[0] holds the reduction result, and other destination elements are tail.
VFWREDUSUM.VS is the RVV widening unordered floating-point reduction sum. It promotes active narrow vs2 elements within vl to 2*SEW and combines them with wide vs1[0] in an ISA-permitted deterministic reduction tree; only wide vd[0] holds the reduction result, while other destination elements are tail managed by the current tail policy. With vl=0, no operation is performed and the destination is not updated. The ISA does not prescribe one tree, one intermediate precision at every node, or one numeric result; use VFWREDOSUM.VS when increasing element-order semantics are required.
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
0xc4861257Active promoted elements: 1, 3, 4
Reduction trace:
Writeback
v4[0] = 9
This is one legal example tree, not an ISA-mandated unique reduction result.
Show the OP-V instruction encoding; invalid inputs produce no encoding.
VFWREDUSUM.VS combines promoted active vs2 elements with wide vs1[0] in a legal unordered reduction tree; the reduction result is in wide vd[0], other destination elements are tail, and the tree is not uniquely prescribed by the ISA.
When reading VFWREDUSUM.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 vfwredusum.vs v4, v8, v12, v0.t # only vd[0] receives a 2*SEW reduction result».
The ISA permits unordered reduction trees; floating-point rounding can vary with implementation or configuration. Use VFWREDOSUM.VS for ordered semantics.
With vm=0, v0 selects active source elements; with vm=1, all body source elements participate. Masked-off source elements are excluded, while destination elements other than vd[0] are tail and follow the tail policy.