1 # OpenPOWER SV setvl/setvli
5 * <http://lists.libre-soc.org/pipermail/libre-soc-dev/2020-November/001366.html>
6 * <https://bugs.libre-soc.org/show_bug.cgi?id=535>
7 * <https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#vsetvlivsetvl-instructions>
11 | 0..5 |6..10|11..15|16.20|21.22.23.24..25|26.....30|31| name |
12 |------|-----|------|-----|---------------|---------|--|---------|
13 | 19 | RT | RA | | XO[0:4] | XO[5:9] |Rc| XL-Form |
14 | 19 | RT | RA |imm | imm // vs ms | NNNNNN |Rc| setvl/i |
18 // instruction fields:
19 rd = get_rt_field(); // bits 6..10
20 ra = get_ra_field(); // bits 11..15
21 vlimmed = get_immed_field(); // bits 16..22
22 vs = get_vs_field(); // bit 24
23 ms = get_ms_field(); // bit 25
24 Rc = get_Rc_field(); // bit 31
27 // 3 options: from SPR, from immed, from ra
39 // 2 options: from SPR, from immed
46 // calculate (limit) VL