[X86][SSE] Handle basic inversion of PTEST/TESTP operands (PR38522)
PTEST/TESTP sets EFLAGS as: TESTZ: ZF = (Op0 & Op1) == 0 TESTC: CF = (~Op0 & Op1) == 0 TESTNZC: ZF == 0 && CF == 0 If we are inverting the 0'th operand of a PTEST/TESTP instruction we can adjust the comparisons to correct handle the inversion implicitly. Additionally, for "TESTZ" (ZF) cases, the allones case, PTEST(X,-1) can be simplified to PTEST(X,X). We can expand this for the TESTZ(X,~Y) pattern and also handle KTEST/KORTEST in the future. Differential Revision: https://reviews.llvm.org/D76984
Loading
Please sign in to comment