(no commit message)
[libreriscv.git] / simple_v_extension / specification / ld.x.mdwn
1 [[!tag oldstandards]]
2
3 **THIS PAGE US OBSOLETE, OUT OF DATE, AND MUST BE REPLACED. THE BUGREPORT
4 IS NOT OUT-OF-DATE**
5
6 # LD.X and LD.Swizzle
7
8 See <http://bugs.libre-soc.org/show_bug.cgi?id=139>
9
10 SV is based on vectorisation of scalar opcodes. LD and ST from scalar RISCV can be extended by either rd or rs1 being vectorised, however a third "immediate element strided" multiples do not fit.
11
12 In addition, Vulkan requires swizzled LD/ST covering:
13
14 * identity (no swizzle)
15 * constant 0
16 * 1 or 1.0 depending on Op type
17 * x, y, z, or w.
18
19 See <https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkComponentSwizzle.html>
20
21 Note that the swizzle has to be on selecting the src that will go into a sequentially indexed dest:
22
23 for i in range(4):
24 srcidx = swizzle[i]
25 srcaddr = base + srcidx * elwidth
26 regs[rd+i] = mem[srcaddr]
27
28 Swizzling on the dest would not work because xxyz would try to set the same dest twice.