[llvm] AMDGPU: Add tonearest and towardzero roundings for intrinsic llvm.fptrunc.round (PR #104486)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 21:29:03 PDT 2024


arsenm wrote:

> > lgtm but this should still just be a pattern
> 
> Do you mean the pattern to map "ISD::FPTRUNC_ROUND src, round" to pseudo? I am not sure how to translate round to the hardware rounding mode during the pattern matching!

Yes. You just need an SDNodeXForm to modify the value 

https://github.com/llvm/llvm-project/pull/104486


More information about the llvm-commits mailing list