1 \documentclass[slidestop
]{beamer
}
2 \usepackage{beamerthemesplit
}
6 \title{Simple-V RISC-V Extension for Vectorisation and SIMD
}
7 \author{Luke Kenneth Casson Leighton
}
14 \huge{Simple-V RISC-V Extension for Vectors and SIMD
}\\
16 \Large{Flexible Vectorisation
}\\
17 \Large{(aka not so Simple-V?)
}\\
19 \Large{Chennai
9th RISC-V Workshop
}\\
25 \frame{\frametitle{Why another Vector Extension?
}
28 \item RVV very heavy-duty (excellent for supercomputing)
\vspace{10pt
}
29 \item Simple-V abstracts parallelism (based on best of RVV)
\vspace{10pt
}
30 \item Graded levels: hardware, hybrid or traps
\vspace{10pt
}
31 \item Even Compressed instructions become vectorised
\vspace{10pt
}
33 What Simple-V is not:
\vspace{10pt
}
35 \item A full supercomputer-level Vector Proposal
\vspace{10pt
}
36 \item A replacement for RVV (designed to be augmented)
\vspace{10pt
}
40 \frame{\frametitle{Quick refresher on SIMD
}
43 \item SIMD very easy to implement (and very seductive)
\vspace{10pt
}
44 \item Parallelism is in the ALU
\vspace{10pt
}
45 \item Zero-to-Negligeable impact for rest of core
\vspace{10pt
}
47 Where SIMD Goes Wrong:
\vspace{10pt
}
49 \item See "Why SIMD considered harmful"
\vspace{10pt
}
50 \item (Corner-cases alone are extremely complex)
\vspace{10pt
}
51 \item O($N^
{6}$) ISA opcode proliferation!
\vspace{10pt
}
55 \frame{\frametitle{Quick refresher on RVV
}
58 \item Extremely powerful (extensible to
256 registers)
\vspace{10pt
}
59 \item Supports polymorphism, several datatypes (inc. FP16)
\vspace{10pt
}
60 \item Requires a separate Register File
\vspace{10pt
}
61 \item Can be implemented as a separate pipeline
\vspace{10pt
}
63 However...
\vspace{10pt
}
65 \item 98 percent opcode duplication with rest of RV (CLIP)
\vspace{10pt
}
66 \item Extending RVV requires customisation
\vspace{10pt
}
71 \frame{\frametitle{How is Parallelism abstracted?
}
74 \item Almost all opcodes removed in favour of implicit "typing"
\vspace{10pt
}
75 \item Primarily at the Instruction issue phase (except SIMD)
\vspace{10pt
}
76 \item Standard (and future, and custom) opcodes now parallel
\vspace{10pt
}
80 \item LOAD/STORE (inc. C.LD and C.ST, LDX: everything)
\vspace{10pt
}
81 \item All ALU ops (soft / hybrid / full HW, on per-op basis)
\vspace{10pt
}
82 \item All branches become predication targets (C.FNE added)
\vspace{10pt
}
87 \frame{\frametitle{How are SIMD Instructions Vectorised?
}
90 \item SIMD ALU(s) primarily unchanged
\vspace{10pt
}
91 \item Predication is added to each SIMD element (NO ZEROING!)
\vspace{10pt
}
92 \item End of Vector enables predication (NO ZEROING!)
\vspace{10pt
}
94 Considerations:
\vspace{10pt
}
96 \item Many SIMD ALUs possible (parallel execution)
\vspace{10pt
}
97 \item Very long SIMD ALUs could waste die area (short vectors)
\vspace{10pt
}
98 \item Implementor free to choose (API remains the same)
\vspace{10pt
}
102 \frame{\frametitle{What's the deal / juice / score?
}
105 \item Standard Register File(s) overloaded with "vector span"
\vspace{10pt
}
106 \item Element width and type concepts remain same as RVV
\vspace{10pt
}
107 \item CSRs are key-value tables (overlaps allowed)
\vspace{10pt
}
109 Key differences from RVV:
\vspace{10pt
}
111 \item Predication in INT regs as a BIT field (max VL=XLEN)
\vspace{10pt
}
112 \item Minimum VL must be Num Regs -
1 (all regs single LD/ST)
\vspace{10pt
}
113 \item NO ZEROING: non-predicated elements are skipped
\vspace{10pt
}
117 \frame{\frametitle{Why are overlaps allowed in Regfiles?
}
120 \item Same register(s) can have multiple "interpretations"
\vspace{10pt
}
121 \item xBitManip plus SIMD plus xBitManip = Hi/Lo bitops
\vspace{10pt
}
122 \item (
32-bit GREV plus
4-wide
32-bit SIMD plus
32-bit GREVI)
\vspace{10pt
}
123 \item 32-bit op followed by
16-bit op w/
2x VL,
1/
2 predicated
\vspace{10pt
}
127 \item xBitManip reduces O($N^
{6}$) SIMD down to O($N^
{3}$)
\vspace{10pt
}
128 \item Hi-Performance: Macro-op fusion (more pipeline stages?)
\vspace{10pt
}
133 \frame{\frametitle{Why no Zeroing (place zeros in non-predicated elements)?
}
136 \item Zeroing is an implementation optimisation favouring OoO
\vspace{10pt
}
137 \item Simple implementations may skip non-predicated operations
\vspace{10pt
}
138 \item Simple implementations explicitly have to destroy data
\vspace{10pt
}
139 \item Complex implementations may use reg-renames to save power
\vspace{10pt
}
141 Considerations:
\vspace{10pt
}
143 \item Complex not really impacted, Simple impacted a LOT
\vspace{10pt
}
144 \item Please don't use Vectors for "security" (use Sec-Ext)
\vspace{10pt
}
149 \begin{frame
}[fragile
]
150 \frametitle{ADD pseudocode (or trap, or actual hardware loop)
}
153 function op_add(rd, rs1, rs2, predr) # add not VADD!
154 int i, id=
0, irs1=
0, irs2=
0;
155 for (i=
0; i < MIN(VL, vectorlen
[rd
]); i++)
156 if (ireg
[predr
] &
1<<i) # predication uses intregs
157 ireg
[rd+id
] <= ireg
[rs1+irs1
] + ireg
[rs2+irs2
];
158 if (reg_is_vectorised
[rd
]) \
{ id +=
1; \
}
159 if (reg_is_vectorised
[rs1
]) \
{ irs1 +=
1; \
}
160 if (reg_is_vectorised
[rs2
]) \
{ irs2 +=
1; \
}
164 \item SIMD slightly more complex (case above is elwidth = default)
165 \item Scalar-scalar and scalar-vector and vector-vector now all in one
166 \item OoO may choose to push ADDs into instr. queue (v. busy!)
170 \begin{frame
}[fragile
]
171 \frametitle{Predication-Branch (or trap, or actual hardware loop)
}
174 s1 = vectorlen
[src1
] >
1;
175 s2 = vectorlen
[src2
] >
1;
176 for (int i =
0; i < VL; ++i)
177 preg
[rs3
] |=
1 << cmp(s1 ? reg
[src1+i
] : reg
[src1
],
178 s2 ? reg
[src2+i
] : reg
[src2
]);
182 \item SIMD slightly more complex (case above is elwidth = default)
183 \item If s1 and s2 both scalars, Standard branch occurs
184 \item Predication stored in integer regfile as a bitfield
185 \item Scalar-vector and vector-vector supported
189 \begin{frame
}[fragile
]
190 \frametitle{LD/LD.S/LD.X (or trap, or actual hardware loop)
}
193 if (unit-strided) stride = elsize;
194 else stride = areg
[as2
]; // constant-strided
195 for (int i =
0; i < VL; ++i)
196 if (preg_enabled
[rd
] && (
[!
]preg
[rd
] &
1<<i))
197 for (int j =
0; j < seglen+
1; j++)
198 if (vectorised
[rs2
]) offs = vreg
[rs2
][i
]
199 else offs = i*(seglen+
1)*stride;
200 vreg
[rd+j
][i
] = mem
[sreg
[base
] + offs + j*stride
]
204 \item Again: SIMD slightly more complex
205 \item rs2 vectorised taken to implicitly indicate LD.X
210 \frame{\frametitle{slide
}
215 Considerations:
\vspace{10pt
}
222 \frame{\frametitle{Opcodes, compared to RVV
}
225 \item All integer and FP opcodes all removed (no CLIP!)
\vspace{10pt
}
226 \item VMPOP, VFIRST etc. all removed (use xBitManip)
\vspace{10pt
}
227 \item VSLIDE, VEXTRACT, VINSERT removed (using regfile)
\vspace{10pt
}
228 \item VSETVL, VGETVL, VSELECT stay
\vspace{10pt
}
229 \item Issue: VCLIP is not in RV* (add with custom ext?)
\vspace{10pt
}
230 \item Vector (or scalar-vector) use C.MV (MV is a pseudo-op)
\vspace{10pt
}
231 \item VMERGE: twin predicated C.MVs (one inverted. macro-op'd)
\vspace{10pt
}
236 \frame{\frametitle{Under consideration
}
239 \item Can VSELECT be removed (or overloaded onto xBitManip)?
\vspace{10pt
}
240 \item Can CLIP be done as a CSR (mode, like elwidth)
\vspace{10pt
}
241 \item SIMD saturation (etc.) also set as a mode?
\vspace{10pt
}
246 \frame{\frametitle{slide
}
251 Considerations:
\vspace{10pt
}
258 \frame{\frametitle{slide
}
263 Considerations:
\vspace{10pt
}
270 \frame{\frametitle{Including a plot
}
272 % \includegraphics[height=2in]{dental.ps}\\
273 {\bf \red Dental trajectories for
27 children:
}
277 \frame{\frametitle{Creating .pdf slides in WinEdt
}
280 \item LaTeX
[Shift-Control-L
]\vspace{10pt
}
281 \item dvi2pdf
[click the button
]\vspace{24pt
}
283 To print
4 slides per page in acrobat click
\vspace{10pt
}
285 \item File/print/properties
\vspace{10pt
}
286 \item Change ``pages per sheet'' to
4\vspace{10pt
}