022c7550d9
target/riscv: Change gen_set_pc_imm to gen_update_pc
...
Reduce reliance on absolute values(by passing pc difference) to
prepare for PC-relative translation.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <20230526072124.298466-5-liweiwei@iscas.ac.cn >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2023-06-13 17:35:20 +10:00
4acaa133b1
target/riscv: Add a tb flags field for vstart
...
Once we mistook the vstart directly from the env->vstart. As env->vstart is not
a constant, we should record it in the tb flags if we want to use
it in translation.
Reported-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Message-Id: <20230324143031.1093-5-zhiwei_liu@linux.alibaba.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Tested-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-Id: <20230325105429.1142530-6-richard.henderson@linaro.org >
Message-Id: <20230412114333.118895-6-richard.henderson@linaro.org >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2023-05-05 10:49:50 +10:00
ebd476488d
target/riscv: Encode the FS and VS on a normal way for tb flags
...
Reuse the MSTATUS_FS and MSTATUS_VS for the tb flags positions is not a
normal way.
It will make it hard to change the tb flags layout. And even worse, if we
want to keep tb flags for a same extension togather without a hole.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Message-Id: <20230324143031.1093-4-zhiwei_liu@linux.alibaba.com >
[rth: Adjust trans_rvf.c.inc as well; use the typedef]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Tested-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-Id: <20230325105429.1142530-4-richard.henderson@linaro.org >
Message-Id: <20230412114333.118895-4-richard.henderson@linaro.org >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2023-05-05 10:49:50 +10:00
3b57254d8a
target/riscv: Fix format for comments
...
Fix formats for multi-lines comments.
Add spaces around single line comments(after "/*" and before "*/").
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Acked-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-Id: <20230405085813.40643-4-liweiwei@iscas.ac.cn >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2023-05-05 10:49:50 +10:00
c45eff30cb
target/riscv: Fix format for indentation
...
Fix identation problems, and try to use the same indentation strategy
in the same file.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-Id: <20230405085813.40643-3-liweiwei@iscas.ac.cn >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2023-05-05 10:49:50 +10:00
2f668fabbc
target/riscv: Avoid tcg_const_*
...
All uses are strictly read-only.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-05 13:46:13 -08:00
f43442961e
target/riscv: Drop tcg_temp_free
...
Translators are no longer required to free tcg temporaries.
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-05 13:44:08 -08:00
c1027460dc
target/riscv: Simplify check for EEW = 64 in trans_rvv.c.inc
...
Only V extension supports EEW = 64 in these cases: Zve64* extensions don't
support EEW = 64 in these cases as commented before the check.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-ID: <20230215020539.4788-14-liweiwei@iscas.ac.cn >
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com >
2023-03-01 15:17:56 -08:00
6ad831ebf1
target/riscv: Fix check for vector load/store instructions when EEW=64
...
The V extension supports all vector load and store instructions except
the V extension does not support EEW=64 for index values when XLEN=32.
(Section 18.3)
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-ID: <20230215020539.4788-13-liweiwei@iscas.ac.cn >
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com >
2023-03-01 15:17:55 -08:00
e80865e5f3
target/riscv: Add support for Zvfh/zvfhmin extensions
...
Zvfh supports vector float point instructions with SEW = 16
and supports conversions between 8-bit integers and binary16 values.
Zvfhmin supports vfwcvt.f.f.v and vfncvt.f.f.w instructions.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-ID: <20230215020539.4788-12-liweiwei@iscas.ac.cn >
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com >
2023-03-01 15:17:54 -08:00
2bc2853f15
target/riscv: Remove redundunt check for zve32f and zve64f
...
Require_zve32/64f have been overlapped by require_rvf/require_scale_rvf.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-ID: <20230215020539.4788-11-liweiwei@iscas.ac.cn >
[Palmer: commit text]
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com >
2023-03-01 15:17:53 -08:00
732b902dd5
target/riscv: Replace check for F/D to Zve32f/Zve64d in trans_rvv.c.inc
...
Check for Zve32f/Zve64d can overlap check for F/D.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-ID: <20230215020539.4788-10-liweiwei@iscas.ac.cn >
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com >
2023-03-01 15:17:52 -08:00
3f4a5a5314
target/riscv: Simplify check for Zve32f and Zve64f
...
V/Zve64f depend on Zve32f, so we can only check Zve32f in these cases.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-ID: <20230215020539.4788-9-liweiwei@iscas.ac.cn >
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com >
2023-03-01 15:17:51 -08:00
3ceeb19a53
target/riscv: Introduce helper_set_rounding_mode_chkfrm
...
The new helper always validates the contents of FRM, even
if the new rounding mode is not DYN. This is required by
the vector unit.
Track whether we've validated FRM separately from whether
we've updated fp_status with a given rounding mode, so that
we can elide calls correctly.
This partially reverts d6c4d3f2a6
which attempted the to do
the same thing, but with two calls to gen_set_rm(), which is
both inefficient and tickles an assertion in decode_save_opc.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1441
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <20230115160657.3169274-2-richard.henderson@linaro.org >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2023-01-20 10:14:14 +10:00
2c9d747121
target/riscv: Add itrigger support when icount is not enabled
...
When icount is not enabled, there is no API in QEMU that can get the
guest instruction number.
Translate the guest code in a way that each TB only has one instruction.
After executing the instruction, decrease the count by 1 until it reaches 0
where the itrigger fires.
Note that only when priviledge matches the itrigger configuration,
the count will decrease.
Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <20221013062946.7530-2-zhiwei_liu@linux.alibaba.com >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2023-01-06 10:42:55 +10:00
a3ab69f9f6
target/riscv: rvv-1.0: vf[w]redsum distinguish between ordered/unordered
...
Starting with RVV1.0, the original vf[w]redsum_vs instruction was renamed
to vf[w]redusum_vs. The distinction between ordered and unordered is also
more consistent with other instructions, although there is no difference
in implementation between the two for QEMU.
Signed-off-by: Yang Liu <liuyang22@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Message-Id: <20220817074802.20765-2-liuyang22@iscas.ac.cn >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-27 11:23:57 +10:00
edabcd0e0a
target/riscv: rvv: Add mask agnostic for vector permutation instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165570784143.17634.35095816584573691-9@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-07 09:18:33 +02:00
35f2d795f3
target/riscv: rvv: Add mask agnostic for vector mask instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165570784143.17634.35095816584573691-8@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-07 09:18:33 +02:00
5b448f44c9
target/riscv: rvv: Add mask agnostic for vector floating-point instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165570784143.17634.35095816584573691-7@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-07 09:18:33 +02:00
6e11d7eaa0
target/riscv: rvv: Add mask agnostic for vector integer comparison instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165570784143.17634.35095816584573691-5@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-07 09:18:33 +02:00
fd93045ebf
target/riscv: rvv: Add mask agnostic for vector integer shift instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165570784143.17634.35095816584573691-4@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-07 09:18:33 +02:00
bce9a636be
target/riscv: rvv: Add mask agnostic for vx instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165570784143.17634.35095816584573691-3@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-07 09:18:33 +02:00
265ecd4c62
target/riscv: rvv: Add mask agnostic for vector load / store instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165570784143.17634.35095816584573691-2@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-07 09:18:33 +02:00
355d5584de
target/riscv: rvv: Add mask agnostic for vv instructions
...
According to v-spec, mask agnostic behavior can be either kept as
undisturbed or set elements' bits to all 1s. To distinguish the
difference of mask policies, QEMU should be able to simulate the mask
agnostic behavior as "set mask elements' bits to all 1s".
There are multiple possibility for agnostic elements according to
v-spec. The main intent of this patch-set tries to add option that
can distinguish between mask policies. Setting agnostic elements to
all 1s allows QEMU to express this.
This is the first commit regarding the optional mask agnostic
behavior. Follow-up commits will add this optional behavior
for all rvv instructions.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165570784143.17634.35095816584573691-1@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-09-07 09:18:32 +02:00
07314158f6
target/riscv: trans_rvv: Avoid assert for RV32 and e64
...
When running a 32-bit guest, with a e64 vmv.v.x and vl_eq_vlmax set to
true the `tcg_debug_assert(vece <= MO_32)` will be triggered inside
tcg_gen_gvec_dup_i32().
This patch checks that condition and instead uses tcg_gen_gvec_dup_i64()
is required.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1028
Suggested-by: Robert Bu <robert.bu@gmail.com >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20220608234701.369536-1-alistair.francis@opensource.wdc.com >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:42:12 +10:00
803963f7cb
target/riscv: rvv: Add tail agnostic for vector permutation instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-15@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
acc6ffd482
target/riscv: rvv: Add tail agnostic for vector mask instructions
...
The tail elements in the destination mask register are updated under
a tail-agnostic policy.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-14@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
5eacf7d8a0
target/riscv: rvv: Add tail agnostic for vector floating-point instructions
...
Compares write mask registers, and so always operate under a tail-
agnostic policy.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-12@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
89a32de2d5
target/riscv: rvv: Add tail agnostic for vector integer merge and move instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-10@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
7b1bff41c1
target/riscv: rvv: Add tail agnostic for vector integer shift instructions
...
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-8@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
5c19fc156e
target/riscv: rvv: Add tail agnostic for vx, vvm, vxm instructions
...
`vmadc` and `vmsbc` produces a mask value, they always operate with
a tail agnostic policy.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-7@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
752614cab8
target/riscv: rvv: Add tail agnostic for vector load / store instructions
...
Destination register of unit-stride mask load and store instructions are
always written with a tail-agnostic policy.
A vector segment load / store instruction may contain fractional lmul
with nf * lmul > 1. The rest of the elements in the last register should
be treated as tail elements.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-6@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
f1eed927fb
target/riscv: rvv: Add tail agnostic for vv instructions
...
According to v-spec, tail agnostic behavior can be either kept as
undisturbed or set elements' bits to all 1s. To distinguish the
difference of tail policies, QEMU should be able to simulate the tail
agnostic behavior as "set tail elements' bits to all 1s".
There are multiple possibility for agnostic elements according to
v-spec. The main intent of this patch-set tries to add option that
can distinguish between tail policies. Setting agnostic elements to
all 1s allows QEMU to express this.
This is the first commit regarding the optional tail agnostic
behavior. Follow-up commits will add this optional behavior
for all rvv instructions.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-5@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
41d3d7f76a
target/riscv: rvv: Early exit when vstart >= vl
...
According to v-spec (section 5.4):
When vstart ≥ vl, there are no body elements, and no elements are
updated in any destination vector register group, including that
no tail elements are updated with agnostic values.
vmsbf.m, vmsif.m, vmsof.m, viota.m, vcompress instructions themselves
require vstart to be zero. So they don't need the early exit.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165449614532.19704.7000832880482980398-4@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-06-10 09:31:42 +10:00
02b511985e
target/riscv: rvv: Fix early exit condition for whole register load/store
...
Vector whole register load instructions have EEW encoded in the opcode,
so we shouldn't take SEW here. Vector whole register store instructions
are always EEW=8.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <165181414065.18540.14828125053334599921-0@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-05-24 09:48:20 +10:00
f32d82f6c3
target/riscv: optimize helper for vmv<nr>r.v
...
LEN is not used for GEN_VEXT_VMV_WHOLE macro, so vmv<nr>r.v can share
the same helper
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <20220325085902.29500-2-liweiwei@iscas.ac.cn >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-04-22 10:35:16 +10:00
c341e886d9
target/riscv: optimize condition assign for scale < 0
...
for some cases, scale is always equal or less than 0, since lmul is not larger than 3
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn >
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <20220325085902.29500-1-liweiwei@iscas.ac.cn >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-04-22 10:35:16 +10:00
e03b56863d
Replace config-time define HOST_WORDS_BIGENDIAN
...
Replace a config-time define with a compile time condition
define (compatible with clang and gcc) that must be declared prior to
its usage. This avoids having a global configure time define, but also
prevents from bad usage, if the config header wasn't included before.
This can help to make some code independent from qemu too.
gcc supports __BYTE_ORDER__ from about 4.6 and clang from 3.2.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
[ For the s390x parts I'm involved in ]
Acked-by: Halil Pasic <pasic@linux.ibm.com >
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20220323155743.1585078-7-marcandre.lureau@redhat.com >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2022-04-06 10:50:37 +02:00
8ff8ac6329
target/riscv: rvv: Add missing early exit condition for whole register load/store
...
According to v-spec (section 7.9):
The instructions operate with an effective vector length, evl=NFIELDS*VLEN/EEW,
regardless of current settings in vtype and vl. The usual property that no
elements are written if vstart ≥ vl does not apply to these instructions.
Instead, no elements are written if vstart ≥ evl.
Signed-off-by: eop Chen <eop.chen@sifive.com >
Reviewed-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-Id: <164762720573.18409.3931931227997483525-0@git.sr.ht >
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-04-01 08:40:55 +10:00
79bf3b51ac
target/riscv: access configuration through cfg_ptr in DisasContext
...
The implementation in trans_{rvi,rvv,rvzfh}.c.inc accesses the shallow
copies (in DisasContext) of some of the elements available in the
RISCVCPUConfig structure. This commit redirects accesses to use the
cfg_ptr copied into DisasContext and removes the shallow copies.
Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Suggested-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20220202005249.3566542-4-philipp.tomsich@vrull.eu >
[ Changes by AF:
- Fixup checkpatch failures
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-02-16 12:24:18 +10:00
d8c40c24fd
target/riscv: Adjust scalar reg in vector with XLEN
...
When sew <= 32bits, not need to extend scalar reg.
When sew > 32bits, if xlen is less that sew, we should sign extend
the scalar register, except explicitly specified by the spec.
Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220120122050.41546-21-zhiwei_liu@c-sky.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:57 +10:00
40f0c2046c
target/riscv: Sign extend pc for different XLEN
...
When pc is written, it is sign-extended to fill the widest supported XLEN.
Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220120122050.41546-5-zhiwei_liu@c-sky.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:57 +10:00
6db02328a7
target/riscv: rvv-1.0: Add Zve32f support for narrowing type-convert insns
...
Vector narrowing conversion instructions are provided to and from all
supported integer EEWs for Zve32f extension.
Signed-off-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220118014522.13613-17-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:56 +10:00
f4dcf51cdc
target/riscv: rvv-1.0: Add Zve32f support for widening type-convert insns
...
Vector widening conversion instructions are provided to and from all
supported integer EEWs for Zve32f extension.
Signed-off-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220118014522.13613-16-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:56 +10:00
8527b5db72
target/riscv: rvv-1.0: Add Zve32f support for single-width fp reduction insns
...
Vector single-width floating-point reduction operations for EEW=32 are
supported for Zve32f extension.
Signed-off-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220118014522.13613-15-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:56 +10:00
abe2d74032
target/riscv: rvv-1.0: Add Zve32f support for scalar fp insns
...
Zve32f extension requires the scalar processor to implement the F
extension and implement all vector floating-point instructions for
floating-point operands with EEW=32 (i.e., no widening floating-point
operations).
Signed-off-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220118014522.13613-14-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:56 +10:00
da61f1256f
target/riscv: rvv-1.0: Add Zve32f support for configuration insns
...
All Zve* extensions support the vector configuration instructions.
Signed-off-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220118014522.13613-13-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:56 +10:00
68fa38970e
target/riscv: rvv-1.0: Add Zve64f support for narrowing type-convert insns
...
Vector narrowing conversion instructions are provided to and from all
supported integer EEWs for Zve64f extension.
Signed-off-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220118014522.13613-10-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:56 +10:00
235d1161d4
target/riscv: rvv-1.0: Add Zve64f support for widening type-convert insns
...
Vector widening conversion instructions are provided to and from all
supported integer EEWs for Zve64f extension.
Signed-off-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220118014522.13613-9-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:56 +10:00
193fb5c9bd
target/riscv: rvv-1.0: Add Zve64f support for single-width fp reduction insns
...
Vector single-width floating-point reduction operations for EEW=32 are
supported for Zve64f extension.
Signed-off-by: Frank Chang <frank.chang@sifive.com >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20220118014522.13613-8-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com >
2022-01-21 15:52:56 +10:00