[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 22:07:08 PDT 2023


Jim abandoned this revision.
Jim added a comment.

In D155908#4521270 <https://reviews.llvm.org/D155908#4521270>, @craig.topper wrote:

> In D155908#4521197 <https://reviews.llvm.org/D155908#4521197>, @fakepaper56 wrote:
>
>> In D155908#4521179 <https://reviews.llvm.org/D155908#4521179>, @Jim wrote:
>>
>>> 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.
>>
>> I think those elements inactive for `SetccMask` are not changed during the truncation and we don't care them.
>
> I don't think there was a bug here either. The passthru value for the copysign is the original source before the absolute value.

I don't consider that copysign back only for converted value. Inactive element in SetccMask is still not changed in the source.


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