Support VP_SETCC mask operations, turn it to logical operation.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
6140 | I don't think these are correct. Here's the equivalent code for regular setcc case ISD::SETGT: // X >s Y --> X == 0 & Y == 1 --> ~X & Y case ISD::SETULT: // X <u Y --> X == 0 & Y == 1 --> ~X & Y Temp = DAG.getNOT(dl, N0, OpVT); N0 = DAG.getNode(ISD::AND, dl, OpVT, N1, Temp); if (!DCI.isCalledByLegalizer()) DCI.AddToWorklist(Temp.getNode()); break; case ISD::SETLT: // X <s Y --> X == 1 & Y == 0 --> ~Y & X case ISD::SETUGT: // X >u Y --> X == 1 & Y == 0 --> ~Y & X Temp = DAG.getNOT(dl, N1, OpVT); N0 = DAG.getNode(ISD::AND, dl, OpVT, N0, Temp); if (!DCI.isCalledByLegalizer()) DCI.AddToWorklist(Temp.getNode()); break; case ISD::SETULE: // X <=u Y --> X == 0 | Y == 1 --> ~X | Y case ISD::SETGE: // X >=s Y --> X == 0 | Y == 1 --> ~X | Y Temp = DAG.getNOT(dl, N0, OpVT); N0 = DAG.getNode(ISD::OR, dl, OpVT, N1, Temp); if (!DCI.isCalledByLegalizer()) DCI.AddToWorklist(Temp.getNode()); break; case ISD::SETUGE: // X >=u Y --> X == 1 | Y == 0 --> ~Y | X case ISD::SETLE: // X <=s Y --> X == 1 | Y == 0 --> ~Y | X Temp = DAG.getNOT(dl, N1, OpVT); N0 = DAG.getNode(ISD::OR, dl, OpVT, N0, Temp); break; } |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
6140 | I have adjusted code according to regular setcc. Thanks for your advice. |
I don't think these are correct. Here's the equivalent code for regular setcc