%horizontal-add-vector ( dst src1 src2 rep -- )


Vocabulary
cpu.architecture

Inputs and outputs
dstdestination register symbol
src1first source register
src2second source register
reprepresentation


Word description
Emits machine code for performing a horizontal add, meaning that adjacent elements in the same operand are added together. So if the two vectors are (a0, a1, a2, a3) and (b0, b1, b2, b3) then the result is (a0 + a1, a2 + a3, b0 + b1, b2 + b3).

Examples
USING: cpu.architecture make tools.disassembler ; [ XMM0 XMM1 XMM2 float-4-rep %horizontal-add-vector ] B{ } make disassemble 0000000002660870: 0f28c1 movaps xmm0, xmm1
0000000002660873: f20f7cc2 haddps xmm0, xmm2


Definition


Methods