RISC - V : Is there any way to parse a word to a float?

Viewed 104

I am trying to divide a float to a word

  fmul.s f8, f2, s5

every time I try to run it an error pops up mentioning Too few or incorrectly formatted operands. Expected: fmul.d f1, f2, f3, dyn

1 Answers

You'll need to first convert the word value into a float with an fcvt instruction:

fcvt.s.w  f1, x5

then you can use a normal floating point fmul or fdiv instruction

Related