[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v11 32/77] target/riscv: rvv-1.0: iota instruction
From: |
frank . chang |
Subject: |
[PATCH v11 32/77] target/riscv: rvv-1.0: iota instruction |
Date: |
Fri, 10 Dec 2021 15:56:18 +0800 |
From: Frank Chang <frank.chang@sifive.com>
Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
target/riscv/insn32.decode | 2 +-
target/riscv/insn_trans/trans_rvv.c.inc | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode
index d139c0aade..3ac5162aeb 100644
--- a/target/riscv/insn32.decode
+++ b/target/riscv/insn32.decode
@@ -632,7 +632,7 @@ vfirst_m 010000 . ..... 10001 010 ..... 1010111
@r2_vm
vmsbf_m 010100 . ..... 00001 010 ..... 1010111 @r2_vm
vmsif_m 010100 . ..... 00011 010 ..... 1010111 @r2_vm
vmsof_m 010100 . ..... 00010 010 ..... 1010111 @r2_vm
-viota_m 010110 . ..... 10000 010 ..... 1010111 @r2_vm
+viota_m 010100 . ..... 10000 010 ..... 1010111 @r2_vm
vid_v 010110 . 00000 10001 010 ..... 1010111 @r1_vm
vext_x_v 001100 1 ..... ..... 010 ..... 1010111 @r
vmv_s_x 001101 1 00000 ..... 110 ..... 1010111 @r2
diff --git a/target/riscv/insn_trans/trans_rvv.c.inc
b/target/riscv/insn_trans/trans_rvv.c.inc
index 9206e6f06c..80cbf0cadb 100644
--- a/target/riscv/insn_trans/trans_rvv.c.inc
+++ b/target/riscv/insn_trans/trans_rvv.c.inc
@@ -2757,12 +2757,18 @@ GEN_M_TRANS(vmsbf_m)
GEN_M_TRANS(vmsif_m)
GEN_M_TRANS(vmsof_m)
-/* Vector Iota Instruction */
+/*
+ * Vector Iota Instruction
+ *
+ * 1. The destination register cannot overlap the source register.
+ * 2. If masked, cannot overlap the mask register ('v0').
+ * 3. An illegal instruction exception is raised if vstart is non-zero.
+ */
static bool trans_viota_m(DisasContext *s, arg_viota_m *a)
{
if (require_rvv(s) &&
vext_check_isa_ill(s) &&
- require_noover(a->rd, s->lmul, a->rs2, 0) &&
+ !is_overlapped(a->rd, 1 << MAX(s->lmul, 0), a->rs2, 1) &&
require_vm(a->vm, a->rd) &&
require_align(a->rd, s->lmul)) {
uint32_t data = 0;
--
2.31.1
- [PATCH v11 24/77] target/riscv: rvv-1.0: load/store whole register instructions, (continued)
- [PATCH v11 24/77] target/riscv: rvv-1.0: load/store whole register instructions, frank . chang, 2021/12/10
- [PATCH v11 25/77] target/riscv: rvv-1.0: update vext_max_elems() for load/store insns, frank . chang, 2021/12/10
- [PATCH v11 26/77] target/riscv: rvv-1.0: take fractional LMUL into vector max elements calculation, frank . chang, 2021/12/10
- [PATCH v11 28/77] target/riscv: rvv-1.0: floating-point classify instructions, frank . chang, 2021/12/10
- [PATCH v11 27/77] target/riscv: rvv-1.0: floating-point square-root instruction, frank . chang, 2021/12/10
- [PATCH v11 30/77] target/riscv: rvv-1.0: find-first-set mask bit instruction, frank . chang, 2021/12/10
- [PATCH v11 29/77] target/riscv: rvv-1.0: count population in mask instruction, frank . chang, 2021/12/10
- [PATCH v11 31/77] target/riscv: rvv-1.0: set-X-first mask bit instructions, frank . chang, 2021/12/10
- [PATCH v11 33/77] target/riscv: rvv-1.0: element index instruction, frank . chang, 2021/12/10
- [PATCH v11 34/77] target/riscv: rvv-1.0: allow load element with sign-extended, frank . chang, 2021/12/10
- [PATCH v11 32/77] target/riscv: rvv-1.0: iota instruction,
frank . chang <=
- [PATCH v11 35/77] target/riscv: rvv-1.0: register gather instructions, frank . chang, 2021/12/10
- [PATCH v11 41/77] target/riscv: rvv-1.0: single-width averaging add and subtract instructions, frank . chang, 2021/12/10
- [PATCH v11 40/77] target/riscv: rvv-1.0: integer extension instructions, frank . chang, 2021/12/10
- [PATCH v11 36/77] target/riscv: rvv-1.0: integer scalar move instructions, frank . chang, 2021/12/10
- [PATCH v11 45/77] target/riscv: rvv-1.0: widening integer multiply-add instructions, frank . chang, 2021/12/10
- [PATCH v11 38/77] target/riscv: rvv-1.0: floating-point scalar move instructions, frank . chang, 2021/12/10
- [PATCH v11 47/77] target/riscv: rvv-1.0: integer comparison instructions, frank . chang, 2021/12/10
- [PATCH v11 42/77] target/riscv: rvv-1.0: single-width bit shift instructions, frank . chang, 2021/12/10
- [PATCH v11 43/77] target/riscv: rvv-1.0: integer add-with-carry/subtract-with-borrow, frank . chang, 2021/12/10
- [PATCH v11 37/77] target/riscv: rvv-1.0: floating-point move instruction, frank . chang, 2021/12/10