From: Luke Kenneth Casson Leighton Date: Tue, 1 Dec 2020 13:17:01 +0000 (+0000) Subject: add pseudocode and format for setvl(i) X-Git-Tag: convert-csv-opcode-to-binary~1556 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aebb69ecf9e881f0e376431d1e2d007a8db44dfd;p=libreriscv.git add pseudocode and format for setvl(i) --- diff --git a/openpower/sv/setvl.mdwn b/openpower/sv/setvl.mdwn index b827a953d..873c50673 100644 --- a/openpower/sv/setvl.mdwn +++ b/openpower/sv/setvl.mdwn @@ -4,3 +4,40 @@ See links: * * + +# Format + +| 0..5 |6....10|11....16|17...20|21.22|23.24|25.26|27...30|31| name | +|------|-------|--------|-------|-----|-----|--|--|-------|--|---------| +| 19 | RT | RA | | XO[0:4] XO[5:10] |/ | XL-Form | +| 19 | (RT|0)| (RA|0) |vlimmed |// |vs|ms| NNNNN |/ | setvl/i | + +# Pseudocode + + // instruction fields: + rd = get_rt_field(); + ra = get_ra_field(); + vlimmed = get_immed_field(); + + if vs { + VL = vlimmed + } else { + VL = SPR[SV_VL] + } + if ms { + MVL = vlimmed + } else { + MVL = SPR[SV_MVL] + } + // calculate VL + VL = min(VL, MVL) + + // store VL, MVL + SPR[SV_VL] = VL + SPR[SV_MVL] = MVL + + // write rd + if rd != 0 { + // rd is not x0 + regs[rd] = VL; + }