diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-06-06 03:24:27 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-06-18 08:56:11 -0700 |
commit | 655aedc0ebd2326d69d389bc714c2d622bf2cb08 (patch) | |
tree | aa2cf79905906cde9ff6d10c63d1499fb4a484a1 /riscv/insns/vsadd_vi.h | |
parent | 235aa58bfb439c9782defe8bdd21f792e40aac31 (diff) | |
download | spike-655aedc0ebd2326d69d389bc714c2d622bf2cb08.zip spike-655aedc0ebd2326d69d389bc714c2d622bf2cb08.tar.gz spike-655aedc0ebd2326d69d389bc714c2d622bf2cb08.tar.bz2 |
rvv: add integer/fixed-point/mask/reduction/permutation instructions
based on v-spec 0.7.1, support
sections: 12/13/15.1 ~ 15.2/16/17
element size: 8/16/32/64
support ediv: 1
Signed-off-by: Bruce Hoult <bruce@hoult.org>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Signed-off-by: Dave Wen <dave.wen@sifive.com>
Diffstat (limited to 'riscv/insns/vsadd_vi.h')
-rw-r--r-- | riscv/insns/vsadd_vi.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/riscv/insns/vsadd_vi.h b/riscv/insns/vsadd_vi.h new file mode 100644 index 0000000..de2cb83 --- /dev/null +++ b/riscv/insns/vsadd_vi.h @@ -0,0 +1,27 @@ +// vsadd.vi vd, vs2 simm5 +VI_LOOP_BASE +bool sat = false; +switch(sew) { +case e8: { + VI_PARAMS(e8); + vd = sat_add<int8_t, uint8_t>(vs2, vsext(simm5, sew), sat); + break; +} +case e16: { + VI_PARAMS(e16); + vd = sat_add<int16_t, uint16_t>(vs2, vsext(simm5, sew), sat); + break; +} +case e32: { + VI_PARAMS(e32); + vd = sat_add<int32_t, uint32_t>(vs2, vsext(simm5, sew), sat); + break; +} +default: { + VI_PARAMS(e64); + vd = sat_add<int64_t, uint64_t>(vs2, vsext(simm5, sew), sat); + break; +} +} +P.VU.vxsat |= sat; +VI_LOOP_END |