What does the vm operand control for VFSGNJN.VV?
With vm=0, only active elements selected by v0.t execute; vm=1 is unmasked. The page formula is vd[i] = {non-sign bits of vs2[i], NOT sign(vs1[i])}.
VFSGNJN.VV is an RVV single-width vector floating-point negated sign injection instruction with syntax vfsgnjn.vv vd, vs2, vs1[, v0.t]; each active element keeps the non-sign bits of vs2[i] and forms vd[i] from the inverted second-source sign bit.
VFSGNJN.VV performs lane-wise floating-point sign-bit composition on active elements within vl. The second source is same-lane vs1[i]; with vm=0, v0.t controls which elements execute, and vm=1 is unmasked. The official FSGNJ-class semantics are bit-pattern operations: non-sign bits come from vs2, the result sign is determined by the inverted second-source sign bit, and no floating-point exception flags are set; this is not FP arithmetic, comparison, or cross-lane reduction. V defines SEW=32 and SEW=64; Zvfh is required only for SEW=16.
Decode the OP-V encoding and execute lane-wise FP sign injection: keep the non-sign bits of vs2 and take the sign from the inverted same-lane vs1.
lane 0: bits 0x3fa00000 non-sign + !sign(0x3f000000) -> 0xbfa00000 (-1.25)
This lane follows the current-step highlight; the remaining lane results appear below.
V-extension FP instructions use the OP-V major opcode, with funct6, source registers, vm, funct3, vd, and opcode fields.
The teaching context fixes VLEN=4096, LMUL=m1, vstart=0, valid vtype, enabled VS/FS, and valid frm=RNE, with the selected binary32/64 supported. Equal source registers require equal initial bits; same-width destination/source overlap is legal.VL=0 updates no destination elements, including tails; inactive and tail values follow ma/ta without definite displayed values. Sign injection preserves the vs2 NaN payload and does not set fflags; it does not round by frm, but the architectural instruction still requires valid frm.
VFSGNJN.VV is best understood through OP-V encoding, same-lane vs1[i], v0.t masking, and per-active-element vd[i] = {non-sign bits of vs2[i], NOT sign(vs1[i])}.
32-bit OP-V encoding: funct6=001001, funct3=001, opcode=1010111. vs2 and vs1 supply the two same-lane vector sources.
The non-sign bits of vd[i] come from vs2[i]; its sign is the inverted second-source sign. NaNs are not canonicalized, FP exceptions are not raised, and the result is not rounded by frm.
Vector operands and results have SEW bits and EMUL=LMUL. Same-width destination/source overlap is legal; equal sources require equal initial bits. An ordinary masked destination cannot overlap v0; one source register cannot be read as both an EEW=1 mask and SEW-wide data.
Optional assembly v0.t means vm=0; omission means vm=1. Active elements satisfy vstart≤i<vl with the mask enabled. Prestart elements do not update or raise exceptions. At vstart≥vl or vl=0 all destination elements, including tails, remain unchanged. Other inactive/tail elements follow vma/vta; ta/ma does not guarantee zeroing.
V supplies FP32/FP64 and depends on F/D; these operations at SEW=16 require Zvfh. Require the extensions, supported widths, valid vtype, and enabled VS/FS; with H and virtualization V=1, vsstatus.VS/FS must also be enabled. Every vector FP instruction requires valid frm, even without rounding or at vl=0; use of invalid frm is reserved.
The animation fixes VLEN=4096, LMUL=m1, vstart=0, valid frm=RNE, valid vtype, and enabled VS/FS. VF scalars use FLEN=64, assuming valid NaN-boxing at SEW=32. Steps are educational, not processor cycles; input and exception limits are stated in the animation.
Assume V/VS/FS enabled, valid vtype, valid frm=RNE, supported e32,m1, VLMAX≥4, and a0=4; vsetvli sets vl=4 and vstart=0. Inputs are binary32; ft0, when used, is validly NaN-boxed at FLEN=64. Omitting v0.t makes this unmasked: v3=[-1,1,-1,-1], v2=[1,-2,3,+0] → v1=[1,-2,3,+0]. Tails follow ta without assumed zeroing.
Assume V/VS/FS enabled, valid vtype, valid frm=RNE, supported e32,m1, VLMAX≥4, and a0=4; vsetvli sets vl=4 and vstart=0. Inputs are binary32; ft0, when used, is validly NaN-boxed at FLEN=64. Omitting v0.t makes this unmasked: v3=[-1,1,-1,-1], v2=[1,-2,3,+0] → v1=[1,-2,3,+0]. Tails follow ta without assumed zeroing.
Assume V/VS/FS enabled, valid vtype, valid frm=RNE, supported e32,m1, VLMAX≥4, and a0=4; vsetvli sets vl=4 and vstart=0. Inputs are binary32; ft0, when used, is validly NaN-boxed at FLEN=64. Omitting v0.t makes this unmasked: v3=[-1,1,-1,-1], v2=[1,-2,3,+0] → v1=[1,-2,3,+0]. Tails follow ta without assumed zeroing.
With vm=0, only active elements selected by v0.t execute; vm=1 is unmasked. The page formula is vd[i] = {non-sign bits of vs2[i], NOT sign(vs1[i])}.
No. It is an FSGNJ-class bit-pattern operation that preserves the non-sign bits of vs2, combines a new sign bit, and does not set FP exception flags.
No. This instruction only uses sign-bit information from the second source; the non-sign bits of vs1[i] do not determine the result magnitude.