You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
578 B
23 lines
578 B
require_rv32;
|
|
sreg_t sshamt = P_FIELD(RS2, 0, 8);
|
|
P_RD_RS1_DW_LOOP(16, 16, {
|
|
if (sshamt < 0) {
|
|
uint32_t shx;
|
|
if (sshamt < -16)
|
|
shx = 0;
|
|
else if (sshamt == -16)
|
|
shx = ((uint16_t)p_rs1 >> 15) & 1;
|
|
else
|
|
shx = ((uint32_t)(uint16_t)p_rs1 << 1) >> (-sshamt);
|
|
p_rd = (uint16_t)((shx + 1) >> 1);
|
|
} else {
|
|
uint32_t shx = (sshamt >= 16) ? ((uint32_t)(uint16_t)p_rs1 << 16) : ((uint32_t)(uint16_t)p_rs1 << sshamt);
|
|
if (shx > 0xFFFF) {
|
|
P.VU.vxsat->write(1);
|
|
p_rd = 0xFFFF;
|
|
} else {
|
|
p_rd = (uint16_t)shx;
|
|
}
|
|
}
|
|
})
|
|
|
|
|