Skip to content

Commit

Permalink
Merge pull request #292 from qwe661234/master
Browse files Browse the repository at this point in the history
Fix constant optimization on RV32F instructions
  • Loading branch information
jserv authored Dec 15, 2023
2 parents 03bd04c + 1b0118d commit 265293b
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions src/rv32_constopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,29 +650,50 @@ CONSTOPT(fmaxs, {})
*/

/* FCVT.W.S */
CONSTOPT(fcvtws, {})
CONSTOPT(fcvtws, {
if (ir->rd)
info->is_constant[ir->rd] = false;
})

/* FCVT.WU.S */
CONSTOPT(fcvtwus, {})
CONSTOPT(fcvtwus, {
if (ir->rd)
info->is_constant[ir->rd] = false;
})

/* FMV.X.W */
CONSTOPT(fmvxw, {})
CONSTOPT(fmvxw, {
if (ir->rd)
info->is_constant[ir->rd] = false;
})

/* FEQ.S performs a quiet comparison: it only sets the invalid operation
* exception flag if either input is a signaling NaN.
*/
CONSTOPT(feqs, {})
CONSTOPT(feqs, {
if (ir->rd)
info->is_constant[ir->rd] = false;
})

/* FLT.S and FLE.S perform what the IEEE 754-2008 standard refers to as
* signaling comparisons: that is, they set the invalid operation exception
* flag if either input is NaN.
*/
CONSTOPT(flts, {})
CONSTOPT(flts, {
if (ir->rd)
info->is_constant[ir->rd] = false;
})

CONSTOPT(fles, {})
CONSTOPT(fles, {
if (ir->rd)
info->is_constant[ir->rd] = false;
})

/* FCLASS.S */
CONSTOPT(fclasss, {})
CONSTOPT(fclasss, {
if (ir->rd)
info->is_constant[ir->rd] = false;
})

/* FCVT.S.W */
CONSTOPT(fcvtsw, {})
Expand Down

0 comments on commit 265293b

Please # to comment.