efriedma added a comment.

> Constrained intrinsics don't change the rounding mode.

The standard text for FENV_ROUND requires that when we see a floating point 
operation, we have to perform it using the specified rounding mode.  
"floating-point operators [...] shall be evaluated according to the specified 
constant rounding mode (as though no constant mode was specified and the 
corresponding dynamic rounding mode had been established by a call to 
fesetround)".  Like you've noted, we don't have any way to represent that 
directly in LLVM IR.  So the frontend probably needs to emit code to modify the 
rounding mode.

> Because of the requirement that the rounding mode be changed already, I don't 
> see how instructions with static rounding modes are generally interesting. 
> Perhaps a target will learn to recognize that a sequence of instructions can 
> use the static rounding in the instructions and elide a change of rounding 
> mode around the sequence? I don't know how common that would be in practice.

If you're using FENV_ROUND, presumably sequences involving rounding mode 
changes become more common.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126364/new/

https://reviews.llvm.org/D126364

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to