It should use the mask that for fabs operation to restoring the original
sign instead of generated from setcc operation that only mask the value need
to be converted.
Details
- Reviewers
craig.topper fakepaper56
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2574 | No underscores in variable names. |
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.
llvm/test/CodeGen/RISCV/rvv/ceil-vp.ll | ||
---|---|---|
46 | From this change vfsgnj.vv v8, v9, v8, v0.t -> vfsgnj.vv v8, v9, v8, v0 is from vmflt.vf (compared with the largest interger). |
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.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2623 | All of the operations that produced Truncated before this are using masked agnostic policy. Mask here is now a superset of SetccMask. So far all the bits in Mask that aren't set in SetccMask, we are copying the sign from elements in Src to "agnostic" elements in Truncated. |
I don't consider that copysign back only for converted value. Inactive element in SetccMask is still not changed in the source.
No underscores in variable names.