diff options
author | Dave.Wen <dave.wen@sifive.com> | 2019-03-31 22:21:04 -0700 |
---|---|---|
committer | Dave.Wen <dave.wen@sifive.com> | 2019-03-31 22:31:09 -0700 |
commit | 2edd3d33d6b2af567e3a639ac3ad1b106beab8d5 (patch) | |
tree | 7003eb4066eff7670f684082a914cc59d44ec517 /riscv | |
parent | b59625b34ef809fe5a297b6a971f2dc6e1a7e778 (diff) | |
download | spike-2edd3d33d6b2af567e3a639ac3ad1b106beab8d5.zip spike-2edd3d33d6b2af567e3a639ac3ad1b106beab8d5.tar.gz spike-2edd3d33d6b2af567e3a639ac3ad1b106beab8d5.tar.bz2 |
rvv: add clip instructions
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/insns/vnclip_vi.h | 3 | ||||
-rw-r--r-- | riscv/insns/vnclip_vv.h | 5 | ||||
-rw-r--r-- | riscv/insns/vnclip_vx.h | 3 | ||||
-rw-r--r-- | riscv/insns/vnclipu_vi.h | 3 | ||||
-rw-r--r-- | riscv/insns/vnclipu_vv.h | 3 | ||||
-rw-r--r-- | riscv/insns/vnclipu_vx.h | 3 |
6 files changed, 13 insertions, 7 deletions
diff --git a/riscv/insns/vnclip_vi.h b/riscv/insns/vnclip_vi.h index c7c4e5e..22f1bfa 100644 --- a/riscv/insns/vnclip_vi.h +++ b/riscv/insns/vnclip_vi.h @@ -1,7 +1,7 @@ // vnclip: vd[i] = clip(round(vs2[i] + rnd) >> simm) int64_t round = 0; VRM vrm = STATE.VU.get_vround_mode(); -reg_t sew_lo; +reg_t sew_lo = 0; VI_VI_LOOP ({ if (i % 2 == 0){ @@ -36,4 +36,5 @@ VI_VI_LOOP if (result >= (int64_t)(2^(sew - 1))) result = (2^(sew - 1)) - 1; + vd = result; }) diff --git a/riscv/insns/vnclip_vv.h b/riscv/insns/vnclip_vv.h index 06f98b2..3fd54b9 100644 --- a/riscv/insns/vnclip_vv.h +++ b/riscv/insns/vnclip_vv.h @@ -1,7 +1,7 @@ // vnclip: vd[i] = clip(round(vs2[i] + rnd) >> vs1[i]) int64_t round = 0; VRM vrm = STATE.VU.get_vround_mode(); -reg_t sew_lo; +reg_t sew_lo = 0; VI_VV_LOOP ({ if (i % 2 == 0){ @@ -35,5 +35,6 @@ VI_VV_LOOP // saturation if (result >= (int64_t)(2^(sew - 1))) result = (2^(sew - 1)) - 1; - + + vd = result; }) diff --git a/riscv/insns/vnclip_vx.h b/riscv/insns/vnclip_vx.h index 623872d..c30b042 100644 --- a/riscv/insns/vnclip_vx.h +++ b/riscv/insns/vnclip_vx.h @@ -1,7 +1,7 @@ // vnclip: vd[i] = clip(round(vs2[i] + rnd) >> rs1[i]) int64_t round = 0; VRM vrm = STATE.VU.get_vround_mode(); -reg_t sew_lo; +reg_t sew_lo = 0; VI_VX_LOOP ({ if (i % 2 == 0){ @@ -36,4 +36,5 @@ VI_VX_LOOP if (result >= (int64_t)(2^(sew - 1))) result = (2^(sew - 1)) - 1; + vd = result; }) diff --git a/riscv/insns/vnclipu_vi.h b/riscv/insns/vnclipu_vi.h index 6b94d2b..f7c41f0 100644 --- a/riscv/insns/vnclipu_vi.h +++ b/riscv/insns/vnclipu_vi.h @@ -1,7 +1,7 @@ // vnclipu: vd[i] = clip(round(vs2[i] + rnd) >> simm) int64_t round = 0; VRM vrm = STATE.VU.get_vround_mode(); -reg_t sew_lo; +reg_t sew_lo = 0; VI_VI_LOOP ({ if (i % 2 == 0){ @@ -36,4 +36,5 @@ VI_VI_LOOP if (result >= (uint64_t)(2^(sew - 1))) result = (2^(sew - 1)) - 1; + vd = result; }) diff --git a/riscv/insns/vnclipu_vv.h b/riscv/insns/vnclipu_vv.h index 65b7528..a9ba1d0 100644 --- a/riscv/insns/vnclipu_vv.h +++ b/riscv/insns/vnclipu_vv.h @@ -1,7 +1,7 @@ // vnclipu: vd[i] = clip(round(vs2[i] + rnd) >> vs1[i]) int64_t round = 0; VRM vrm = STATE.VU.get_vround_mode(); -reg_t sew_lo; +reg_t sew_lo = 0; VI_VV_LOOP ({ if (i % 2 == 0){ @@ -36,4 +36,5 @@ VI_VV_LOOP if (result >= (uint64_t)(2^(sew - 1))) result = (2^(sew - 1)) - 1; + vd = result; }) diff --git a/riscv/insns/vnclipu_vx.h b/riscv/insns/vnclipu_vx.h index 172cdc1..fb06bc5 100644 --- a/riscv/insns/vnclipu_vx.h +++ b/riscv/insns/vnclipu_vx.h @@ -1,7 +1,7 @@ // vnclipu: vd[i] = clip(round(vs2[i] + rnd) >> rs1[i]) int64_t round = 0; VRM vrm = STATE.VU.get_vround_mode(); -reg_t sew_lo; +reg_t sew_lo = 0; VI_VX_LOOP ({ if (i % 2 == 0){ @@ -36,4 +36,5 @@ VI_VX_LOOP if (result >= (uint64_t)(2^(sew - 1))) result = (2^(sew - 1)) - 1; + vd = result; }) |