[PATCH] D155908: [RISCV] Use original mask for restoring the original sign instead of from setcc

Jim Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 20:40:30 PDT 2023


Jim added a comment.

In D155908#4521162 <https://reviews.llvm.org/D155908#4521162>, @fakepaper56 wrote:

> Could you provide an example why we need to use the old Mask for copysingn?

I do not have C code or LLVM IR example.

During lowering rounding operation, it is converted to the absolute value with the mask that is from vp (or all ones mask for unmasked),
and compare with the largest integer that can be represented exactly. This comparision generates new mask that is used to only convert
the value less than the largest integer. The end, we copy the sign back to the value that should use the old mask the same with fabs operation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155908



More information about the llvm-commits mailing list