Maybe I'm missing something there. Particularly whether or not you can know anything about frm's value after a call has returned. Normally the answer to this kind of question is a hard no.

AFAICT the main difference to standard mode switching is that we (ab)use it to set the rounding mode to the value it had initially, either at function entry or after a call. That's different to regular mode switching which assumes "static" rounding modes for different instructions.

Standard could e.g. be:
- insn1 demands frm1
- call1 demands frm4
- call2 demands frm5

Whereas we have:
- insn1 demands frm1
- call1 demands "frm at the start of the function"
- call2 demands "frm after call1 that could have called fesetround"

And that's where the "backup" comes from.  We pretend to have a "static"
rounding mode that we can set before call1 or call2 but need to update
it after each call (or inline asm etc.).

Thus we read FRM after each call, or rather after the last call before
an FRM setter.

--
Regards
Robin

Reply via email to