diff options
Diffstat (limited to 'riscv/insns/pusati_dw.h')
| -rw-r--r-- | riscv/insns/pusati_dw.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/riscv/insns/pusati_dw.h b/riscv/insns/pusati_dw.h new file mode 100644 index 00000000..04f33a6c --- /dev/null +++ b/riscv/insns/pusati_dw.h @@ -0,0 +1,13 @@ +require_rv32; +P_RD_RS1_DW_ULOOP(32, 32, { + uint64_t uint_max = insn.shamtw() ? UINT64_MAX >> (64 - insn.shamtw()) : 0; + int32_t s = (int32_t)p_rs1; + p_rd = p_rs1; + if (s < 0) { + p_rd = 0; + P.VU.vxsat->write(1); + } else if ((uint64_t)s > uint_max) { + p_rd = uint_max; + P.VU.vxsat->write(1); + } +})
\ No newline at end of file |
