\frametitle{ADD pseudocode (or trap, or actual hardware loop)}
\begin{semiverbatim}
-function op_add(rd, rs1, rs2, predr) \{
+function op_add(rd, rs1, rs2, predr) \{ # add not PADD!
int i, id=0, irs1=0, irs2=0;
for (i=0; i < MIN(VL, vectorlen[rd]); i++)
- if (predicate[predr][i]) # integer regfile: bitfield
- x[rd+id] <= x[rs1+irs1] + x[rs2+irs2];
+ if (ireg[predr] & 1<<i) # predication uses intregs
+ ireg[rd+id] <= ireg[rs1+irs1] + ireg[rs2+irs2];
# now increment idxs: src/dest all vec/scalar
if (reg_is_vectorised[rd]) \{ id += 1; \}
if (reg_is_vectorised[rs1]) \{ irs1 += 1; \}